GNU bug report logs - #56452
[PATCH 0/5] Fix and update LLVM and clang-toolchain.

Previous Next

Package: guix-patches;

Reported by: Greg Hogan <code <at> greghogan.com>

Date: Fri, 8 Jul 2022 15:58:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 56452 in the body.
You can then email your comments to 56452 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#56452; Package guix-patches. (Fri, 08 Jul 2022 15:58:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Greg Hogan <code <at> greghogan.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 08 Jul 2022 15:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Greg Hogan <code <at> greghogan.com>
To: guix-patches <at> gnu.org
Cc: Greg Hogan <code <at> greghogan.com>
Subject: [PATCH 0/5] Fix and update LLVM and clang-toolchain.
Date: Fri,  8 Jul 2022 15:57:30 +0000
This patchset updates and fixes the builds of llvm-3.7, llvm-3.8, and
llvm-8 and also updates llvm-14.

The only failing depedent package is beignet, which has failed to build
since last year's replacement of ocl-icd with opencl-icd-loader. beignet
has no dependents and was last updated in 2017.

By building clang-toolchain with a libomp built with the same version of
llvm we remove the additional copy of llvm and reduce the size of the
closure from 1330.9 MB to 1156 MB.

If this is accepted I would look to submit a follow-on patchset adding
libomp varients for clang-toolchain-12 and earlier.

$ guix size clang-toolchain <at> 14 | grep 'clang\|llvm\|libomp'
/gnu/store/rhs2ws9xqx5ln44ix2kvjmmjv3jg5aw1-clang-14.0.5           886.1   215.6  16.2%
/gnu/store/pkcw25plv6310pmmm7yi276fzzpnl6zq-llvm-14.0.5            257.2   185.2  13.9%
/gnu/store/579xrf7vz85ynjlk62njaczgnayam1ar-llvm-13.0.1            247.1   175.0  13.2%
/gnu/store/p0spbhzkk7wa3phiyk126n1kkfdsnmw9-clang-runtime-14.0.5   227.9    31.6   2.4%
/gnu/store/js2yvkq2ki2zbl166g2mfa53qlrilxhn-libomp-13.0.1          253.9     1.8   0.1%
/gnu/store/ahr3mcg1l1nml67x4i1znws25ph84bb2-clang-toolchain-14.0.5  1330.9     0.3   0.0%

$ ./pre-inst-env guix size clang-toolchain <at> 14 | grep 'clang\|llvm\|libomp'
/gnu/store/hcypy6mb3v19a58hvaf265283jgd37mm-clang-14.0.6           886.1   215.6  18.6%
/gnu/store/0ip696hw07p8rmwyqks0slm642mhdzfh-llvm-14.0.6            257.2   185.2  16.0%
/gnu/store/bckl8q1wra5k0cgwfiyb2syay556gwjr-clang-runtime-14.0.6   227.9    31.6   2.7%
/gnu/store/rpk14gkhav3mrcf5wppyc77yd2jh5syi-libomp-14.0.6          264.2     1.9   0.2%
/gnu/store/bynhq99qdd71n1v4y52x533bxghz6i1x-clang-toolchain-14.0.6  1156.0     0.3   0.0%

Greg Hogan (5):
  gnu: llvm-8: Fix build with gcc-10.
  gnu: llvm-3.7, llvm-3.8: Fix build with gcc.
  gnu: faust-2: Update to 2.41.1.
  gnu: LLVM, Clang, LLD: Update to 14.0.6.
  gnu: clang-toolchain-14: Build with libomp-14.

 gnu/local.mk                                  |   3 +
 gnu/packages/audio.scm                        |   8 +-
 gnu/packages/llvm.scm                         | 134 +++++++++++-------
 ...g-runtime-3.7-fix-build-with-python3.patch |  16 +++
 .../llvm-3.x.1-fix-build-with-gcc.patch       |  15 ++
 .../llvm-8-fix-build-with-gcc-10.patch        |  34 +++++
 6 files changed, 155 insertions(+), 55 deletions(-)
 create mode 100644 gnu/packages/patches/clang-runtime-3.7-fix-build-with-python3.patch
 create mode 100644 gnu/packages/patches/llvm-3.x.1-fix-build-with-gcc.patch
 create mode 100644 gnu/packages/patches/llvm-8-fix-build-with-gcc-10.patch

-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#56452; Package guix-patches. (Fri, 08 Jul 2022 16:00:02 GMT) Full text and rfc822 format available.

Message #8 received at 56452 <at> debbugs.gnu.org (full text, mbox):

