Compiling newlib on a cygwin host for arm-elf target

J. Johnston jjohnstn@redhat.com
Wed Feb 27 12:17:00 GMT 2002


Andy Hare wrote:
> 
> Hi,
> 
> I have been trying to get newlib to compile for the arm-elf target under
> cygwin on win2k. I get an error thus:
> 
> make[5]: Entering directory `/build/arm/thumb/newlib/libc/stdlib'
> arm-elf-gcc -DPACKAGE=\"newlib\" -DVERSION=\"1.10.0\"  -I. -I/GNU-Source-Cod
> e/src/newlib/libc/stdlib  -O2 -DHAVE_OPENDIR -DHAVE_RENAME -DSIGNAL_PROVIDED
>  -DWANT_IO_LONG_DBL -DWANT_PRINTF_LONG_LONG -D_COMPILING_NEWLIB -DHAVE_FCNTL
>  -I../../targ-include -I/GNU-Source-Code/src/newlib/libc/../libc/include -I/
> GNU-Source-Code/src/newlib/libc/../../winsup/cygwin/include  -I/GNU-Source-C
> ode/src/newlib/libc/../../winsup/w32api/include -fno-builtin      -g -O2  -m
> thumb -c /GNU-Source-Code/src/newlib/libc/stdlib/abort.c
> In file included from /GNU-Source-Code/src/newlib/libc/stdlib/abort.c:50:
> ../../targ-include/unistd.h:8:21: getopt.h: No such file or directory
> 
> I have used the following configure line :
> 
>  mkdir /build/arm/newlib ; \
>  cd /build/arm/newlib ; \
>  rm -r * ; \
>  export CC='arm-elf-gcc' ; \
>  /GNU-Source-Code/src/newlib/configure -v \
>    --host=i686-pc-cygwin \
>    --prefix=/xgcc-arm/gnu \
>    --exec-prefix=/xgcc-arm/gnu \
>    --target=arm-elf >$(HOME)/config-newlib.out 2>&1
> 

Andy,

  You don't configure newlib directly.  You must let the upper-level
configure do it for you.  Thus, you should be using
/GNU-Source-Code/src/configure
as opposed to /GNU-Source-Code/src/newlib/configure.

-- Jeff J.

> but looking at the sub-directories being genereted in the the build
> directory shows that the system is using the machine/i386 and sys/cygwin
> surely this cannot be right. I had expected that it would have machine/arm
> and sys/arm as sub-directories. Also the only way to get it to use the
> arm-elf-gcc compiler was to use the export part of the configure line.
> 
> Am I using the correct format in the configure line to create a cross newlib
> for the ARM under cygwin and if not can someone point me at the right line
> to use.
> 
> Thanks
> 
> Andy Hare
> www.ahare.btinternet.co.uk



More information about the Newlib mailing list