llvm-toolchain/debian/patches/0010-shared-lib-paths.patch
Sylvestre Ledru 621afe854a * Sync recent changes from the 3.3 branch
* Integrate patch to fix FTBFS under IA64.
* Disable the usage of binutils-gold under armel. It currently fails with:
  "attempt to map 2752512 bytes at offset 2066666 exceeds size of file;
  the file may be corrupt"
2013-07-01 12:40:22 +00:00

39 lines
1.9 KiB
Diff

Index: llvm-toolchain-snapshot_3.4~svn185325/clang/lib/Driver/ToolChains.cpp
===================================================================
--- llvm-toolchain-snapshot_3.4~svn185325.orig/clang/lib/Driver/ToolChains.cpp 2013-07-01 13:27:42.000000000 +0200
+++ llvm-toolchain-snapshot_3.4~svn185325/clang/lib/Driver/ToolChains.cpp 2013-07-01 13:28:26.000000000 +0200
@@ -2292,6 +2292,14 @@
addPathIfExists(SysRoot + "/usr/lib/" + MultiarchTriple, Paths);
addPathIfExists(SysRoot + "/usr/lib/../" + Multilib, Paths);
+ // In Debian we install LLVM lib with version string
+ // /usr/lib/llvm-X.Y/lib/LLVMGold.so
+ if (IsDebian(Distro)) {
+ addPathIfExists(SysRoot + "/usr/lib/llvm-" + CLANG_VERSION_STRING + "/lib/",
+ Paths);
+ }
+
+
// Try walking via the GCC triple path in case of biarch or multiarch GCC
// installations with strange symlinks.
if (GCCInstallation.isValid())
Index: llvm-toolchain-snapshot_3.4~svn185325/clang/lib/Driver/Tools.cpp
===================================================================
--- llvm-toolchain-snapshot_3.4~svn185325.orig/clang/lib/Driver/Tools.cpp 2013-07-01 13:27:42.000000000 +0200
+++ llvm-toolchain-snapshot_3.4~svn185325/clang/lib/Driver/Tools.cpp 2013-07-01 13:27:42.000000000 +0200
@@ -6168,6 +6168,14 @@
if (D.IsUsingLTO(Args) || Args.hasArg(options::OPT_use_gold_plugin)) {
CmdArgs.push_back("-plugin");
std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
+ if ( ! llvm::sys::fs::exists(Plugin)) {
+ // Plugin is not in driver-based relative path, try system libs
+ // on Debian for instance
+ std::string PluginSystem = ToolChain.GetFilePath("LLVMgold.so");
+ if (llvm::sys::fs::exists(PluginSystem)){
+ Plugin = PluginSystem;
+ }
+ }
CmdArgs.push_back(Args.MakeArgString(Plugin));
// Try to pass driver level flags relevant to LTO code generation down to