Add patch to find correctly LLVMGold.so with -O4 (Closes: #712437)

This commit is contained in:
Léo Cavaillé 2013-06-20 13:35:15 +00:00
parent a6c0767fbd
commit 4dc0a051fd
3 changed files with 41 additions and 0 deletions

3
debian/changelog vendored
View File

@ -7,6 +7,9 @@ llvm-toolchain-3.3 (1:3.3-2) unstable; urgency=low
* Add lldb-X.Y manpage
* Hopefully fix the ftbfs under mipsel (mipsel-ftbfs.diff)
[ Léo Cavaillé ]
* Add patch to find correctly LLVMGold.so with -O4 (Closes: #712437)
-- Sylvestre Ledru <sylvestre@debian.org> Fri, 14 Jun 2013 11:45:26 +0200
llvm-toolchain-3.3 (1:3.3-1) unstable; urgency=low

View File

@ -0,0 +1,37 @@
Index: llvm-toolchain-snapshot_3.4~svn184409/clang/lib/Driver/ToolChains.cpp
===================================================================
--- llvm-toolchain-snapshot_3.4~svn184409/clang/lib/Driver/ToolChains.cpp (revision 184409)
+++ llvm-toolchain-snapshot_3.4~svn184409/clang/lib/Driver/ToolChains.cpp (working copy)
@@ -2328,6 +2328,13 @@
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 multiarch GCC
// installations with strange symlinks.
if (GCCInstallation.isValid())
Index: llvm-toolchain-snapshot_3.4~svn184409/clang/lib/Driver/Tools.cpp
===================================================================
--- llvm-toolchain-snapshot_3.4~svn184409/clang/lib/Driver/Tools.cpp (revision 184409)
+++ llvm-toolchain-snapshot_3.4~svn184409/clang/lib/Driver/Tools.cpp (working copy)
@@ -6147,6 +6147,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

View File

@ -8,6 +8,7 @@
profile_rt.diff
30-kfreebsd.diff
0003-Debian-version-info-and-bugreport.patch
0010-shared-lib-paths.patch
0021-shared-lib-debian.patch
0023-link-libopagent.patch
0044-soname.diff