From 11b6f3806bfa63c99efe07385bd44c5065d74b2b Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sat, 24 May 2014 22:59:06 +0200 Subject: [PATCH] - updated to 3.4.1 - updated config,pld patches - added destdir patch (fixes libLLVM-3.4.so symlink) --- llvm-config.patch | 100 ++++++++++++++++++++++++++++++--------------- llvm-destdir.patch | 11 +++++ llvm-pld.patch | 60 +++++++++++++-------------- llvm.spec | 22 ++++++---- 4 files changed, 118 insertions(+), 75 deletions(-) create mode 100644 llvm-destdir.patch diff --git a/llvm-config.patch b/llvm-config.patch index 38dc3ad..eaa311c 100644 --- a/llvm-config.patch +++ b/llvm-config.patch @@ -23,15 +23,9 @@ 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"; +--- llvm-3.4.1.src/autoconf/configure.ac.orig 2014-05-21 18:37:05.321379360 +0200 ++++ llvm-3.4.1.src/autoconf/configure.ac 2014-05-21 18:40:49.568041358 +0200 +@@ -1813,8 +1813,9 @@ eval LLVM_DOCSDIR="${prefix}/share/doc/llvm"; eval LLVM_ETCDIR="${prefix}/etc/llvm"; eval LLVM_INCLUDEDIR="${prefix}/include"; @@ -39,50 +33,88 @@ -eval LLVM_MANDIR="${prefix}/man"; +eval LLVM_INFODIR="${datadir}/info"; +eval LLVM_MANDIR="${datadir}/man"; ++eval LLVM_LIBDIR="${libdir}"; 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 +@@ -1824,6 +1825,7 @@ + AC_SUBST(LLVM_INCLUDEDIR) + AC_SUBST(LLVM_INFODIR) + AC_SUBST(LLVM_MANDIR) ++AC_SUBST(LLVM_LIBDIR) + AC_SUBST(LLVM_CONFIGTIME) + + dnl Disable embedding timestamps in the build directory, with ENABLE_TIMESTAMPS. +@@ -1851,6 +1851,8 @@ + [Installation directory for .info files]) + AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR", + [Installation directory for man pages]) ++AC_DEFINE_UNQUOTED(LLVM_LIBDIR, "$LLVM_LIBDIR", ++ [Installation directory for libraries]) + AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME", + [Time at which LLVM was configured]) + AC_DEFINE_UNQUOTED(LLVM_HOST_TRIPLE, "$host", +--- llvm-3.4.1.src/tools/clang/lib/Driver/ToolChains.cpp.orig 2014-05-21 18:42:38.311372419 +0200 ++++ llvm-3.4.1.src/tools/clang/lib/Driver/ToolChains.cpp 2014-05-22 21:00:55.159398641 +0200 +@@ -2358,19 +2358,6 @@ static StringRef getMultilibDir(const ll + return Triple.isArch32Bit() ? "lib" : "lib64"; + } + +- // It happens that only x86 and PPC use the 'lib32' variant of multilib, and +- // using that variant while targeting other architectures causes problems +- // because the libraries are laid out in shared system roots that can't cope +- // with a 'lib32' multilib search path being considered. So we only enable +- // them when we know we may need it. +- // +- // FIXME: This is a bit of a hack. We should really unify this code for +- // reasoning about multilib spellings with the lib dir spellings in the +- // GCCInstallationDetector, but that is a more significant refactoring. +- if (Triple.getArch() == llvm::Triple::x86 || +- Triple.getArch() == llvm::Triple::ppc) +- return "lib32"; +- + return Triple.isArch32Bit() ? "lib" : "lib64"; + } + +@@ -2504,14 +2491,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/lib/" + MultiarchTriple, Paths); +- addPathIfExists(SysRoot + "/usr/lib/../" + Multilib, Paths); + addPathIfExists(SysRoot + "/usr/" + Multilib, Paths); - // Try walking via the GCC triple path in case of multiarch GCC + // Try walking via the GCC triple path in case of biarch or multiarch GCC // installations with strange symlinks. - if (GCCInstallation.isValid()) + if (GCCInstallation.isValid()) { - addPathIfExists(SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() + -+ addPathIfExists(SysRoot + LLVM_LIBDIR "/" + GCCInstallation.getTriple().str() + ++ addPathIfExists(SysRoot + "/usr/" + Multilib + "/" + 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 - } + // Add the non-multilib suffixed paths (if potentially different). +@@ -2531,8 +2518,8 @@ Linux::Linux(const Driver &D, const llvm + if (StringRef(LibPath).startswith(SysRoot)) + addPathIfExists(LibPath, Paths); } - addPathIfExists(SysRoot + "/lib", Paths); +- addPathIfExists(SysRoot + "/lib", Paths); - addPathIfExists(SysRoot + "/usr/lib", Paths); -+ addPathIfExists(SysRoot + LLVM_LIBDIR, Paths); - - IsPIEDefault = SanitizerArgs(*this, Args).hasZeroBaseShadow(); ++ addPathIfExists(SysRoot + "/" + Multilib, Paths); ++ addPathIfExists(SysRoot + "/usr/" + Multilib, Paths); } + + bool FreeBSD::HasNativeLLVMSupport() const { --- 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 +@@ -26,6 +26,7 @@ + #include "llvm/ADT/StringExtras.h" + #include "llvm/ADT/StringSwitch.h" + #include "llvm/ADT/Twine.h" ++#include "llvm/Config/config.h" + #include "llvm/Option/Arg.h" + #include "llvm/Option/ArgList.h" + #include "llvm/Option/Option.h" @@ -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. diff --git a/llvm-destdir.patch b/llvm-destdir.patch new file mode 100644 index 0000000..a551382 --- /dev/null +++ b/llvm-destdir.patch @@ -0,0 +1,11 @@ +--- llvm-3.4.1.src/Makefile.rules.orig 2014-05-24 16:58:14.382767108 +0200 ++++ llvm-3.4.1.src/Makefile.rules 2014-05-24 20:17:33.645851173 +0200 +@@ -1196,7 +1196,7 @@ + $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib) + ifdef SHARED_ALIAS + $(Echo) Creating alias from $(DestSharedLib) to $(DestSharedAlias) +- $(Verb) $(AliasTool) $(DestSharedLib) $(DestSharedAlias) ++ $(Verb) $(AliasTool) $(BaseLibName.SO) $(DestSharedAlias) + endif + + uninstall-local:: diff --git a/llvm-pld.patch b/llvm-pld.patch index c9c8804..1b8418b 100644 --- a/llvm-pld.patch +++ b/llvm-pld.patch @@ -1,33 +1,30 @@ ---- llvm-3.2.src/tools/clang/lib/Driver/ToolChains.cpp.orig 2012-12-16 16:59:27.000000000 +0100 -+++ llvm-3.2.src/tools/clang/lib/Driver/ToolChains.cpp 2013-01-24 12:42:19.582377854 +0100 -@@ -1062,6 +1062,7 @@ +--- llvm-3.4.1.src/tools/clang/lib/Driver/ToolChains.cpp.orig 2014-05-22 21:48:10.216006217 +0200 ++++ llvm-3.4.1.src/tools/clang/lib/Driver/ToolChains.cpp 2014-05-23 17:11:10.551218440 +0200 +@@ -1122,12 +1122,14 @@ static const char *const X86_64LibDirs[] = { "/lib64", "/lib" }; static const char *const X86_64Triples[] = { -+ "x86_64-pld-linux", - "x86_64-linux-gnu", - "x86_64-unknown-linux-gnu", - "x86_64-pc-linux-gnu", -@@ -1074,6 +1075,9 @@ ++ "x86_64-pld-linux", "amd64-pld-linux", + "x86_64-linux-gnu", "x86_64-unknown-linux-gnu", "x86_64-pc-linux-gnu", + "x86_64-redhat-linux6E", "x86_64-redhat-linux", "x86_64-suse-linux", + "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", "x86_64-slackware-linux" }; static const char *const X86LibDirs[] = { "/lib32", "/lib" }; static const char *const X86Triples[] = { -+ "i686-pld-linux", -+ "i586-pld-linux", -+ "i486-pld-linux", - "i686-linux-gnu", - "i686-pc-linux-gnu", - "i486-linux-gnu", -@@ -1830,6 +1834,7 @@ ++ "i686-pld-linux", "i586-pld-linux", "i485-pld-linux", "i386-pld-linux", "athlon-pld-linux", + "i686-linux-gnu", "i686-pc-linux-gnu", "i486-linux-gnu", "i386-linux-gnu", + "i386-redhat-linux6E", "i686-redhat-linux", "i586-redhat-linux", + "i386-redhat-linux", "i586-suse-linux", "i486-slackware-linux", +@@ -2167,6 +2169,7 @@ - enum LinuxDistro { + enum Distro { ArchLinux, + PLDLinux, DebianLenny, DebianSqueeze, DebianWheezy, -@@ -1877,6 +1882,10 @@ - return Distro >= UbuntuHardy && Distro <= UbuntuRaring; +@@ -2209,6 +2212,10 @@ + return Distro >= UbuntuHardy && Distro <= UbuntuTrusty; } +static bool IsPLD(enum Distro Distro) { @@ -37,35 +34,35 @@ static Distro DetectDistro(llvm::Triple::ArchType Arch) { OwningPtr File; if (!llvm::MemoryBuffer::getFile("/etc/lsb-release", File)) { -@@ -1955,6 +1964,9 @@ - if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists) +@@ -2276,6 +2283,9 @@ + if (llvm::sys::fs::exists("/etc/arch-release")) return ArchLinux; -+ if (!llvm::sys::fs::exists("/etc/pld-release", Exists) && Exists) ++ if (!llvm::sys::fs::exists("/etc/pld-release")) + return PLDLinux; + return UnknownDistro; } -@@ -2072,7 +2084,7 @@ +@@ -2382,7 +2392,7 @@ Distro Distro = DetectDistro(Arch); -- if (IsOpenSuse(Distro) || IsUbuntu(Distro)) { -+ if (IsOpenSuse(Distro) || IsUbuntu(Distro) || IsPLD(Distro)) { +- if (IsOpenSUSE(Distro) || IsUbuntu(Distro)) { ++ if (IsOpenSUSE(Distro) || IsUbuntu(Distro) || IsPLD(Distro)) { ExtraOpts.push_back("-z"); ExtraOpts.push_back("relro"); } -@@ -2088,7 +2100,7 @@ +@@ -2402,7 +2412,7 @@ // ABI requires a mapping between the GOT and the symbol table. // Android loader does not support .gnu.hash. if (!IsMips && !IsAndroid) { -- if (IsRedhat(Distro) || IsOpenSuse(Distro) || -+ if (IsRedhat(Distro) || IsOpenSuse(Distro) || IsPLD(Distro) || +- if (IsRedhat(Distro) || IsOpenSUSE(Distro) || ++ if (IsRedhat(Distro) || IsOpenSUSE(Distro) || IsPLD(Distro) || (IsUbuntu(Distro) && Distro >= UbuntuMaverick)) ExtraOpts.push_back("--hash-style=gnu"); - -@@ -2128,11 +2128,11 @@ + +@@ -2411,11 +2421,11 @@ ExtraOpts.push_back("--hash-style=both"); } @@ -74,9 +71,8 @@ ExtraOpts.push_back("--no-add-needed"); if (Distro == DebianSqueeze || Distro == DebianWheezy || -- Distro == DebianJessie || IsOpenSuse(Distro) || -+ Distro == DebianJessie || IsOpenSuse(Distro) || IsPLD(Distro) || +- Distro == DebianJessie || IsOpenSUSE(Distro) || ++ Distro == DebianJessie || IsOpenSUSE(Distro) || IsPLD(Distro) || (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) || (IsUbuntu(Distro) && Distro >= UbuntuKarmic)) ExtraOpts.push_back("--build-id"); - diff --git a/llvm.spec b/llvm.spec index 8320cad..b10a763 100644 --- a/llvm.spec +++ b/llvm.spec @@ -17,19 +17,20 @@ Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure) Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego) Name: llvm -Version: 3.3 +Version: 3.4.1 Release: 1 License: University of Illinois/NCSA Open Source License Group: Development/Languages #Source0Download: http://llvm.org/releases/download.html Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.src.tar.gz -# Source0-md5: 40564e1dc390f9844f1711c08b08e391 +# Source0-md5: b90697f4de35563ad6c35924defa8dd1 Source1: http://llvm.org/releases/%{version}/cfe-%{version}.src.tar.gz -# Source1-md5: 8284891e3e311829b8e44ac813d0c9ef +# Source1-md5: c64fdc567383211c9ac212d6f7b69263 Patch0: %{name}-config.patch # Data files should be installed with timestamps preserved Patch1: %{name}-2.6-timestamp.patch Patch2: %{name}-pld.patch +Patch3: %{name}-destdir.patch URL: http://llvm.org/ BuildRequires: autoconf >= 2.60 BuildRequires: automake >= 1:1.9.6 @@ -269,10 +270,10 @@ mv cfe-%{version}.src tools/clang %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 # configure does not properly specify libdir %{__sed} -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config.in -%{__sed} -i 's|/lib/|/%{_lib}/|' lib/Support/Unix/Path.inc # clang resources %{__sed} -i 's|(PROJ_prefix)/lib/|(PROJ_prefix)/%{_lib}/|g' tools/clang/lib/Headers/Makefile %{__sed} -i 's|"lib"|"%{_lib}"|' tools/clang/lib/Driver/Driver.cpp @@ -379,6 +380,10 @@ done # Get rid of erroneously installed example files. %{__rm} -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.* +echo '.so llvm-ar.1' > $RPM_BUILD_ROOT%{_mandir}/man1/llvm-ranlib.1 +# llvm-prof has been removed before LLVM 3.4 +%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/llvm-prof.1 + # remove documentation makefiles: # they require the build directory to work rm -rf moredocs/examples @@ -397,6 +402,7 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_bindir}/bugpoint %attr(755,root,root) %{_bindir}/llc %attr(755,root,root) %{_bindir}/lli +%attr(755,root,root) %{_bindir}/lli-child-target %attr(755,root,root) %{_bindir}/llvm-ar %attr(755,root,root) %{_bindir}/llvm-as %attr(755,root,root) %{_bindir}/llvm-bcanalyzer @@ -410,7 +416,6 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_bindir}/llvm-mcmarkup %attr(755,root,root) %{_bindir}/llvm-nm %attr(755,root,root) %{_bindir}/llvm-objdump -%attr(755,root,root) %{_bindir}/llvm-prof %attr(755,root,root) %{_bindir}/llvm-ranlib %attr(755,root,root) %{_bindir}/llvm-readobj %attr(755,root,root) %{_bindir}/llvm-rtdyld @@ -433,7 +438,6 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/llvm-extract.1* %{_mandir}/man1/llvm-link.1* %{_mandir}/man1/llvm-nm.1* -%{_mandir}/man1/llvm-prof.1* %{_mandir}/man1/llvm-ranlib.1* %{_mandir}/man1/llvm-readobj.1* %{_mandir}/man1/llvm-stress.1* @@ -444,13 +448,12 @@ rm -rf $RPM_BUILD_ROOT %files libs %defattr(644,root,root,755) %attr(755,root,root) %{_libdir}/libLLVM-%{version}.so +%attr(755,root,root) %{_libdir}/libLLVM-3.4.so %files devel %defattr(644,root,root,755) %attr(755,root,root) %{_bindir}/llvm-config -%attr(755,root,root) %{_libdir}/libprofile_rt.so %{_libdir}/libLLVM*.a -%{_libdir}/libprofile_rt.a %ifarch %{x8664} %attr(755,root,root) %{_libdir}/BugpointPasses.so %attr(755,root,root) %{_libdir}/libLTO.so @@ -520,7 +523,8 @@ rm -rf $RPM_BUILD_ROOT %if %{with ocaml} %files ocaml %defattr(644,root,root,755) -%{_libdir}/ocaml/META.llvm +%{_libdir}/ocaml/META.llvm* +%attr(755,root,root) %{_libdir}/ocaml/dllllvm*.so %{_libdir}/ocaml/llvm*.cma %{_libdir}/ocaml/llvm*.cmi -- 2.44.0