From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geir Harris Hedemark To: ecos-discuss@sourceware.cygnus.com Subject: Re: [ECOS] Problems with ecosSWtools and thumb-elf Date: Tue, 13 Jul 1999 03:35:00 -0000 Message-id: References: <199907121338.OAA13615@peshwari.cygnus.co.uk> X-SW-Source: 1999-07/msg00018.html jlarmour@cygnus.co.uk (Jonathan Larmour) writes: > If you do go down that route, let the list know how you get on, and just > ask if you have any problems. I'm sure someone should be able to help. I did. I picked up binutils-2.9.1 and egcs-1.1.2. I compiled and installed binutils first, then egcs. The options to configure were --target=thumb-coff --prefix=/local/hacks/arm. For some reason there is no elf support for thumb in binutils-2.9.1. Or was it egcs? I forget. 1: Since I will use this in an embedded system which will not run *nix or even have a filesystem or a terminal, I did not have or need the standard *.h files (stdio.h and so on). Had to define "inhibit_libc" when compiling libgcc2.c so xgcc would not barf on some includes. According to the code, that can lead to problems. 2: The makefile did not find the assembler by itself, even if I was compiling egcs with the same prefix as binutils. I had to have thumb-coff-as in my path. 3: The tests failed. It said: checking whether the C compiler (/data/nova/imp/software/gnu/build-egcs/gcc/xgcc -B/data/nova/imp/software/gnu/build-egcs/gcc/ -g -O2 ) works... no configure: error: installation or configuration problem: C compiler cannot create executables. make: *** [configure-target-libiberty] Error 1 However, I was able to generate a .s and a .o file without problems. If I tried to generate a a.out file directly, ld told me: /local/hacks/arm/thumb-coff/bin/ld: cannot open crt0.o: No such file or directory collect2: ld returned 1 exit status I cannot find this file. However when I link things manually: DEFAULT: $(cc) $(ccflags) -c boot.c $(ld) $(ldflags) -Map=image.map -o image.coff boot.o $(objcopy) --output-target=tekhex -S --verbose image.coff image.hex it works ok, assuming I take responsibility for start points and the like. ldflags = -O2 --cref -M -L/local/hacks/arm/thumb-coff/lib 4: When I try to use objdump to disassemble what I have just compiled from tekhex or binary format, I get four-byte instructions, not thumb code. Disassembling from coff works ok, I get sensible thumb code. Seems I have solved my most immediate problem(s), but egcs seems to have poorer cross-target support than the ecos tools. Is this correct? Geir