From: Greg Hogan <code <at> greghogan.com>
To: 56452 <at> debbugs.gnu.org
Cc: Greg Hogan <code <at> greghogan.com>
Subject: [PATCH 1/5] gnu: llvm-8: Fix build with gcc-10.
Date: Fri,  8 Jul 2022 15:58:48 +0000
* gnu/packages/patches/llvm-8-fix-build-with-gcc-10.patch: New file.
* gnu/packages/llvm.scm (clang-8, clang-runtime-8): Update to 8.0.1.
* gnu/packages/llvm.scm (llvm-8): Use patch and update to 8.0.1.
* gnu/local.mk: Register patch.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/llvm.scm                         |  9 ++---
 .../llvm-8-fix-build-with-gcc-10.patch        | 34 +++++++++++++++++++
 3 files changed, 40 insertions(+), 4 deletions(-)
 create mode 100644 gnu/packages/patches/llvm-8-fix-build-with-gcc-10.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 2516562ea4..0a5de26266 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1452,6 +1452,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/llhttp-bootstrap-CVE-2020-8287.patch	\
   %D%/packages/patches/llvm-3.5-fix-clang-build-with-gcc5.patch	\
   %D%/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch	\
+  %D%/packages/patches/llvm-8-fix-build-with-gcc-10.patch	\
   %D%/packages/patches/llvm-9-fix-bitcast-miscompilation.patch	\
   %D%/packages/patches/llvm-9-fix-lpad-miscompilation.patch	\
   %D%/packages/patches/llvm-9-fix-scev-miscompilation.patch	\
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index ffa156af15..f8320c4112 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -912,24 +912,25 @@ (define-public clang-toolchain-9
 (define-public llvm-8
   (package
     (inherit llvm-9)
-    (version "8.0.0")
+    (version "8.0.1")
     (source (origin
               (method url-fetch)
               (uri (llvm-uri "llvm" version))
               (sha256
                (base32
-                "0k124sxkfhfi1rca6kzkdraf4axhx99x3cw2rk55056628dvwwl8"))))
+                "1rvm5gqp5v8hfn17kqws3zhk94w4kxndal12bqa0y57p09nply24"))
+              (patches (search-patches "llvm-8-fix-build-with-gcc-10.patch"))))
     (license license:ncsa)))
 
 (define-public clang-runtime-8
   (clang-runtime-from-llvm
    llvm-8
-   "1c919wsm17xnv7lr8bhpq2wkq8113lzlw6hzhfr737j59x3wfddl"
+   "0dqqf8f930l8gag4d9qjgn1n0pj0nbv2anviqqhdi1rkhas8z0hi"
    '("clang-runtime-9-libsanitizer-mode-field.patch")))
 
 (define-public clang-8
   (clang-from-llvm llvm-8 clang-runtime-8
-                   "0svk1f70hvpwrjp6x5i9kqwrqwxnmcrw5s7f4cxyd100mdd12k08"
+                   "0ihnbdl058gvl2wdy45p5am55bq8ifx8m9mhcsgj9ax8yxlzvvvh"
                    #:patches '("clang-8.0-libc-search-path.patch")))
 
 (define-public clang-toolchain-8
diff --git a/gnu/packages/patches/llvm-8-fix-build-with-gcc-10.patch b/gnu/packages/patches/llvm-8-fix-build-with-gcc-10.patch
new file mode 100644
index 0000000000..9b36cc772c
--- /dev/null
+++ b/gnu/packages/patches/llvm-8-fix-build-with-gcc-10.patch
@@ -0,0 +1,34 @@
+From b288d90b39f4b905c02092a9bfcfd6d78f99b191 Mon Sep 17 00:00:00 2001
+From: Than McIntosh <thanm <at> google.com>
+Date: Fri, 19 Jul 2019 13:13:54 +0000
+Subject: [PATCH] [NFC] include cstdint/string prior to using uint8_t/string
+
+Summary: include proper header prior to use of uint8_t typedef
+and std::string.
+
+Subscribers: llvm-commits
+
+Reviewers: cherry
+
+Tags: #llvm
+
+Differential Revision: https://reviews.llvm.org/D64937
+
+llvm-svn: 366572
+---
+ llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/llvm/Demangle/MicrosoftDemangleNodes.h b/include/llvm/Demangle/MicrosoftDemangleNodes.h
+index da9d9d5bfdc0c..3d47471f0ef0e 100644
+--- a/include/llvm/Demangle/MicrosoftDemangleNodes.h
++++ b/include/llvm/Demangle/MicrosoftDemangleNodes.h
+@@ -16,6 +16,8 @@
+ #include "llvm/Demangle/DemangleConfig.h"
+ #include "llvm/Demangle/StringView.h"
+ #include <array>
++#include <cstdint>
++#include <string>
+ 
+ namespace llvm {
+ namespace itanium_demangle {
-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#56452; Package guix-patches. (Fri, 08 Jul 2022 16:00:03 GMT) Full text and rfc822 format available.

Message #11 received at 56452 <at> debbugs.gnu.org (full text, mbox):

From: Greg Hogan <code <at> greghogan.com>
To: 56452 <at> debbugs.gnu.org
Cc: Greg Hogan <code <at> greghogan.com>
Subject: [PATCH 2/5] gnu: llvm-3.7, llvm-3.8: Fix build with gcc.
Date: Fri,  8 Jul 2022 15:58:49 +0000
* gnu/packages/patches/clang-runtime-3.7-fix-build-with-python3.patch,
gnu/packages/patches/llvm-3.x.1-fix-build-with-gcc.patch: New files.
* gnu/packages/llvm.scm (clang-runtime-3.7, llvm-3.7, llvm-3.8): Use patches.
* gnu/local.mk: Register patches.
---
 gnu/local.mk                                     |  2 ++
 gnu/packages/llvm.scm                            |  9 ++++++---
 ...lang-runtime-3.7-fix-build-with-python3.patch | 16 ++++++++++++++++
 .../patches/llvm-3.x.1-fix-build-with-gcc.patch  | 15 +++++++++++++++
 4 files changed, 39 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/clang-runtime-3.7-fix-build-with-python3.patch
 create mode 100644 gnu/packages/patches/llvm-3.x.1-fix-build-with-gcc.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 0a5de26266..d646a19f0d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -955,6 +955,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/clang-runtime-esan-build-fixes.patch	\
   %D%/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch	\
   %D%/packages/patches/clang-runtime-3.5-libsanitizer-mode-field.patch	\
+  %D%/packages/patches/clang-runtime-3.7-fix-build-with-python3.patch	\
   %D%/packages/patches/clang-runtime-3.9-libsanitizer-mode-field.patch	\
   %D%/packages/patches/clang-runtime-3.8-libsanitizer-mode-field.patch	\
   %D%/packages/patches/classpath-aarch64-support.patch		\
@@ -1452,6 +1453,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/llhttp-bootstrap-CVE-2020-8287.patch	\
   %D%/packages/patches/llvm-3.5-fix-clang-build-with-gcc5.patch	\
   %D%/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch	\
+  %D%/packages/patches/llvm-3.x.1-fix-build-with-gcc.patch	\
   %D%/packages/patches/llvm-8-fix-build-with-gcc-10.patch	\
   %D%/packages/patches/llvm-9-fix-bitcast-miscompilation.patch	\
   %D%/packages/patches/llvm-9-fix-lpad-miscompilation.patch	\
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index f8320c4112..6b216ee78c 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -1036,7 +1036,8 @@ (define-public llvm-3.8
       (uri (llvm-uri "llvm" version))
       (sha256
        (base32
-        "1ybmnid4pw2hxn12ax5qa5kl1ldfns0njg8533y3mzslvd5cx0kf"))))))
+        "1ybmnid4pw2hxn12ax5qa5kl1ldfns0njg8533y3mzslvd5cx0kf"))
+      (patches (search-patches "llvm-3.x.1-fix-build-with-gcc.patch"))))))
 
 (define-public clang-runtime-3.8
   (clang-runtime-from-llvm
@@ -1060,7 +1061,8 @@ (define-public llvm-3.7
        (uri (llvm-uri "llvm" version))
        (sha256
         (base32
-         "1masakdp9g2dan1yrazg7md5am2vacbkb3nahb3dchpc1knr8xxy"))))))
+         "1masakdp9g2dan1yrazg7md5am2vacbkb3nahb3dchpc1knr8xxy"))
+      (patches (search-patches "llvm-3.x.1-fix-build-with-gcc.patch"))))))
 
 (define-public clang-runtime-3.7
   (clang-runtime-from-llvm
@@ -1068,7 +1070,8 @@ (define-public clang-runtime-3.7
    "10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx"
    '("clang-runtime-asan-build-fixes.patch"
      "clang-runtime-3.8-libsanitizer-mode-field.patch"
-     "clang-3.5-libsanitizer-ustat-fix.patch")))
+     "clang-3.5-libsanitizer-ustat-fix.patch"
+     "clang-runtime-3.7-fix-build-with-python3.patch")))
 
 (define-public clang-3.7
   (clang-from-llvm llvm-3.7 clang-runtime-3.7
diff --git a/gnu/packages/patches/clang-runtime-3.7-fix-build-with-python3.patch b/gnu/packages/patches/clang-runtime-3.7-fix-build-with-python3.patch
new file mode 100644
index 0000000000..042f0e025a
--- /dev/null
+++ b/gnu/packages/patches/clang-runtime-3.7-fix-build-with-python3.patch
@@ -0,0 +1,16 @@
+Patch based on changes from
+https://github.com/llvm/llvm-project/commit/c1fde4fa943fd03a3d40bc5d32b9e0045fd29208
+
+diff --git a/lib/sanitizer_common/scripts/gen_dynamic_list.py b/lib/sanitizer_common/scripts/gen_dynamic_list.py
+index 5ea2ca1..d7bc287 100755
+--- a/lib/sanitizer_common/scripts/gen_dynamic_list.py
++++ b/lib/sanitizer_common/scripts/gen_dynamic_list.py
+@@ -100,7 +100,7 @@ def main(argv):
+     print('global:')
+   result.sort()
+   for f in result:
+-    print('  ' + f.encode('utf-8') + ';')
++    print(u'  %s;' % f)
+   if args.version_list:
+     print('local:')
+     print('  *;')
diff --git a/gnu/packages/patches/llvm-3.x.1-fix-build-with-gcc.patch b/gnu/packages/patches/llvm-3.x.1-fix-build-with-gcc.patch
new file mode 100644
index 0000000000..75236c4069
--- /dev/null
+++ b/gnu/packages/patches/llvm-3.x.1-fix-build-with-gcc.patch
@@ -0,0 +1,15 @@
+Patch from https://github.com/digego/extempore/issues/318
+
+diff --git a/include/llvm/IR/ValueMap.h.orig b/include/llvm/IR/ValueMap.h
+index ad518ac..d928f6a 100644
+--- a/include/llvm/IR/ValueMap.h
++++ b/include/llvm/IR/ValueMap.h
+@@ -99,7 +99,7 @@
+   explicit ValueMap(const ExtraData &Data, unsigned NumInitBuckets = 64)
+       : Map(NumInitBuckets), Data(Data) {}
+ 
+-  bool hasMD() const { return MDMap; }
++  bool hasMD() const { return static_cast<bool>(MDMap); }
+   MDMapT &MD() {
+     if (!MDMap)
+       MDMap.reset(new MDMapT);
-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#56452; Package guix-patches. (Fri, 08 Jul 2022 16:00:03 GMT) Full text and rfc822 format available.

Message #14 received at 56452 <at> debbugs.gnu.org (full text, mbox):

From: Greg Hogan <code <at> greghogan.com>
To: 56452 <at> debbugs.gnu.org
Cc: Greg Hogan <code <at> greghogan.com>
Subject: [PATCH 3/5] gnu: faust-2: Update to 2.41.1.
Date: Fri,  8 Jul 2022 15:58:50 +0000
* gnu/packages/audio.scm (faust-2): Update to 2.41.1.
[build-system]: Replace gnu-build-system with cmake-build-system.
[native-inputs]: Replace llvm-3.8 with llvm.
---
 gnu/packages/audio.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 0922c74788..646f4af7a3 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -1952,7 +1952,7 @@ (define-public faust-0.9.67
 (define-public faust-2
   (package
     (inherit faust)
-    (version "2.5.23")
+    (version "2.41.1")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://github.com/grame-cncm/faust/"
@@ -1960,15 +1960,15 @@ (define-public faust-2
                                   "/faust-" version ".tar.gz"))
               (sha256
                (base32
-                "1yz5jnr76hh7rmxkpdi7gyrw1wp4gyqfpq8zyl97qdi5ga5gjznq"))))
-    (build-system gnu-build-system)
+                "0gk8ifxrbykq7ay0nvjns8fjryhp0wfhv5npgrl8xpgw9wfmw53j"))))
+    (build-system cmake-build-system)
     (arguments
      (substitute-keyword-arguments (package-arguments faust)
        ((#:make-flags flags)
         `(list (string-append "prefix=" (assoc-ref %outputs "out"))
                "world"))))
     (native-inputs
-     `(("llvm" ,llvm-3.8)
+     `(("llvm" ,llvm)
        ("which" ,which)
        ("xxd" ,xxd)
        ("ctags" ,emacs-minimal)  ; for ctags
-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#56452; Package guix-patches. (Fri, 08 Jul 2022 16:00:04 GMT) Full text and rfc822 format available.

Message #17 received at 56452 <at> debbugs.gnu.org (full text, mbox):

From: Greg Hogan <code <at> greghogan.com>
To: 56452 <at> debbugs.gnu.org
Cc: Greg Hogan <code <at> greghogan.com>
Subject: [PATCH 4/5] gnu: LLVM, Clang, LLD: Update to 14.0.6.
Date: Fri,  8 Jul 2022 15:58:51 +0000
* gnu/packages/llvm.scm (llvm-14, clang-14, lld-14): Update to 14.0.6.
(%llvm-monorepo-hashes, %llvm-patches): Adjust accordingly.
---
 gnu/packages/llvm.scm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 6b216ee78c..67ca5ab5ea 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -543,10 +543,10 @@ (define (make-clang-toolchain clang)
               ("libc-static" ,glibc "static")))))
 
 (define %llvm-monorepo-hashes
-  '(("14.0.5" . "1hdv020x4k5fp38hik3bxz8k2sr3gnyj9iym3yhjhwygzgwgxjh9")))
+  '(("14.0.6" . "14f8nlvnmdkp9a9a79wv67jbmafvabczhah8rwnqrgd5g3hfxxxx")))
 
 (define %llvm-patches
-  '(("14.0.5" . ("clang-14.0-libc-search-path.patch"))))
+  '(("14.0.6" . ("clang-14.0-libc-search-path.patch"))))
 
 (define (llvm-monorepo version)
   (origin
@@ -561,7 +561,7 @@ (define (llvm-monorepo version)
 (define-public llvm-14
   (package
     (name "llvm")
-    (version "14.0.5")
+    (version "14.0.6")
     (source (llvm-monorepo version))
     (build-system cmake-build-system)
     (outputs '("out" "opt-viewer"))
@@ -649,7 +649,7 @@ (define-public clang-14
                                            (package-version llvm-14)))
                             (sha256
                              (base32
-                              "1p9y5fbcw3ynb79nzyadirwdla03bq38k6d9nhv9x8z2q4ypsga4"))))))
+                              "0rhq4wkmvr369nkk059skzzw7jx6qhzqhmiwmqg4sp66avzviwvw"))))))
     (package
       (inherit template)
       (arguments
@@ -1206,7 +1206,7 @@ (define-public libunwind-headers
 (define-public lld-14
   (package
     (name "lld")
-    (version "14.0.5")
+    (version "14.0.6")
     (source (llvm-monorepo version))
     (build-system cmake-build-system)
     (inputs
-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#56452; Package guix-patches. (Fri, 08 Jul 2022 16:00:04 GMT) Full text and rfc822 format available.

Message #20 received at 56452 <at> debbugs.gnu.org (full text, mbox):

From: Greg Hogan <code <at> greghogan.com>
To: 56452 <at> debbugs.gnu.org
Cc: Greg Hogan <code <at> greghogan.com>
Subject: [PATCH 5/5] gnu: clang-toolchain-14: Build with libomp-14.
Date: Fri,  8 Jul 2022 15:58:52 +0000
* gnu/packages/llvm.scm (libomp-14): New variable.
(libomp-13): Inherit from libomp-14.
(libomp): Define as libomp-13.
(make-clang-toolchain): Parameterize libomp.
(clang-toolchain-14): Use libomp-14.
---
 gnu/packages/llvm.scm | 109 +++++++++++++++++++++++++++---------------
 1 file changed, 70 insertions(+), 39 deletions(-)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 67ca5ab5ea..5a2f411eb2 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -485,7 +485,7 @@ (define (clang-properties version)
               "znver3")
             '())))))
 
-(define (make-clang-toolchain clang)
+(define* (make-clang-toolchain clang #:optional (libomp libomp-13))
   (package
     (name (string-append (package-name clang) "-toolchain"))
     (version (package-version clang))
@@ -660,8 +660,50 @@ (define-public clang-14
                 (lambda _
                   (chdir "clang"))))))))))
 
+(define-public libomp-14
+  (package
+    (name "libomp")
+    (version "14.0.6")
+    (source (origin
+              (method url-fetch)
+              (uri (llvm-uri "openmp" version))
+              (sha256
+               (base32
+                "07zby3gwy5c8jssabrhjk3nsxlwipnm6sk4dsvck1l5d0br1ywsg"))
+              (file-name (string-append "libomp-" version ".tar.xz"))))
+    (build-system cmake-build-system)
+    ;; XXX: Note this gets built with GCC because building with Clang itself
+    ;; fails (missing <atomic>, even when libcxx is added as an input.)
+    (arguments
+     (list
+       #:configure-flags #~(list "-DLIBOMP_USE_HWLOC=ON"
+                                 "-DOPENMP_TEST_C_COMPILER=clang"
+                                 "-DOPENMP_TEST_CXX_COMPILER=clang++")
+       #:test-target "check-libomp"
+       #:phases
+       #~(modify-phases %standard-phases
+         (add-after 'unpack 'chdir-to-source-and-install-license
+           (lambda _
+             (chdir #$(string-append "../openmp-" version ".src"))
+             (install-file "LICENSE.TXT"
+                           (string-append #$output "/share/doc")))))))
+    (native-inputs
+     (list clang-14 llvm-14 perl pkg-config python))
+    (inputs
+     (list `(,hwloc "lib")))
+    (home-page "https://openmp.llvm.org")
+    (synopsis "OpenMP run-time support library")
+    (description
+     "This package provides the run-time support library developed by the LLVM
+project for the OpenMP multi-theaded programming extension.  This package
+notably provides @file{libgomp.so}, which is has a binary interface compatible
+with that of libgomp, the GNU Offloading and Multi Processing Library.")
+    (properties `((release-monitoring-url . ,%llvm-release-monitoring-url)
+                  (upstream-name . "openmp")))
+    (license license:expat)))
+
 (define-public clang-toolchain-14
-  (make-clang-toolchain clang-14))
+  (make-clang-toolchain clang-14 libomp-14))
 
 (define-public llvm-13
   (package
@@ -699,6 +741,31 @@ (define-public clang-13
                       (base32
                        "1l4jjdqfl9hrh0fwzv27hc263zc6x61h09vs4ni3yla8i1cwhayc")))))
 
+(define-public libomp-13
+  (package
+    (inherit libomp-14)
+    (version "13.0.1")
+    (source (origin
+              (method url-fetch)
+              (uri (llvm-uri "openmp" version))
+              (sha256
+               (base32
+                "0kvbr4j6ldpssiv7chgqra5y77n7jwbyxlwcl7z32v31f49jcybb"))
+              (file-name (string-append "libomp-" version ".tar.xz"))))
+    (arguments
+     '(#:configure-flags '("-DLIBOMP_USE_HWLOC=ON"
+                           "-DOPENMP_TEST_C_COMPILER=clang"
+                           "-DOPENMP_TEST_CXX_COMPILER=clang++"
+
+                           ;; Work around faulty target detection, fixed in 14:
+                           ;; https://github.com/llvm/llvm-project/issues/52910
+                           "-DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=OFF")
+       #:test-target "check-libomp"))
+    (native-inputs
+     (modify-inputs (package-native-inputs libomp-14)
+       (replace "clang" clang-13)
+       (replace "llvm" llvm-13)))))
+
 (define-public clang-toolchain-13
   (make-clang-toolchain clang-13))
 
@@ -1515,43 +1582,7 @@ (define-public libclc
     ;; Apache license 2.0 with LLVM exception
     (license license:asl2.0)))
 
-(define-public libomp
-  (package
-    (name "libomp")
-    (version "13.0.1")
-    (source (origin
-              (method url-fetch)
-              (uri (llvm-uri "openmp" version))
-              (sha256
-               (base32
-                "0kvbr4j6ldpssiv7chgqra5y77n7jwbyxlwcl7z32v31f49jcybb"))
-              (file-name (string-append "libomp-" version ".tar.xz"))))
-    (build-system cmake-build-system)
-    ;; XXX: Note this gets built with GCC because building with Clang itself
-    ;; fails (missing <atomic>, even when libcxx is added as an input.)
-    (arguments
-     '(#:configure-flags '("-DLIBOMP_USE_HWLOC=ON"
-                           "-DOPENMP_TEST_C_COMPILER=clang"
-                           "-DOPENMP_TEST_CXX_COMPILER=clang++"
-
-                           ;; Work around faulty target detection, fixed in 14:
-                           ;; https://github.com/llvm/llvm-project/issues/52910
-                           "-DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=OFF")
-       #:test-target "check-libomp"))
-    (native-inputs
-     (list clang llvm perl pkg-config python))
-    (inputs
-     (list `(,hwloc "lib")))
-    (home-page "https://openmp.llvm.org")
-    (synopsis "OpenMP run-time support library")
-    (description
-     "This package provides the run-time support library developed by the LLVM
-project for the OpenMP multi-theaded programming extension.  This package
-notably provides @file{libgomp.so}, which is has a binary interface compatible
-with that of libgomp, the GNU Offloading and Multi Processing Library.")
-    (properties `((release-monitoring-url . ,%llvm-release-monitoring-url)
-                  (upstream-name . "openmp")))
-    (license license:expat)))
+(define-public libomp libomp-13)
 
 (define-public python-llvmlite
   (package
-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#56452; Package guix-patches. (Mon, 11 Jul 2022 22:07:02 GMT) Full text and rfc822 format available.

Message #23 received at 56452 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Greg Hogan <code <at> greghogan.com>
Cc: 56452 <at> debbugs.gnu.org
Subject: Re: bug#56452: [PATCH 0/5] Fix and update LLVM and clang-toolchain.
Date: Tue, 12 Jul 2022 00:06:05 +0200
Hi,

Greg Hogan <code <at> greghogan.com> skribis:

> * gnu/packages/audio.scm (faust-2): Update to 2.41.1.
> [build-system]: Replace gnu-build-system with cmake-build-system.
> [native-inputs]: Replace llvm-3.8 with llvm.

It fails to build for me, like so:

--8<---------------cut here---------------start------------->8---
Consolidate compiler generated dependencies of target faustmachinestatic
make[4]: Leaving directory '/tmp/guix-build-faust-2.41.1.drv-0/faust-2.41.1/build/faustdir'
[100%] Built target faustmachinestatic
make[3]: Leaving directory '/tmp/guix-build-faust-2.41.1.drv-0/faust-2.41.1/build/faustdir'
Install the project...
-- Install configuration: "Release"
CMake Error at cmake_install.cmake:60 (file):
  file cannot create directory: /usr/local/bin.  Maybe need administrative
  privileges.


make[2]: *** [Makefile:103: install] Error 1
make[2]: Leaving directory '/tmp/guix-build-faust-2.41.1.drv-0/faust-2.41.1/build/faustdir'
make[1]: *** [Makefile:333: install] Error 2
make[1]: Leaving directory '/tmp/guix-build-faust-2.41.1.drv-0/faust-2.41.1/build'
make: *** [Makefile:200: install] Error 2
error: in phase 'install': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("install" "prefix=/gnu/store/bxzj1inf7y4d4y7gxdmzk24zi1xgwifv-faust-2.41.1" "world") exit-status: 2 term-signal: #f stop-signal: #f> 
phase `install' failed after 4.8 seconds
command "make" "install" "prefix=/gnu/store/bxzj1inf7y4d4y7gxdmzk24zi1xgwifv-faust-2.41.1" "world" failed with status 2
--8<---------------cut here---------------end--------------->8---

Could you take a look?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#56452; Package guix-patches. (Mon, 11 Jul 2022 23:18:02 GMT) Full text and rfc822 format available.

Message #26 received at 56452 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Greg Hogan <code <at> greghogan.com>
Cc: 56452 <at> debbugs.gnu.org
Subject: Re: bug#56452: [PATCH 0/5] Fix and update LLVM and clang-toolchain.
Date: Tue, 12 Jul 2022 01:17:19 +0200
Hello,

Greg Hogan <code <at> greghogan.com> skribis:

> This patchset updates and fixes the builds of llvm-3.7, llvm-3.8, and
> llvm-8 and also updates llvm-14.

Yay!

> The only failing depedent package is beignet, which has failed to build
> since last year's replacement of ocl-icd with opencl-icd-loader. beignet
> has no dependents and was last updated in 2017.
>
> By building clang-toolchain with a libomp built with the same version of
> llvm we remove the additional copy of llvm and reduce the size of the
> closure from 1330.9 MB to 1156 MB.

It’s still terrible, but it’s an improvement.

> If this is accepted I would look to submit a follow-on patchset adding
> libomp varients for clang-toolchain-12 and earlier.

Sounds good.

>   gnu: llvm-8: Fix build with gcc-10.
>   gnu: llvm-3.7, llvm-3.8: Fix build with gcc.
>   gnu: faust-2: Update to 2.41.1.
>   gnu: LLVM, Clang, LLD: Update to 14.0.6.
>   gnu: clang-toolchain-14: Build with libomp-14.

Applied it all except the faust patch; let me know what to do with that
one.

Thanks!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#56452; Package guix-patches. (Tue, 12 Jul 2022 20:07:01 GMT) Full text and rfc822 format available.

Message #29 received at 56452 <at> debbugs.gnu.org (full text, mbox):

From: Greg Hogan <code <at> greghogan.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 56452 <at> debbugs.gnu.org
Subject: Re: bug#56452: [PATCH 0/5] Fix and update LLVM and clang-toolchain.
Date: Tue, 12 Jul 2022 16:06:07 -0400
On Mon, Jul 11, 2022 at 6:06 PM Ludovic Courtès <ludo <at> gnu.org> wrote:
>
> Hi,
>
> Greg Hogan <code <at> greghogan.com> skribis:
>
> > * gnu/packages/audio.scm (faust-2): Update to 2.41.1.
> > [build-system]: Replace gnu-build-system with cmake-build-system.
> > [native-inputs]: Replace llvm-3.8 with llvm.
>
> It fails to build for me, [...]
>
> Could you take a look?
>
> Thanks,
> Ludo’.

Ludo',

Thanks for the review! I failed to register that by switching the
dependency from llvm-3.8 to llvm, the faust-2 build would no longer be
initiated when building all dependencies of llvm-3.8.

I have a patch to follow-up with git send-email. I have cc'd Ricardo
since he looks to be both a user and maintainer of the faust packages.

Greg




Information forwarded to guix-patches <at> gnu.org:
bug#56452; Package guix-patches. (Tue, 12 Jul 2022 20:09:02 GMT) Full text and rfc822 format available.

Message #32 received at 56452 <at> debbugs.gnu.org (full text, mbox):

From: Greg Hogan <code <at> greghogan.com>
To: 56452 <at> debbugs.gnu.org
Cc: Greg Hogan <code <at> greghogan.com>
Subject: [PATCH v2] gnu: faust-2: Update to 2.41.1.
Date: Tue, 12 Jul 2022 20:07:52 +0000
* gnu/packages/audio.scm (faust-2): Update to 2.41.1.
[build-system]: Replace gnu-build-system with cmake-build-system.
[arguments]<#:phases>: Invoke cmake directly to build the main package
and invoke make directly to build ancillary tools.
[native-inputs]: Replace llvm-3.8 with llvm.
---
 gnu/packages/audio.scm | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 0922c74788..db4c3af248 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -1952,7 +1952,7 @@ (define-public faust-0.9.67
 (define-public faust-2
   (package
     (inherit faust)
-    (version "2.5.23")
+    (version "2.41.1")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://github.com/grame-cncm/faust/"
@@ -1960,15 +1960,29 @@ (define-public faust-2
                                   "/faust-" version ".tar.gz"))
               (sha256
                (base32
-                "1yz5jnr76hh7rmxkpdi7gyrw1wp4gyqfpq8zyl97qdi5ga5gjznq"))))
-    (build-system gnu-build-system)
+                "0gk8ifxrbykq7ay0nvjns8fjryhp0wfhv5npgrl8xpgw9wfmw53j"))))
+    (build-system cmake-build-system)
     (arguments
-     (substitute-keyword-arguments (package-arguments faust)
-       ((#:make-flags flags)
-        `(list (string-append "prefix=" (assoc-ref %outputs "out"))
-               "world"))))
+     `(#:tests? #f ; no tests
+       #:phases
+       (modify-phases %standard-phases
+         ;; The upstream package uses make to run cmake during the build stage.
+         ;; Here we ignore the Makefile and call cmake directly.
+         (replace 'configure
+           (lambda _
+             (chdir "build")
+             (invoke "cmake" "-C" "backends/all.cmake"
+                     (string-append "-DCMAKE_INSTALL_PREFIX="
+                      (assoc-ref %outputs "out")))))
+         ;; The sound2faust tool would be built in the Makefile's "world" target
+         (add-after 'install 'sound2faust
+           (lambda _
+             (chdir "../tools/sound2faust")
+             (setenv "PREFIX" (assoc-ref %outputs "out"))
+             (invoke "make")
+             (invoke "make" "install"))))))
     (native-inputs
-     `(("llvm" ,llvm-3.8)
+     `(("llvm" ,llvm)
        ("which" ,which)
        ("xxd" ,xxd)
        ("ctags" ,emacs-minimal)  ; for ctags
-- 
2.36.1





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Tue, 12 Jul 2022 22:20:02 GMT) Full text and rfc822 format available.

Notification sent to Greg Hogan <code <at> greghogan.com>:
bug acknowledged by developer. (Tue, 12 Jul 2022 22:20:02 GMT) Full text and rfc822 format available.

Message #37 received at 56452-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Greg Hogan <code <at> greghogan.com>
Cc: 56452-done <at> debbugs.gnu.org
Subject: Re: bug#56452: [PATCH 0/5] Fix and update LLVM and clang-toolchain.
Date: Wed, 13 Jul 2022 00:19:43 +0200
Hi,

Greg Hogan <code <at> greghogan.com> skribis:

> * gnu/packages/audio.scm (faust-2): Update to 2.41.1.
> [build-system]: Replace gnu-build-system with cmake-build-system.
> [arguments]<#:phases>: Invoke cmake directly to build the main package
> and invoke make directly to build ancillary tools.
> [native-inputs]: Replace llvm-3.8 with llvm.

Applied, thanks for the quick reply!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 10 Aug 2022 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 312 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.