Ping: [RFA 1/2]: Don't ignore target_header_dir when deciding inhibit_libc

Jeff Law
Fri Sep 19 06:25:00 GMT 2014

On 09/12/14 11:49, Hans-Peter Nilsson wrote:
> Ping! <>
>> From: Hans-Peter Nilsson <>
>> Date: Thu, 4 Sep 2014 23:40:40 +0200
>> The directory at $target_header_dir is already inspected in
>> gcc/configure, for e.g. glibc version and stack protector
>> support, but not for setting inhibit_libc.  This is just
>> inconsistent and the obvious resolution to me is to inhibit
>> inhibit_libc when a target *does* "have its own set of headers",
>> to quote the comment above the inhibit_libc setting.  There is
>> nothing in the build log for "make all-gcc" that shows a
>> difference with/without --with-headers, if headers are actually
>> present anyway!
>> It may seem that libgcc/ would be the appropriate
>> place to patch and test, but it is gcc/ which tests
>> various things about target headers and makes the inhibit_libc
>> decision, exporting it through the generated obj/gcc/libgcc.mvars
>> that is included in libgcc/Makefile.
>> Tested before/after by "make all-gcc" on native x86_64-linux (*a) and
>> seeing it still set (for the peace of most users) in
>> gcc/Makefile, and cross to mipsel-linux "make all-gcc" with/without (*b,c) a
>> pre-installed set of headers just implied by --prefix and --target to
>> observe the intended difference and the same with (*d)
>> --with-sysroot (but no headers at the sysroot) and (*e)
>> --with-build-sysroot and both (*f) (note that
>> --with-build-sysroot=... without --with-sysroot also got
>> inhibit_libc) to observe no change for the --with-sysroot one
>> (still no inhibit_libc).  The same with --with-headers
>> (*g). Also, I checked that nothing other than the inhibit_libc code
>> uses target_header_dir or sets the used variables in the block
>> of code involved in the move.
>> Ok to commit?
>> gcc:
>> 	* (target_header_dir): Move block defining
>> 	this to before the block setting inhibit_libc.
>> 	(inhibit_libc): When considering $with_headers, just
>> 	check it it's explicitly "no".  If not, also check if
>> 	$target_header_dir/stdio.h is present.  If not, set
>> 	inhibit_libc=true.
>> 	* configure: Regenerate.

More information about the Gcc-patches mailing list