From mboxrd@z Thu Jan 1 00:00:00 1970 From: ericbavier@openmailbox.org Subject: [PATCH 5/5] gnu: llvm: Update to 3.8.0. Date: Thu, 7 Jul 2016 00:06:44 -0500 Message-ID: <20160707050644.30438-5-ericbavier@openmailbox.org> References: <20160707050644.30438-1-ericbavier@openmailbox.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL1Xl-0001NZ-Ex for guix-devel@gnu.org; Thu, 07 Jul 2016 01:08:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bL1Xg-0003nd-IN for guix-devel@gnu.org; Thu, 07 Jul 2016 01:08:08 -0400 Received: from mail.openmailbox.org ([62.4.1.34]:39298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL1Xg-0003nA-8L for guix-devel@gnu.org; Thu, 07 Jul 2016 01:08:04 -0400 In-Reply-To: <20160707050644.30438-1-ericbavier@openmailbox.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Cc: Eric Bavier From: Eric Bavier * gnu/packages/llvm.scm (llvm, clang-runtime, clang): Update to 3.8.0. (llvm-3.7, clang-runtime-3.7, clang-3.7): New variables. (clang-runtime-from-llvm)[arguments]: Disable tests, which were not being run for previous versions anyhow but now fail hard. (clang-from-llvm): Add #:patches keyword argument. * gnu/packages/patches/clang-3.8-libc-search-path.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. Co-authored-by: Dennis Mungai --- gnu/local.mk | 1 + gnu/packages/llvm.scm | 37 +++++++++--- .../patches/clang-3.8-libc-search-path.patch | 69 ++++++++++++++++++++++ 3 files changed, 100 insertions(+), 7 deletions(-) create mode 100644 gnu/packages/patches/clang-3.8-libc-search-path.patch diff --git a/gnu/local.mk b/gnu/local.mk index 7dfda9b..f5bb3b4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -453,6 +453,7 @@ dist_patch_DATA = \ %D%/packages/patches/cdparanoia-fpic.patch \ %D%/packages/patches/chmlib-inttypes.patch \ %D%/packages/patches/clang-libc-search-path.patch \ + %D%/packages/patches/clang-3.8-libc-search-path.patch \ %D%/packages/patches/clucene-pkgconfig.patch \ %D%/packages/patches/cmake-fix-tests.patch \ %D%/packages/patches/cpio-gets-undeclared.patch \ diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index a01c327..78efee3 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -38,7 +38,7 @@ (define-public llvm (package (name "llvm") - (version "3.7.1") + (version "3.8.0") (source (origin (method url-fetch) @@ -46,7 +46,7 @@ version "/llvm-" version ".src.tar.xz")) (sha256 (base32 - "1masakdp9g2dan1yrazg7md5am2vacbkb3nahb3dchpc1knr8xxy")))) + "0ikfq0gxac8xpvxj23l4hk8f12ydx48fljgrz1gl9xp0ks704nsm")))) (build-system cmake-build-system) (native-inputs `(("python" ,python-2) ;bytes->str conversion in clang>=3.7 needs python-2 @@ -89,8 +89,8 @@ of programming tools as well as libraries with equivalent functionality.") `(("llvm" ,llvm))) (arguments `(;; Don't use '-g' during the build to save space. - #:build-type "Release")) - + #:build-type "Release" + #:tests? #f)) ; Tests require gtest (home-page "http://compiler-rt.llvm.org") (synopsis "Runtime library for Clang/LLVM") (description @@ -103,7 +103,8 @@ compiler. In LLVM this library is called \"compiler-rt\".") ;; doesn't list MIPS as supported. (supported-systems (delete "mips64el-linux" %supported-systems)))) -(define (clang-from-llvm llvm clang-runtime hash) +(define* (clang-from-llvm llvm clang-runtime hash + #:key (patches '("clang-libc-search-path.patch"))) (package (name "clang") (version (package-version llvm)) @@ -113,7 +114,7 @@ compiler. In LLVM this library is called \"compiler-rt\".") (uri (string-append "http://llvm.org/releases/" version "/cfe-" version ".src.tar.xz")) (sha256 (base32 hash)) - (patches (search-patches "clang-libc-search-path.patch")))) + (patches (map search-patch patches)))) ;; Using cmake allows us to treat llvm as an external library. There ;; doesn't seem to be any way to do this with clang's autotools-based ;; build system. @@ -186,10 +187,32 @@ code analysis tools.") (define-public clang-runtime (clang-runtime-from-llvm llvm - "10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx")) + "1c2nkp9563873ffz22qmhc0wakgj428pch8rmhym8agjamz3ily8")) (define-public clang (clang-from-llvm llvm clang-runtime + "1ybcac8hlr9vl3wg8s4v6cp0c0qgqnwprsv85lihbkq3vqv94504" + #:patches '("clang-3.8-libc-search-path.patch"))) + +(define-public llvm-3.7 + (package (inherit llvm) + (version "3.7.1") + (source + (origin + (method url-fetch) + (uri (string-append "http://llvm.org/releases/" + version "/llvm-" version ".src.tar.xz")) + (sha256 + (base32 + "1masakdp9g2dan1yrazg7md5am2vacbkb3nahb3dchpc1knr8xxy")))))) + +(define-public clang-runtime-3.7 + (clang-runtime-from-llvm + llvm-3.7 + "10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx")) + +(define-public clang-3.7 + (clang-from-llvm llvm-3.7 clang-runtime-3.7 "0x065d0w9b51xvdjxwfzjxng0gzpbx45fgiaxpap45ragi61dqjn")) (define-public llvm-3.6 diff --git a/gnu/packages/patches/clang-3.8-libc-search-path.patch b/gnu/packages/patches/clang-3.8-libc-search-path.patch new file mode 100644 index 0000000..0f7d0a4 --- /dev/null +++ b/gnu/packages/patches/clang-3.8-libc-search-path.patch @@ -0,0 +1,69 @@ +Clang attempts to guess file names based on the OS and distro (yes!), +but unfortunately, that doesn't work for us. + +This patch makes it easy to insert libc's $libdir so that Clang passes the +correct absolute file name of crt1.o etc. to 'ld'. It also disables all +the distro-specific stuff and removes the hard-coded FHS directory names +to make sure Clang also works on non-GuixSD systems. + +This patch makes slight adjustments over "clang-libc-search-path.patch" for +changes in clang 3.8. + +--- cfe-3.8.0.src/lib/Driver/ToolChains.cpp ++++ cfe-3.8.0.src/lib/Driver/ToolChains.cpp +@@ -3661,6 +3661,9 @@ + GCCInstallation.getTriple().str() + "/bin") + .str()); + ++ // Comment out the distro-specific tweaks so that they don't bite when ++ // using Guix on a foreign distro. ++#if 0 + Distro Distro = DetectDistro(D, Arch); + + if (IsOpenSUSE(Distro) || IsUbuntu(Distro)) { +@@ -3702,6 +3705,7 @@ + + if (IsOpenSUSE(Distro)) + ExtraOpts.push_back("--enable-new-dtags"); ++#endif + + // The selection of paths to try here is designed to match the patterns which + // the GCC driver itself uses, as this is part of the GCC-compatible driver. +@@ -3771,14 +3775,12 @@ + addPathIfExists(D, D.Dir + "/../" + OSLibDir, Paths); + } + +- addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths); +- addPathIfExists(D, SysRoot + "/lib/../" + OSLibDir, Paths); +- addPathIfExists(D, SysRoot + "/usr/lib/" + MultiarchTriple, Paths); +- addPathIfExists(D, SysRoot + "/usr/lib/../" + OSLibDir, Paths); +- + // Try walking via the GCC triple path in case of biarch or multiarch GCC + // installations with strange symlinks. + if (GCCInstallation.isValid()) { ++ // The following code would end up adding things like ++ // "/usr/lib/x86_64-unknown-linux-gnu/../../lib64" to the search path. ++#if 0 + addPathIfExists(D, + SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() + + "/../../" + OSLibDir, +@@ -3791,6 +3793,7 @@ + BiarchSibling.gccSuffix(), + Paths); + } ++#endif + + // See comments above on the multilib variant for details of why this is + // included even from outside the sysroot. +@@ -3815,8 +3818,9 @@ + if (StringRef(D.Dir).startswith(SysRoot)) + addPathIfExists(D, D.Dir + "/../lib", Paths); + +- addPathIfExists(D, SysRoot + "/lib", Paths); +- addPathIfExists(D, SysRoot + "/usr/lib", Paths); ++ // Add libc's lib/ directory to the search path, so that crt1.o, crti.o, ++ // and friends can be found. ++ addPathIfExists(D, "@GLIBC_LIBDIR@", Paths); + } + + bool Linux::HasNativeLLVMSupport() const { return true; } -- 2.7.4