Compiling Newlib for ARM

fabrizio gennari
Wed Nov 11 08:56:00 GMT 2009


I am trying to cross-compile Newlib 1.17.0 for ARM using an i386 

PC with Ubuntu.

First I built the cross-compiler (gcc 4.4.1), 

excluding the parts that need the host's libc. The configure options 


--target=arm-unknown-linux-gnu --host=i686-pc-linux-gnu --


unknown-linux-gnu --disable-multilib --with-newlib --without-headers --

disable-nls --enable-threads=no --enable-symvers=gnu --enable-

__cxa_atexit --enable-languages=c --disable-shared

Then I added the 

directory with the newly-built cross-compiler to the path, went to the 

folder ~/newlib-1.17.0/newlib and typed

CC=arm-unknown-linux-gnu-gcc .
/configure --host=arm-unknown-linux-gnu

There was an error in 

compiling in libc/sys/arm/, the file newlib.h was not found. I worked 

around that by manually editing libc/sys/arm/Makefile: the line



NEWLIB_CFLAGS =  -I~/newlib-1.17.0/newlib/targ-include -O2 -

DARM_RDI_MONITOR -fno-builtin

(there is some stuff CC_FOR_NEWLIB 
including the right targ-include directory somewhere in the makefiles, 

but for some reasons it does not work)

But the most serious problem 
is: apparently the gcc cross-compler needs the file crt1.o, and that 
not built by Newlib. newlib/libc/sys/linux contains a crt1.c, but 
that directory is not built at all because, for ARM targets, 
newlib/libc/sys/arm is the only subdirectory of sys/ that is built.

How should I do that?


Passa a Tiscali Tutto Incluso Light: telefono + adsl 8 Mb senza limiti a soli 9,95 euro al mese fino al 01/04/2010. Gratis la Sim Tiscali Mobile con 25 euro di traffico.

L’offerta è valida solo se attivi entro il 12/11/09

More information about the Newlib mailing list