Subject: still trying to compile egcs.. errors found so far

From: John Ballance <[email-masked]>
Date: Sat, 14 Nov 1998 01:35:33

Hi folks

I thought I'd report my efforts so far attempting to compile egcs-1.1b
for arm
(make bootstrap)
a) line 120 of gcc/config.in needs commenting out.. this says..TOP , and
causes
a later extern to fail.

b) gcc/include/unistd.h needs __linux__ defined.. where *SHOULD* this
occur?

c) later, when doing stage 1, /usr/include/crt0 is reported as having an 
unreadable format I guess this suggests I need some other later
libraries..

what ones? and from where?.. any help appreciated.

for thise such as Philip, or Russell, who will understand these, I
enclose
fragments of the various compile failures

Thanks

-- 
                      John Ballance
 Castle Technology, Ore Trading Estate, Woodbridge Road, Framlingham,
Suffolk UK IP13 9LL  Tel  44 (0) 1728 621 631, Fax  44 (0) 1728 621 179
web: http://www.castle-technology.co.uk or http://www.castlet.demon.co.uk

make[3]: Entering directory /usr/src/bin/arm-egcs-elf/gcc'
rm -f libgcc2.a
if [ -d . ]; then \
  cd .; \
  rm -f libgcc.a ; \
else true; \
fi
make GCC_FOR_TARGET="./xgcc -B./" \
  AR="ar" AR_FLAGS="rc" CC="gcc" CFLAGS="-g" \
  HOST_PREFIX="" HOST_PREFIX_1="loser-" \
  LANGUAGES="c " \
  LIBGCC2_CFLAGS="-O2   -DIN_GCC    -g -I./include   -g1  -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED   " libgcc2.a
make[4]: Entering directory /usr/src/bin/arm-egcs-elf/gcc'
rm -f tmplibgcc2.a
for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3
_ashldi3 _ashrdi3 _ffsdi2 _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2
_floatdidf _floatdisf _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi
_fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi _fixtfdi
_fixunstfdi _floatditf __gcc_bcmp _varargs __dummy _eprintf _bb _shtab
_clear_cache _trampoline __main _exit _ctors _pure; \
do \
  echo ${name}; \
  ./xgcc -B./ -O2   -DIN_GCC    -g -I./include   -g1  -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED    -I. -I../../../egcs-1.1b/gcc
-I../../../egcs-1.1b/gcc/config -c -DL${name} \
      ../../../egcs-1.1b/gcc/libgcc2.c -o ${name}.o; \
  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
  ar rc tmplibgcc2.a ${name}.o; \
  rm -f ${name}.o; \
done
_muldi3
In file included from ../../../egcs-1.1b/gcc/libgcc2.c:42:
include/unistd.h:136: parse error before __llseek'
include/unistd.h:136: parse error before __loff_t'
include/unistd.h:136: warning: data definition has no type or storage class
include/unistd.h:137: parse error before _lseek'
include/unistd.h:137: parse error before __loff_t'
include/unistd.h:137: warning: data definition has no type or storage class
make[4]: *** [libgcc2.a] Error 1
make[4]: Leaving directory /usr/src/bin/arm-egcs-elf/gcc'
make[3]: *** [stmp-multilib-sub] Error 2
make[3]: Leaving directory /usr/src/bin/arm-egcs-elf/gcc'
make[2]: *** [stmp-multilib] Error 1
make[2]: Leaving directory /usr/src/bin/arm-egcs-elf/gcc'
make[1]: *** [bootstrap] Error 2
make[1]: Leaving directory /usr/src/bin/arm-egcs-elf/gcc'
make: *** [bootstrap] Error 2
 the file unistd.h needs __linux__ defined before including gnu/types.h,
else the __loff_t type isnt defined

so.. how do I persuade the 'make bootstrap' process to 
have  __linux__ defined?

(obviously I can patch unistd.h for this, BUT, that
must then be done each time I rebuild the tree..)

next failure...

stage1/xgcc -Bstage1/
-DIN_GCC    -O2 -g  -DHAVE_CONFIG_H   -o cccp cccp.o cexp.o prefix.o \
  version.o obstack.o
/usr/lib/crt0.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make[1]: *** [cccp] Error 1
make[1]: Leaving directory /usr/src/bin/arm-egcs-elf/gcc'
make: *** [bootstrap] Error 2

(end of file)
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Philip Blundell <[email-masked]>
Date: Sun, 15 Nov 1998 21:02:38 +0100

>causes a later extern to fail.

Can you try to find out why this happens?  I built egcs natively on the 
netwinder on Friday and didn't have a problem.  I wonder if it might be caused 
by having an outdated version of some tool like sed.

>b) gcc/include/unistd.h needs __linux__ defined.. where *SHOULD* this

It should be predefined by the compiler.  Can you post the messages you get 
when compiling something with the -v option?  The theory is that the specs 
file includes "-Dlinux" and the gcc driver creates a second version with the 
underscores added at run time.

>unreadable format I guess this suggests I need some other later

You can't do `make bootstrap' directly if you're going from a.out to ELF.  
This is something I forgot to mention in the web page I wrote.  Instead, you 
need to build the first stage compiler by hand (just "make LANGUAGES=c"), then 
compile and install the C library using this newly built compiler (having 
first evacuated your a.out libraries from /usr/lib and /usr/include to some 
safe place).  Once this is done you should have a fully ELF-based system and 
you can go back and do "make bootstrap".

p.