all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#56452] [PATCH 0/5] Fix and update LLVM and clang-toolchain.
@ 2022-07-08 15:57 Greg Hogan
  2022-07-08 15:58 ` [bug#56452] [PATCH 1/5] gnu: llvm-8: Fix build with gcc-10 Greg Hogan
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Greg Hogan @ 2022-07-08 15:57 UTC (permalink / raw)
  To: 56452; +Cc: Greg Hogan

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@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@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#56452] [PATCH 1/5] gnu: llvm-8: Fix build with gcc-10.
  2022-07-08 15:57 [bug#56452] [PATCH 0/5] Fix and update LLVM and clang-toolchain Greg Hogan
@ 2022-07-08 15:58 ` Greg Hogan
  2022-07-08 15:58   ` [bug#56452] [PATCH 2/5] gnu: llvm-3.7, llvm-3.8: Fix build with gcc Greg Hogan
                     ` (3 more replies)
  2022-07-11 23:17 ` [bug#56452] [PATCH 0/5] Fix and update LLVM and clang-toolchain Ludovic Courtès
  2022-07-12 20:07 ` [bug#56452] [PATCH v2] gnu: faust-2: Update to 2.41.1 Greg Hogan
  2 siblings, 4 replies; 11+ messages in thread
From: Greg Hogan @ 2022-07-08 15:58 UTC (permalink / raw)
  To: 56452; +Cc: Greg Hogan

* 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@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





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#56452] [PATCH 2/5] gnu: llvm-3.7, llvm-3.8: Fix build with gcc.
  2022-07-08 15:58 ` [bug#56452] [PATCH 1/5] gnu: llvm-8: Fix build with gcc-10 Greg Hogan
@ 2022-07-08 15:58   ` Greg Hogan
  2022-07-08 15:58   ` [bug#56452] [PATCH 3/5] gnu: faust-2: Update to 2.41.1 Greg Hogan
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Greg Hogan @ 2022-07-08 15:58 UTC (permalink / raw)
  To: 56452; +Cc: Greg Hogan

* 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





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#56452] [PATCH 3/5] gnu: faust-2: Update to 2.41.1.
  2022-07-08 15:58 ` [bug#56452] [PATCH 1/5] gnu: llvm-8: Fix build with gcc-10 Greg Hogan
  2022-07-08 15:58   ` [bug#56452] [PATCH 2/5] gnu: llvm-3.7, llvm-3.8: Fix build with gcc Greg Hogan
@ 2022-07-08 15:58   ` Greg Hogan
  2022-07-11 22:06     ` [bug#56452] [PATCH 0/5] Fix and update LLVM and clang-toolchain Ludovic Courtès
  2022-07-08 15:58   ` [bug#56452] [PATCH 4/5] gnu: LLVM, Clang, LLD: Update to 14.0.6 Greg Hogan
  2022-07-08 15:58   ` [bug#56452] [PATCH 5/5] gnu: clang-toolchain-14: Build with libomp-14 Greg Hogan
  3 siblings, 1 reply; 11+ messages in thread
From: Greg Hogan @ 2022-07-08 15:58 UTC (permalink / raw)
  To: 56452; +Cc: Greg Hogan

* 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





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#56452] [PATCH 4/5] gnu: LLVM, Clang, LLD: Update to 14.0.6.
  2022-07-08 15:58 ` [bug#56452] [PATCH 1/5] gnu: llvm-8: Fix build with gcc-10 Greg Hogan
  2022-07-08 15:58   ` [bug#56452] [PATCH 2/5] gnu: llvm-3.7, llvm-3.8: Fix build with gcc Greg Hogan
  2022-07-08 15:58   ` [bug#56452] [PATCH 3/5] gnu: faust-2: Update to 2.41.1 Greg Hogan
@ 2022-07-08 15:58   ` Greg Hogan
  2022-07-08 15:58   ` [bug#56452] [PATCH 5/5] gnu: clang-toolchain-14: Build with libomp-14 Greg Hogan
  3 siblings, 0 replies; 11+ messages in thread
From: Greg Hogan @ 2022-07-08 15:58 UTC (permalink / raw)
  To: 56452; +Cc: Greg Hogan

* 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





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#56452] [PATCH 5/5] gnu: clang-toolchain-14: Build with libomp-14.
  2022-07-08 15:58 ` [bug#56452] [PATCH 1/5] gnu: llvm-8: Fix build with gcc-10 Greg Hogan
                     ` (2 preceding siblings ...)
  2022-07-08 15:58   ` [bug#56452] [PATCH 4/5] gnu: LLVM, Clang, LLD: Update to 14.0.6 Greg Hogan
@ 2022-07-08 15:58   ` Greg Hogan
  3 siblings, 0 replies; 11+ messages in thread
From: Greg Hogan @ 2022-07-08 15:58 UTC (permalink / raw)
  To: 56452; +Cc: Greg Hogan

* 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





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#56452] [PATCH 0/5] Fix and update LLVM and clang-toolchain.
  2022-07-08 15:58   ` [bug#56452] [PATCH 3/5] gnu: faust-2: Update to 2.41.1 Greg Hogan
@ 2022-07-11 22:06     ` Ludovic Courtès
  2022-07-12 20:06       ` Greg Hogan
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2022-07-11 22:06 UTC (permalink / raw)
  To: Greg Hogan; +Cc: 56452

Hi,

Greg Hogan <code@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’.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#56452] [PATCH 0/5] Fix and update LLVM and clang-toolchain.
  2022-07-08 15:57 [bug#56452] [PATCH 0/5] Fix and update LLVM and clang-toolchain Greg Hogan
  2022-07-08 15:58 ` [bug#56452] [PATCH 1/5] gnu: llvm-8: Fix build with gcc-10 Greg Hogan
@ 2022-07-11 23:17 ` Ludovic Courtès
  2022-07-12 20:07 ` [bug#56452] [PATCH v2] gnu: faust-2: Update to 2.41.1 Greg Hogan
  2 siblings, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2022-07-11 23:17 UTC (permalink / raw)
  To: Greg Hogan; +Cc: 56452

Hello,

Greg Hogan <code@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’.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#56452] [PATCH 0/5] Fix and update LLVM and clang-toolchain.
  2022-07-11 22:06     ` [bug#56452] [PATCH 0/5] Fix and update LLVM and clang-toolchain Ludovic Courtès
@ 2022-07-12 20:06       ` Greg Hogan
  0 siblings, 0 replies; 11+ messages in thread
From: Greg Hogan @ 2022-07-12 20:06 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Ricardo Wurmus, 56452

On Mon, Jul 11, 2022 at 6:06 PM Ludovic Courtès <ludo@gnu.org> wrote:
>
> Hi,
>
> Greg Hogan <code@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




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#56452] [PATCH v2] gnu: faust-2: Update to 2.41.1.
  2022-07-08 15:57 [bug#56452] [PATCH 0/5] Fix and update LLVM and clang-toolchain Greg Hogan
  2022-07-08 15:58 ` [bug#56452] [PATCH 1/5] gnu: llvm-8: Fix build with gcc-10 Greg Hogan
  2022-07-11 23:17 ` [bug#56452] [PATCH 0/5] Fix and update LLVM and clang-toolchain Ludovic Courtès
@ 2022-07-12 20:07 ` Greg Hogan
  2022-07-12 22:19   ` bug#56452: [PATCH 0/5] Fix and update LLVM and clang-toolchain Ludovic Courtès
  2 siblings, 1 reply; 11+ messages in thread
From: Greg Hogan @ 2022-07-12 20:07 UTC (permalink / raw)
  To: 56452; +Cc: Greg Hogan

* 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





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#56452: [PATCH 0/5] Fix and update LLVM and clang-toolchain.
  2022-07-12 20:07 ` [bug#56452] [PATCH v2] gnu: faust-2: Update to 2.41.1 Greg Hogan
@ 2022-07-12 22:19   ` Ludovic Courtès
  0 siblings, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2022-07-12 22:19 UTC (permalink / raw)
  To: Greg Hogan; +Cc: 56452-done

Hi,

Greg Hogan <code@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’.




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-07-12 22:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-08 15:57 [bug#56452] [PATCH 0/5] Fix and update LLVM and clang-toolchain Greg Hogan
2022-07-08 15:58 ` [bug#56452] [PATCH 1/5] gnu: llvm-8: Fix build with gcc-10 Greg Hogan
2022-07-08 15:58   ` [bug#56452] [PATCH 2/5] gnu: llvm-3.7, llvm-3.8: Fix build with gcc Greg Hogan
2022-07-08 15:58   ` [bug#56452] [PATCH 3/5] gnu: faust-2: Update to 2.41.1 Greg Hogan
2022-07-11 22:06     ` [bug#56452] [PATCH 0/5] Fix and update LLVM and clang-toolchain Ludovic Courtès
2022-07-12 20:06       ` Greg Hogan
2022-07-08 15:58   ` [bug#56452] [PATCH 4/5] gnu: LLVM, Clang, LLD: Update to 14.0.6 Greg Hogan
2022-07-08 15:58   ` [bug#56452] [PATCH 5/5] gnu: clang-toolchain-14: Build with libomp-14 Greg Hogan
2022-07-11 23:17 ` [bug#56452] [PATCH 0/5] Fix and update LLVM and clang-toolchain Ludovic Courtès
2022-07-12 20:07 ` [bug#56452] [PATCH v2] gnu: faust-2: Update to 2.41.1 Greg Hogan
2022-07-12 22:19   ` bug#56452: [PATCH 0/5] Fix and update LLVM and clang-toolchain Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.