--- llvm-3.1.src/tools/llvm-config/llvm-config.cpp.orig 2012-05-16 00:06:08.000000000 +0200 +++ llvm-3.1.src/tools/llvm-config/llvm-config.cpp 2012-10-12 17:44:41.041037043 +0200 @@ -234,11 +234,11 @@ break; case CMakeStyle: ActiveBinDir = ActiveObjRoot + "/bin"; - ActiveLibDir = ActiveObjRoot + "/lib"; + ActiveLibDir = LLVM_LIBDIR; break; case CMakeBuildModeStyle: ActiveBinDir = ActiveObjRoot + "/bin/" + LLVM_BUILDMODE; - ActiveLibDir = ActiveObjRoot + "/lib/" + LLVM_BUILDMODE; + ActiveLibDir = LLVM_LIBDIR "/" LLVM_BUILDMODE; break; } @@ -249,7 +249,7 @@ ActivePrefix = CurrentExecPrefix; ActiveIncludeDir = ActivePrefix + "/include"; ActiveBinDir = ActivePrefix + "/bin"; - ActiveLibDir = ActivePrefix + "/lib"; + ActiveLibDir = LLVM_LIBDIR; ActiveIncludeOption = "-I" + ActiveIncludeDir; } --- llvm-3.1.src/autoconf/configure.ac.orig 2012-05-11 22:48:57.000000000 +0200 +++ llvm-3.1.src/autoconf/configure.ac 2012-10-12 17:39:00.668599306 +0200 @@ -1472,13 +1472,13 @@ fi eval LLVM_PREFIX="${prefix}"; eval LLVM_BINDIR="${prefix}/bin"; -eval LLVM_LIBDIR="${prefix}/lib"; +eval LLVM_LIBDIR="${libdir}"; eval LLVM_DATADIR="${prefix}/share/llvm"; eval LLVM_DOCSDIR="${prefix}/share/doc/llvm"; eval LLVM_ETCDIR="${prefix}/etc/llvm"; eval LLVM_INCLUDEDIR="${prefix}/include"; -eval LLVM_INFODIR="${prefix}/info"; -eval LLVM_MANDIR="${prefix}/man"; +eval LLVM_INFODIR="${datadir}/info"; +eval LLVM_MANDIR="${datadir}/man"; LLVM_CONFIGTIME=`date` AC_SUBST(LLVM_PREFIX) AC_SUBST(LLVM_BINDIR) --- llvm-3.2.src/tools/clang/lib/Driver/ToolChains.cpp.orig 2013-01-26 17:40:15.003203777 +0100 +++ llvm-3.2.src/tools/clang/lib/Driver/ToolChains.cpp 2013-01-26 18:49:17.313536763 +0100 @@ -2154,7 +2154,7 @@ Linux::Linux(const Driver &D, const llvm // host system, and a more minimal sysroot available that is the target of // the cross. if (StringRef(LibPath).startswith(SysRoot)) { - addPathIfExists(LibPath + "/../" + GCCTriple.str() + "/lib/../" + Multilib, + addPathIfExists(LibPath + "/../" + GCCTriple.str() + "/" + Multilib, Paths); addPathIfExists(LibPath + "/" + MultiarchTriple, Paths); addPathIfExists(LibPath + "/../" + Multilib, Paths); @@ -2166,14 +2166,14 @@ Linux::Linux(const Driver &D, const llvm } } addPathIfExists(SysRoot + "/lib/" + MultiarchTriple, Paths); - addPathIfExists(SysRoot + "/lib/../" + Multilib, Paths); - addPathIfExists(SysRoot + "/usr/lib/" + MultiarchTriple, Paths); - addPathIfExists(SysRoot + "/usr/lib/../" + Multilib, Paths); + addPathIfExists(SysRoot + "/" + Multilib, Paths); + addPathIfExists(SysRoot + LLVM_LIBDIR "/" + MultiarchTriple, Paths); + addPathIfExists(SysRoot + "/usr/" + Multilib, Paths); // Try walking via the GCC triple path in case of multiarch GCC // installations with strange symlinks. if (GCCInstallation.isValid()) - addPathIfExists(SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() + + addPathIfExists(SysRoot + LLVM_LIBDIR "/" + GCCInstallation.getTriple().str() + "/../../" + Multilib, Paths); // Add the non-multilib suffixed paths (if potentially different). @@ -2342,7 +2342,7 @@ Linux::Linux(const Driver &D, const llvm } } addPathIfExists(SysRoot + "/lib", Paths); - addPathIfExists(SysRoot + "/usr/lib", Paths); + addPathIfExists(SysRoot + LLVM_LIBDIR, Paths); IsPIEDefault = SanitizerArgs(*this, Args).hasZeroBaseShadow(); } --- llvm-3.2.src/tools/clang/lib/Driver/Tools.cpp.orig 2012-11-21 08:56:23.000000000 +0100 +++ llvm-3.2.src/tools/clang/lib/Driver/Tools.cpp 2013-01-26 18:43:56.952167604 +0100 @@ -218,7 +218,7 @@ static void addProfileRT(const ToolChain // libprofile_rt.so. We used to use the -l:libprofile_rt.a syntax, but that is // not supported by old linkers. std::string ProfileRT = - std::string(TC.getDriver().Dir) + "/../lib/libprofile_rt.a"; + LLVM_LIBDIR "/libprofile_rt.a"; CmdArgs.push_back(Args.MakeArgString(ProfileRT)); } @@ -4881,9 +4881,9 @@ void solaris::Link::ConstructJob(Compila const ArgList &Args, const char *LinkingOutput) const { // FIXME: Find a real GCC, don't hard-code versions here - std::string GCCLibPath = "/usr/gcc/4.5/lib/gcc/"; + std::string GCCLibPath = LLVM_LIBDIR "/gcc/"; const llvm::Triple &T = getToolChain().getTriple(); - std::string LibPath = "/usr/lib/"; + std::string LibPath = LLVM_LIBDIR "/"; llvm::Triple::ArchType Arch = T.getArch(); switch (Arch) { case llvm::Triple::x86: @@ -6049,7 +6049,7 @@ void linuxtools::Link::ConstructJob(Comp // forward. if (D.IsUsingLTO(Args) || Args.hasArg(options::OPT_use_gold_plugin)) { CmdArgs.push_back("-plugin"); - std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so"; + std::string Plugin = LLVM_LIBDIR "/LLVMgold.so"; CmdArgs.push_back(Args.MakeArgString(Plugin)); }