building newlib on FreeBSD fails
Steve Watt
steve@chelsio.com
Tue Sep 2 21:13:00 GMT 2003
Greetings,
I'm attempting to build a FreeBSD cross ARM toolchain, and have come
across the following "interesting" behavior during compile. It turns
out that the cause is that the built gcc has a fixed include for
stdlib.h, which thus gets included before the newlib one, causing _DEFUN
to not be defined. Bad things occur thereafter.
I *guess* the bug is that the build/gcc/include directory is being searched
before the target include and newlib/libc/include, but I don't know what the
ramifications of changing that search order would be.
The same build works fine under Linux.
The files in build.fbsd-arm/gcc/include are:
README iso646.h stdarg.h stdlib.h time.h varargs.h
fixed limits.h stdbool.h string.h unistd.h
float.h mmintrin.h stddef.h syslimits.h unwind.h
The files in build.linux-arm/gcc/include are:
README float.h limits.h stdarg.h stddef.h unwind.h
fixed iso646.h mmintrin.h stdbool.h syslimits.h varargs.h
If I delete stdlib.h, string.h, time.h, and unistd.h after the build has
failed, it seems to produce something that works.
And here's how the build fails:
- - - 8< - - -
Making all in stdlib
gmake[7]: Entering directory `/.amd_mnt/mustang/host/users/steve/gnu-toolchain/build.fbsd-arm/arm-elf/thumb/newlib/libc/stdlib'
[ snip build ] ../../../../../../combined/newlib/libc/stdlib/__adjust.c
[ snip build ] ../../../../../../combined/newlib/libc/stdlib/__exp10.c
[ snip build ] ../../../../../../combined/newlib/libc/stdlib/__ten_mu.c
[ snip build ] ../../../../../../combined/newlib/libc/stdlib/_Exit.c
[ snip build ] ../../../../../../combined/newlib/libc/stdlib/abort.c
/.amd_mnt/mustang/host/users/steve/gnu-toolchain/build.fbsd-arm/gcc/xgcc -B/.amd_mnt/mustang/host/users/steve/gnu-toolchain/build.fbsd-arm/gcc/ -nostdinc -B/.amd_mnt/mustang/host/users/steve/gnu-toolchain/build.fbsd-arm/arm-elf/thumb/newlib/ -isystem /.amd_mnt/mustang/host/users/steve/gnu-toolchain/build.fbsd-arm/arm-elf/thumb/newlib/targ-include -isystem /.amd_mnt/mustang/host/users/steve/gnu-toolchain/combined/newlib/libc/include -B/usr/local/arm-tools/arm-elf/bin/ -B/usr/local/arm-tools/arm-elf/lib/ -isystem /usr/local/arm-tools/arm-elf/include -isystem /usr/local/arm-tools/arm-elf/sys-include -L/.amd_mnt/mustang/host/users/steve/gnu-toolchain/build.fbsd-arm/ld -mthumb -DPACKAGE=\"newlib\" -DVERSION=\"1.11.0\" -I. -I../../../../../../combined/newlib/libc/stdlib -O2 -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY -DARM_RDI_MONITOR -fno-builtin -O2 -g -O2 -O2 -g -O2 -mthumb -c ../../../../../../combined/newlib/libc/stdlib/abs.c
../../../../../../combined/newlib/libc/stdlib/abs.c:40: error: parse error before '(' token
gmake[7]: *** [abs.o] Error 1
gmake[7]: Leaving directory `/.amd_mnt/mustang/host/users/steve/gnu-toolchain/build.fbsd-arm/arm-elf/thumb/newlib/libc/stdlib'
gmake[6]: *** [all-recursive] Error 1
gmake[6]: Leaving directory `/.amd_mnt/mustang/host/users/steve/gnu-toolchain/build.fbsd-arm/arm-elf/thumb/newlib/libc'
gmake[5]: *** [all-recursive] Error 1
gmake[5]: Leaving directory `/.amd_mnt/mustang/host/users/steve/gnu-toolchain/build.fbsd-arm/arm-elf/thumb/newlib'
gmake[4]: *** [all-recursive-am] Error 2
gmake[4]: Leaving directory `/.amd_mnt/mustang/host/users/steve/gnu-toolchain/build.fbsd-arm/arm-elf/thumb/newlib'
gmake[3]: *** [multi-do] Error 1
gmake[3]: Leaving directory `/.amd_mnt/mustang/host/users/steve/gnu-toolchain/build.fbsd-arm/arm-elf/newlib'
gmake[2]: *** [all-multi] Error 2
gmake[2]: Leaving directory `/.amd_mnt/mustang/host/users/steve/gnu-toolchain/build.fbsd-arm/arm-elf/newlib'
gmake[1]: *** [all-recursive-am] Error 2
gmake[1]: Leaving directory `/.amd_mnt/mustang/host/users/steve/gnu-toolchain/build.fbsd-arm/arm-elf/newlib'
gmake: *** [all-target-newlib] Error 2
--
Steve Watt KD6GGD PP-ASEL-IA Email at home: steve@watt.com
Chelsio Communications http://www.chelsio.com/ work: steve@chelsio.com
510 N. Pastoria Ave Voice: +1 408 962 3627
Sunnyvale, CA, USA, 94085 Fax: +1 408 730 2580
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list