sys-devel/clang: Backport gcc-9 build fix to 9.0.0*
authorMichał Górny <mgorny@gentoo.org>
Fri, 20 Sep 2019 06:11:16 +0000 (08:11 +0200)
committerMichał Górny <mgorny@gentoo.org>
Fri, 20 Sep 2019 07:34:42 +0000 (09:34 +0200)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
sys-devel/clang/clang-9.0.0.9999.ebuild
sys-devel/clang/files/9.0.0/0002-Initialize-all-fields-in-ABIArgInfo.patch [new file with mode: 0644]

index 2322c11594043d9b4ad99b551e134ddeea125625..16f86d8d2b9ea33679db341e028858c7b76d8240 100644 (file)
@@ -68,6 +68,9 @@ PATCHES=(
        # fix linking in non-native build (without tools-extra)
        # https://bugs.llvm.org/show_bug.cgi?id=43281
        "${FILESDIR}"/9.0.0/0001-clang-unittest-Import-LLVMTestingSupport-if-necessar.patch
+       # fix build with gcc-9.0.0
+       # https://bugs.llvm.org/show_bug.cgi?id=40547
+       "${FILESDIR}"/9.0.0/0002-Initialize-all-fields-in-ABIArgInfo.patch
 )
 
 # Multilib notes:
diff --git a/sys-devel/clang/files/9.0.0/0002-Initialize-all-fields-in-ABIArgInfo.patch b/sys-devel/clang/files/9.0.0/0002-Initialize-all-fields-in-ABIArgInfo.patch
new file mode 100644 (file)
index 0000000..cc397f7
--- /dev/null
@@ -0,0 +1,43 @@
+From 3398b3f937dd025c81d75a7322a6b7b2205ca8da Mon Sep 17 00:00:00 2001
+From: Serge Guelton <sguelton@redhat.com>
+Date: Thu, 19 Sep 2019 00:54:40 +0000
+Subject: [PATCH] Initialize all fields in ABIArgInfo.
+
+Due to usage of an uninitialized fields, we end up with
+a Conditional jump or move depends on uninitialised value
+
+Fixes https://bugs.llvm.org/show_bug.cgi?id=40547
+
+Commited on behalf of Martin Liska <mliska@suse.cz>
+
+llvm-svn: 372281
+---
+ clang/include/clang/CodeGen/CGFunctionInfo.h | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/clang/include/clang/CodeGen/CGFunctionInfo.h b/clang/include/clang/CodeGen/CGFunctionInfo.h
+index 1f81072e23d..5069d9af42a 100644
+--- a/include/clang/CodeGen/CGFunctionInfo.h
++++ b/include/clang/CodeGen/CGFunctionInfo.h
+@@ -109,14 +109,12 @@ private:
+     UnpaddedCoerceAndExpandType = T;
+   }
+-  ABIArgInfo(Kind K)
+-      : TheKind(K), PaddingInReg(false), InReg(false) {
+-  }
+-
+ public:
+-  ABIArgInfo()
++  ABIArgInfo(Kind K = Direct)
+       : TypeData(nullptr), PaddingType(nullptr), DirectOffset(0),
+-        TheKind(Direct), PaddingInReg(false), InReg(false) {}
++        TheKind(K), PaddingInReg(false), InAllocaSRet(false),
++        IndirectByVal(false), IndirectRealign(false), SRetAfterThis(false),
++        InReg(false), CanBeFlattened(false), SignExt(false) {}
+   static ABIArgInfo getDirect(llvm::Type *T = nullptr, unsigned Offset = 0,
+                               llvm::Type *Padding = nullptr,
+-- 
+2.23.0
+