This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] sparc-sun-solaris2.8 (cross) missing PATH_MAX


Brad Spencer wrote:

  The directory that should contain system headers does not exist:
    /opt/gcc-3.4.0-cross/sparc-sun-solaris2.8/lib/gcc/sparc-sun-solaris2.8/3.4.0/../../../../sparc-sun-solaris2.8/sys-include

Ok, it can have those "system headers" so what? What are those "system headers" anyway in the Solaris2.8 case? If quoting the GCC manual:

--------------------------- clip ---------------------------------------------
SYSTEM_INCLUDE_DIR
  Define this macro as a C string constant if you wish to specify a
  system-specific directory to search for header files before the standard
  directory. SYSTEM_INCLUDE_DIR comes before STANDARD_INCLUDE_DIR in the search
  order.

  Cross compilers do not use this macro and do not search the directory
  specified.

STANDARD_INCLUDE_DIR
  Define this macro as a C string constant if you wish to override the standard
  choice of `/usr/include' as the default prefix to try when searching for
  header files.

  Cross compilers do not use this macro and do not search either `/usr/include'
  or its replacement.
--------------------------- clip ---------------------------------------------

 So the '$prefix/$target/include' in a cross-GCC is the equivalent to the
'/usr/include' in a native-GCC, which contains the "standard headers".

 The '$prefix/$target/sys-include' in a cross-GCC is the equivalent to the
SYSTEM_INCLUDE_DIR in a native-GCC, which contains the "system headers".

 The search-order for the headers in the '$prefix/$target/sys-include' and
'$prefix/$target/include' is just what the GCC manual tells, the "system
headers" will be searched first, the "standard headers" then (and last).

 So a "normal" cross-GCC builder, the one who has built those tens or even
hundreds, uses these standard install places, puts the "standard headers"
where they do belong and nothing to this equivalent to the native (usually
unused) SYSTEM_INCLUDE_DIR :

--------------------------- clip ---------------------------------------------
CROSS_INCLUDE_DIR is used only by cross compilers. GCC doesn't install anything
there.
--------------------------- clip ---------------------------------------------

And then expects the GCC build to do just as the GCC manual says:

--------------------------- clip ---------------------------------------------
TOOL_INCLUDE_DIR is used for both native and cross compilers. It is the place
for other packages to install header files that GCC will use. For a
cross-compiler, this is the equivalent of `/usr/include'. When you build a
cross-compiler, fixincludes processes any header files in this directory.
--------------------------- clip ---------------------------------------------

The BIG question here is WHY the GCC build doesn't do just as the GCC manual says? Why on earth all this mess with the 'sys-include' has been seen being
necessary ?


Cheers, Kai



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]