[cfe-commits] [PATCH] [Driver] Make default GCC install prefix and sysroot relocatable

Kito Cheng kito at 0xlab.org
Tue Dec 11 08:03:48 PST 2012

>> And there is not only according the LLVM_PREFIX and the path of clang
>> executable to imply the sysroot path since the sysroot for
>> cross-compilation is no standard path, so I just make the behavior
>> like the gcc toolchain,
>> and it's will make the clang/llvm able to distribute like
>> codesourcery's toolchain.
> Doesn't the clang driver already search for gcc libraries installed next to it?

In my experiment, the clang will found the gcc toolchain if
GCC_INSTALL_PREFIX is not set even the install folder is relocated,
but not work when GCC_INSTALL_PREFIX is set during cross-compilation
And here is no standard path for place libraries and header for a
cross-compilation gcc. so the clang can't find that.

The sysroot part is not work fine both on DEFAULT_SYSROOT set or not
set during cross-compilation.

> If you need it to be in a subfolder or something, I would prefer to add support for GCC_INSTALL_PREFIX being a relative path, so that you can build with something like
> configure --with-gcc-toolchain=../relative/gcc/install/dir/
> instead of doing prefix match at runtime.

Configure with the relative path I think it's not instinct enough,
which ones upper folder, clang or install path?

Here is almost no run-time overhead if GCC_INSTALL_PREFIX and

And we also need extra code to generate the GCC_INSTALL_PREFIX and
DEFAULT_SYSROOT at run-time if we decide support  GCC_INSTALL_PREFIX
and DEFAULT_SYSROOT begin a relative path.

Or maybe we can support both style ? support relative path for
GCC_INSTALL_PREFIX and DEFAULT_SYSROOT and auto relocated sysroot and
gcc prefix if it's subfolder of LLVM_PREFIX.

> Cheers,
> Rafael

More information about the cfe-commits mailing list