Nick Burrett nick at sqrt.co.uk
Sun Dec 26 08:29:57 PST 2004

Peter Naulls said:
> Nick, can you explain the rationale behind
> -icrossdirafter/-icrossdirsystem.  I appreciate that they are used as
> part of the selection of unixlib/libscl, but isn't there a better way to
> do this with multilib stuff in GCC 3?

The 'after' and 'system' refer to two different link lists within the
implementation of include chains within the pre-processor; one called the
SYSTEM include chain, which points to the GCC-specific headers and the
standard headers in /usr/include and /usr/local/include.

The AFTER include chain comes last.  Because we alter the include chain at
run-time for either unixlib or libscl, we need to ensure that these always
appear after the path for the GCC-specific headers, hence the patch for

Multilib cannot work around this problem since it only deals with the
selection of run-time libraries to link against and has no influence on
the paths to include files.  If it did, we'd require a different include
directory for each processor target and each run-time library.

> The reason I ask is that I'm trying to use -nostdinc, and it's defeated
> by the above flag in GCC's internal specs.  I can work around this, but
> it does cause a little bit of hassle.

It's rare to use this, unless you're trying to target something that does
not require a run-time library.  Does -nostdinc not remove the path to the
unixlib system headers ?  Have you tried using '-isystem' like we do when
compiling UnixLib ?


More information about the gcc mailing list