[Bug preprocessor/48957] New: GCC's handling of include-fixed does not work well with --sysroot
psmith at gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed May 11 04:54:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48957
Summary: GCC's handling of include-fixed does not work well
with --sysroot
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: psmith@gnu.org
When GCC builds, it creates and stows away internally an "include-fixed"
directory containing "fixed-up" versions of the system headers files on the
system it was built with. This feels wrong to me: it gives GCC a hard
dependency on the specific set of system header files present when GCC was
built. It's potentially incorrect even for straightforward installations,
where a newer header file provided with a package upgrade might be ignored in
preference to an older "fixed" version. However, when attempting to create a
relocatable version of GCC it's even more problematic.
In particular, it seems very wrong (and, in fact, it often doesn't work) to
search the include-fixed directory when the user has specified a --sysroot
flag, choosing to compile against a wholly different set of headers and
libraries than the ones on the host system.
I think that the include-fixed directory should be associated with the sysroot,
somehow, not embedded deeply into the compiler internals, and when --sysroot is
provided there should be a well-known location inside the sysroot which will be
searched for include-fixed headers.
Also, the fixinc.sh script should be better documented and enhanced to be
simpler to run, so that it can be invoked more easily against a given sysroot
to construct the include-fixed directory for that sysroot.
More information about the Gcc-bugs
mailing list