]> TLD Linux GIT Repositories - packages/llvm.git/blob - llvm-config.patch
- from PLD, TLDized
[packages/llvm.git] / llvm-config.patch
1 --- llvm-3.1.src/tools/llvm-config/llvm-config.cpp.orig 2012-05-16 00:06:08.000000000 +0200
2 +++ llvm-3.1.src/tools/llvm-config/llvm-config.cpp      2012-10-12 17:44:41.041037043 +0200
3 @@ -234,11 +234,11 @@
4        break;
5      case CMakeStyle:
6        ActiveBinDir = ActiveObjRoot + "/bin";
7 -      ActiveLibDir = ActiveObjRoot + "/lib";
8 +      ActiveLibDir = LLVM_LIBDIR;
9        break;
10      case CMakeBuildModeStyle:
11        ActiveBinDir = ActiveObjRoot + "/bin/" + LLVM_BUILDMODE;
12 -      ActiveLibDir = ActiveObjRoot + "/lib/" + LLVM_BUILDMODE;
13 +      ActiveLibDir = LLVM_LIBDIR "/" LLVM_BUILDMODE;
14        break;
15      }
16  
17 @@ -249,7 +249,7 @@
18      ActivePrefix = CurrentExecPrefix;
19      ActiveIncludeDir = ActivePrefix + "/include";
20      ActiveBinDir = ActivePrefix + "/bin";
21 -    ActiveLibDir = ActivePrefix + "/lib";
22 +    ActiveLibDir = LLVM_LIBDIR;
23      ActiveIncludeOption = "-I" + ActiveIncludeDir;
24    }
25  
26 --- llvm-3.1.src/autoconf/configure.ac.orig     2012-05-11 22:48:57.000000000 +0200
27 +++ llvm-3.1.src/autoconf/configure.ac  2012-10-12 17:39:00.668599306 +0200
28 @@ -1472,13 +1472,13 @@
29  fi
30  eval LLVM_PREFIX="${prefix}";
31  eval LLVM_BINDIR="${prefix}/bin";
32 -eval LLVM_LIBDIR="${prefix}/lib";
33 +eval LLVM_LIBDIR="${libdir}";
34  eval LLVM_DATADIR="${prefix}/share/llvm";
35  eval LLVM_DOCSDIR="${prefix}/share/doc/llvm";
36  eval LLVM_ETCDIR="${prefix}/etc/llvm";
37  eval LLVM_INCLUDEDIR="${prefix}/include";
38 -eval LLVM_INFODIR="${prefix}/info";
39 -eval LLVM_MANDIR="${prefix}/man";
40 +eval LLVM_INFODIR="${datadir}/info";
41 +eval LLVM_MANDIR="${datadir}/man";
42  LLVM_CONFIGTIME=`date`
43  AC_SUBST(LLVM_PREFIX)
44  AC_SUBST(LLVM_BINDIR)
45 --- llvm-3.2.src/tools/clang/lib/Driver/ToolChains.cpp.orig     2013-01-26 17:40:15.003203777 +0100
46 +++ llvm-3.2.src/tools/clang/lib/Driver/ToolChains.cpp  2013-01-26 18:49:17.313536763 +0100
47 @@ -2154,7 +2154,7 @@ Linux::Linux(const Driver &D, const llvm
48      // host system, and a more minimal sysroot available that is the target of
49      // the cross.
50      if (StringRef(LibPath).startswith(SysRoot)) {
51 -      addPathIfExists(LibPath + "/../" + GCCTriple.str() + "/lib/../" + Multilib,
52 +      addPathIfExists(LibPath + "/../" + GCCTriple.str() + "/" + Multilib,
53                        Paths);
54        addPathIfExists(LibPath + "/" + MultiarchTriple, Paths);
55        addPathIfExists(LibPath + "/../" + Multilib, Paths);
56 @@ -2166,14 +2166,14 @@ Linux::Linux(const Driver &D, const llvm
57      }
58    }
59    addPathIfExists(SysRoot + "/lib/" + MultiarchTriple, Paths);
60 -  addPathIfExists(SysRoot + "/lib/../" + Multilib, Paths);
61 -  addPathIfExists(SysRoot + "/usr/lib/" + MultiarchTriple, Paths);
62 -  addPathIfExists(SysRoot + "/usr/lib/../" + Multilib, Paths);
63 +  addPathIfExists(SysRoot + "/" + Multilib, Paths);
64 +  addPathIfExists(SysRoot + LLVM_LIBDIR "/" + MultiarchTriple, Paths);
65 +  addPathIfExists(SysRoot + "/usr/" + Multilib, Paths);
66  
67    // Try walking via the GCC triple path in case of multiarch GCC
68    // installations with strange symlinks.
69    if (GCCInstallation.isValid())
70 -    addPathIfExists(SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
71 +    addPathIfExists(SysRoot + LLVM_LIBDIR "/" + GCCInstallation.getTriple().str() +
72                      "/../../" + Multilib, Paths);
73  
74    // Add the non-multilib suffixed paths (if potentially different).
75 @@ -2189,7 +2189,7 @@ Linux::Linux(const Driver &D, const llvm
76      }
77    }
78    addPathIfExists(SysRoot + "/lib", Paths);
79 -  addPathIfExists(SysRoot + "/usr/lib", Paths);
80 +  addPathIfExists(SysRoot + LLVM_LIBDIR, Paths);
81  }
82  
83  bool Linux::HasNativeLLVMSupport() const {
84 --- llvm-3.2.src/tools/clang/lib/Driver/Tools.cpp.orig  2012-11-21 08:56:23.000000000 +0100
85 +++ llvm-3.2.src/tools/clang/lib/Driver/Tools.cpp       2013-01-26 18:43:56.952167604 +0100
86 @@ -218,7 +218,7 @@ static void addProfileRT(const ToolChain
87    // libprofile_rt.so. We used to use the -l:libprofile_rt.a syntax, but that is
88    // not supported by old linkers.
89    std::string ProfileRT =
90 -    std::string(TC.getDriver().Dir) + "/../lib/libprofile_rt.a";
91 +    LLVM_LIBDIR "/libprofile_rt.a";
92  
93    CmdArgs.push_back(Args.MakeArgString(ProfileRT));
94  }
95 @@ -4881,9 +4881,9 @@ void solaris::Link::ConstructJob(Compila
96                                    const ArgList &Args,
97                                    const char *LinkingOutput) const {
98    // FIXME: Find a real GCC, don't hard-code versions here
99 -  std::string GCCLibPath = "/usr/gcc/4.5/lib/gcc/";
100 +  std::string GCCLibPath = LLVM_LIBDIR "/gcc/";
101    const llvm::Triple &T = getToolChain().getTriple();
102 -  std::string LibPath = "/usr/lib/";
103 +  std::string LibPath = LLVM_LIBDIR "/";
104    llvm::Triple::ArchType Arch = T.getArch();
105    switch (Arch) {
106          case llvm::Triple::x86:
107 @@ -6049,7 +6049,7 @@ void linuxtools::Link::ConstructJob(Comp
108    // forward.
109    if (D.IsUsingLTO(Args) || Args.hasArg(options::OPT_use_gold_plugin)) {
110      CmdArgs.push_back("-plugin");
111 -    std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
112 +    std::string Plugin = LLVM_LIBDIR "/LLVMgold.so";
113      CmdArgs.push_back(Args.MakeArgString(Plugin));
114    }
115