The combined tree newlib stuff used with non-newlib targets

Kai Ruottu karuottu@mbnet.fi
Mon Jun 19 11:13:00 GMT 2006


While trying to build a crosscompiler for 'sparc-solaris2.9':

configured with: ../configure --build=i686-linux-gnu 
--host=i686-linux-gnu --target=sparc-solaris2.9 --with-gnu-as 
--with-gnu-ld --enable-shared --enable-threads --enable-languages=c,c++

the following thing happened :

---------------- clip ----------------------
/data1/home/src/gcc-4.1.1/build/./gcc/xgcc 
-B/data1/home/src/gcc-4.1.1/build/./gcc/ -nostdinc 
-B/data1/home/src/gcc-4.1.1/build/sparc-solaris2.9/newlib/ -isystem 
/data1/home/src/gcc-4.1.1/build/sparc-solaris2.9/newlib/targ-include 
-isystem/data1/home/src/gcc-4.1.1/newlib/libc/include 
-B/usr/local/sparc-solaris2.9/bin/ -B/usr/local/sparc-solaris2.9/lib/ 
-isystem /usr/local/sparc-solaris2.9/include -isystem 
/usr/local/sparc-solaris2.9/sys-include -O2 -Os -DIN_GCC -DCROSS_COMPILE 
-W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition -isystem ./include -I. -I. -I../../gcc 
-I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include \
-c ../../gcc/config/sparc/gmon-sol2.c -o gmon.o
In file included from 
/data1/home/src/gcc-4.1.1/newlib/libc/include/sys/errno.h:11,
from /data1/home/src/gcc-4.1.1/newlib/libc/include/errno.h:9,
from ../../gcc/tsystem.h:96,
from ../../gcc/config/sparc/gmon-sol2.c:36:
/data1/home/src/gcc-4.1.1/newlib/libc/include/sys/reent.h:259: error: 
conflicting types for ‘__FILE’
/data1/home/src/gcc-4.1.1/build/./gcc/include/stdio_tag.h:30: error: 
previous declaration of ‘__FILE’ was here
In file included from 
/data1/home/src/gcc-4.1.1/newlib/libc/include/unistd.h:4,
from ../../gcc/tsystem.h:105,
from ../../gcc/config/sparc/gmon-sol2.c:36:
/data1/home/src/gcc-4.1.1/newlib/libc/include/sys/unistd.h:145: error: 
conflicting types for ‘swab’
/data1/home/src/gcc-4.1.1/build/./gcc/include/stdlib.h:153: error: 
previous declaration of ‘swab’ was here
../../gcc/config/sparc/gmon-sol2.c: In function ‘moncontrol’:
../../gcc/config/sparc/gmon-sol2.c:413: warning: implicit declaration of 
function ‘profil’
make[2]: *** [gmon.o] Error 1
make[2]: Leaving directory `/data1/home/src/gcc-4.1.1/build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/data1/home/src/gcc-4.1.1/build'
make: *** [all] Error 2
---------------- clip ----------------------

As can be seen the '--with-newlib' WAS NOT used in the GCC configure but
the 'newlib'  and 'libgloss' subdirs were symlinked to be seen in the main
GCC source directory. Although being there, it shouldn't happen that they
would in any way be used. So this sounds to be a bug...

Removing the symlinks of course helped for a while, but then :

--------------- clip ----------------------
make[3]: Leaving directory `/data1/home/src/gcc-4.1.1/build/gcc'
echo timestamp > stmp-multilib
make[2]: Leaving directory `/data1/home/src/gcc-4.1.1/build/gcc'
Checking multilib configuration...
multilib.out is unchanged
Configuring in sparc-solaris2.9/newlib
/bin/sh: /data1/home/src/gcc-4.1.1/newlib/configure: No such file or 
directory
make[1]: *** [configure-target-newlib] Error 1
make[1]: Leaving directory `/data1/home/src/gcc-4.1.1/build'
make: *** [all] Error 2
--------------- clip ----------------------

Those newlib things shouldn't have been used at all!  Removing everything
(from $build) and then starting from scratch seemed to be the  only way
(or the easy one) to workaround this bug.
 




More information about the Gcc-bugs mailing list