configure --target=i386-rtems --enable-languages=c,ada --with-newlib ...
# make -C gcc gnatlib
../../xgcc -B../../ -c -DCROSS_COMPILE -DIN_GCC `echo -g -O2 -fexceptions -DI
N_RTS |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` \
-I. -I.. -I../.. -I/users/rtems/src/packages/BUILD/rtems-4.7-i386-rtems
lude -I./../.. -I/users/rtems/src/packages/BUILD/rtems-4.7-i386-rtems4.7-gcc-new
lib-gcc3.3.2newlib1.11.0/gcc-3.3.2/gcc/ada/../.. -I../.. \
In file included from /users/rtems/src/packages/BUILD/rtems-4.7-i386-rtems4.7-gc
b1.11.0/gcc-3.3.2/gcc/system.h:117:22: strings.h: No such file or directory
make: *** [prefix.o] Error 1
Apparent cause is prefix.c including config.h, which subsequently includes
auto-host.h contains the configure-detected values for the build-host, not for
the target as building gnatlib assumes
=> gnatlib is being compiled by the cross-compiler, using the configuation
values having been detected for the build-host
=> gnatlib can not be cross-compiled for *any* target.
Your comment is incorrect, gnatlib will build on many
cross configuration, even if it is conceptually wrong to build prefix.c
with auto-host on the target.
The work around is to provide a strings.h
This is fixed in the mainline.
I think you didn't understand.
Given the implementation in gcc-3.3, gnatlib by no means can be cross-compiled,
because it is a misconception to include auto-host.h into any target-file.
If you manage to build it cross, it's only because, by accident your host and
target resembles enough for not provoking an error.
Building choking on not having found strings.h is only the symptom, not the
cause, because the host (linux) has strings.h, but the target (rtems/newlib)
doesn't have it.
This bug might be fixed in gcc-3.4 or not (I don't know, gcc-3.4 currently is
too volatile), it still is present in gcc-3.3.
Subject: Re: gnatlib can't be built cross
> Given the implementation in gcc-3.3, gnatlib by no means can be cross-compiled,
> because it is a misconception to include auto-host.h into any target-file.
> If you manage to build it cross, it's only because, by accident your host and
> target resembles enough for not provoking an error.
I know, and this is exactly what I said in my previous message.
Given that prefix.o is actually not used afterwards, simply getting it to
compile is enough to solve this issue.
Another work around is to simply remove prefix.o from the libgnat objects.
Anyway, do whatever you like with this PR, you now have all the cards in
This bug is not going to be fixed for 3.3, Ada will remain boken for newlib, just create a strings.h
file and the problem is solved.