Is it ever possible to build libmudflap, libssp, or libgomp when inhibit_libc is set?
Stephen M. Kenton
skenton@ou.edu
Mon Oct 8 16:48:00 GMT 2007
Ian Lance Taylor wrote:
> Steve Kenton <skenton@ou.edu> writes:
>
>
>> Is it ever possible to build libmudflap, libssp, or libgomp when
>> inhibit_libc is set?
>>
>
> It seems unlikely.
>
OK, then I'll pursue this idea
>
>> If not, is is reasonable to add a check to the top level configure to detect
>> situations that will cause gcc configure to set inhibit_libc and add those
>> libraries to either skipdirs or noconfigdirs. (Which would be preferred?)
>> It looks like just a couple of lines in configure to exclude them
>> automatically
>> if they can never build under that condition on any target.
>>
>
> That seems reasonable in principle. They should be added to
> skipdirs. Ideally the condition expressing when inhibit_libc should
> be set should be done in a single place, and then somehow communicated
> to other places.
>
> In the current inhibit_libc condition I don't understand the
> interaction between --with-newlib and --with-headers. If newlib is
> available, inhibit_libc normally should not be defined.
>
> Ian
>
I've puzzled over it too. Below is the section from the gcc
subdirectory configure.
The "if" first line clearly means "we are cross compiling and do not
have sysroot"
I've seen scripts that use --with-newlib=yes without newlib source being
present
to mean forcibly set inhibit_libc, which probably explains the second line,
(it looks like a kludge, but apparently commonly used by some people)
and the third line of course means "so long as we also do not have headers".
The top level configure already checks for and sets a variable for
cross compiling.
I thought that would be a good place to add a check for sysroot and headers
and add things to skipdirs. I assume libmudflap, libssp and libgomp can
build
with newlib if it is really present, so that should probably not be
checked at the top level.
Are the headers "xno" checks a legacy thing, or should there also be one
for sysroot?
Steve Kenton
# If this is a cross-compiler that does not
# have its own set of headers then define
# inhibit_libc
# If this is using newlib, without having the headers available now,
# then define inhibit_libc in LIBGCC2_CFLAGS.
# This prevents libgcc2 from containing any code which requires libc
# support.
inhibit_libc=false
if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
test x$with_newlib = xyes ; } &&
{ test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then
inhibit_libc=true
fi
More information about the Gcc
mailing list