CPATH, LIBRARY_PATH, and cross-compilers

Ludovic Courtès ludo@gnu.org
Tue Feb 12 18:49:00 GMT 2013


Hi,

GCC honors CPATH, LIBRARY_PATH, & co. regardless of whether it’s built
as a cross-compiler.

Consequently, when cross-compiling a package that contains both support
tools to be compiled natively and the main code to be cross-compiled,
these variables are useless because they don’t allow host and build
headers and libraries to be distinguished.

To fix that, I’d build the cross-compiler with something like:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 797 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20130212/09a3d374/attachment.bin>
-------------- next part --------------

What about changing GCC to honor CROSS_CPATH (& co.) and
CROSS_LIBRARY_PATH when built as a cross-compiler?

The behavior would be to honor the CROSS_ variable when it’s defined,
and to discard its non-CROSS_ variant.  Native compilers would still
behave the same.

I can prepare a patch if there’s interest.

Thanks,
Ludo’.


More information about the Gcc mailing list