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

Kito Cheng kito at 0xlab.org
Tue Dec 11 02:24:58 PST 2012


> I don't understand. Neither GCC_INSTALL_PREFIX nor DEFAULT_SYSROOT are set
> by default. If you can set LLVM_PREFIX, you can just as easily set those two
> variables.
>
> Note that the standard build doesn't set either variable *and* it produces a
> relocatable clang installation, if that's really what you're after: it uses
> the path of the clang executable itself to detect a prefix within which GCC
> might be installed.

The basic relocate mechanism is good enough for normal situation, I
mean the non cross-compilation.

However, when we want to build a cross compiler for clang, the default
sysroot or gcc install prefix is need to set for right header and
libraries, and they are set as absolute path, so if we relocate the
folder the gcc toolchain and sysroot no longer found by clang if the
default path is set; In another word, current relocate mechanism in
clang not work fine when default sysroot and gcc install path is set.

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.



More information about the cfe-commits mailing list