summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/llvm.scm3
-rw-r--r--gnu/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch13
3 files changed, 17 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index bfecbfa6a1..dfb9e50b73 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1409,6 +1409,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/lirc-reproducible-build.patch		\
   %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-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 3d62965cb8..debcbf8148 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net>
+;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -841,6 +842,8 @@ of programming tools as well as libraries with equivalent functionality.")
      (origin
        (method url-fetch)
        (uri (llvm-uri "llvm" version))
+       (patches
+        (search-patches "llvm-3.6-fix-build-with-gcc-10.patch"))
        (sha256
         (base32
          "153vcvj8gvgwakzr4j0kndc0b7wn91c2g1vy2vg24s6spxcc23gn"))))))
diff --git a/gnu/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch b/gnu/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch
new file mode 100644
index 0000000000..4982587d15
--- /dev/null
+++ b/gnu/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch
@@ -0,0 +1,13 @@
+Adapted from https://github.com/digego/extempore/pull/322/files
+
+--- a/include/llvm/IR/ValueMap.h	2015-08-04 00:30:24.000000000 +0200
++++ b/include/llvm/IR/ValueMap.h	2018-07-14 21:09:09.769502736 +0200
+@@ -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);