summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@siemens.com>2025-09-19 15:50:07 +0200
committerSteve Sakoman <steve@sakoman.com>2025-09-30 08:01:59 -0700
commitf19d608f5822eb7d76a15315b801651445ce2926 (patch)
tree55f1b7062ca8a8376a7e1772aee37911d7e56c02
parent8cb12165ed8a92167e76369d61379b9ecd19fcdc (diff)
downloadpoky-f19d608f5822eb7d76a15315b801651445ce2926.tar.gz
llvm: fix build with gcc-15
Pick 3 patches from meta-clang's scartsgap branch to fix build with gcc-15. These patches are already in upstream llvm but not in 18.1.8 release. Note: the patch 0039-Fix-build-with-GCC-15.patch from meta-clang is not needed as it targets lldb which we do not build. (From OE-Core rev: a2c5e1d6ec6c905bbf31f017a010b0496b39b211) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-devtools/llvm/llvm/0036-Add-cstdint-to-SmallVector-101761.patch28
-rw-r--r--meta/recipes-devtools/llvm/llvm/0037-Include-cstdint-in-AMDGPUMCTargetDesc-101766.patch23
-rw-r--r--meta/recipes-devtools/llvm/llvm/0038-Add-missing-include-to-X86MCTargetDesc.h-123320.patch32
-rw-r--r--meta/recipes-devtools/llvm/llvm_18.1.8.bb3
4 files changed, 86 insertions, 0 deletions
diff --git a/meta/recipes-devtools/llvm/llvm/0036-Add-cstdint-to-SmallVector-101761.patch b/meta/recipes-devtools/llvm/llvm/0036-Add-cstdint-to-SmallVector-101761.patch
new file mode 100644
index 0000000000..cf00eacbee
--- /dev/null
+++ b/meta/recipes-devtools/llvm/llvm/0036-Add-cstdint-to-SmallVector-101761.patch
@@ -0,0 +1,28 @@
1From 9c9071480edd4093b28a9e9a9980c2426d27344c Mon Sep 17 00:00:00 2001
2From: Sam James <sam@gentoo.org>
3Date: Fri, 2 Aug 2024 23:07:21 +0100
4Subject: [PATCH] Add `<cstdint>` to SmallVector (#101761)
5
6SmallVector uses `uint32_t`, `uint64_t` without including `<cstdint>`
7which fails to build w/ GCC 15 after a change in libstdc++ [0]
8
9[0] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3a817a4a5a6d94da9127af3be9f84a74e3076ee2
10
11Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/7e44305041d96b064c197216b931ae3917a34ac1]
12Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
13---
14 llvm/include/llvm/ADT/SmallVector.h | 1 +
15 1 file changed, 1 insertion(+)
16
17diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
18index 09676d792..17444147b 100644
19--- a/llvm/include/llvm/ADT/SmallVector.h
20+++ b/llvm/include/llvm/ADT/SmallVector.h
21@@ -19,6 +19,7 @@
22 #include <algorithm>
23 #include <cassert>
24 #include <cstddef>
25+#include <cstdint>
26 #include <cstdlib>
27 #include <cstring>
28 #include <functional>
diff --git a/meta/recipes-devtools/llvm/llvm/0037-Include-cstdint-in-AMDGPUMCTargetDesc-101766.patch b/meta/recipes-devtools/llvm/llvm/0037-Include-cstdint-in-AMDGPUMCTargetDesc-101766.patch
new file mode 100644
index 0000000000..24e7e1234f
--- /dev/null
+++ b/meta/recipes-devtools/llvm/llvm/0037-Include-cstdint-in-AMDGPUMCTargetDesc-101766.patch
@@ -0,0 +1,23 @@
1From 422390b31680305ce6babcfbf65579b7dbe090a5 Mon Sep 17 00:00:00 2001
2From: Sam James <sam@gentoo.org>
3Date: Sat, 3 Aug 2024 06:36:43 +0100
4Subject: [PATCH] Include `<cstdint>` in AMDGPUMCTargetDesc (#101766)
5
6Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/8f39502b85d34998752193e85f36c408d3c99248]
7Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
8---
9 llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h | 1 +
10 1 file changed, 1 insertion(+)
11
12diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
13index 3ef00f757..879dbe1b2 100644
14--- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
15+++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
16@@ -15,6 +15,7 @@
17 #ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCTARGETDESC_H
18 #define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCTARGETDESC_H
19
20+#include <cstdint>
21 #include <memory>
22
23 namespace llvm {
diff --git a/meta/recipes-devtools/llvm/llvm/0038-Add-missing-include-to-X86MCTargetDesc.h-123320.patch b/meta/recipes-devtools/llvm/llvm/0038-Add-missing-include-to-X86MCTargetDesc.h-123320.patch
new file mode 100644
index 0000000000..9bfbe9e2ed
--- /dev/null
+++ b/meta/recipes-devtools/llvm/llvm/0038-Add-missing-include-to-X86MCTargetDesc.h-123320.patch
@@ -0,0 +1,32 @@
1From 72dc74c42eb9d9940b36c6804a4e4ac757370324 Mon Sep 17 00:00:00 2001
2From: Stephan Hageboeck <stephan.hageboeck@cern.ch>
3Date: Mon, 20 Jan 2025 17:52:47 +0100
4Subject: [PATCH] Add missing include to X86MCTargetDesc.h (#123320)
5
6In gcc-15, explicit includes of `<cstdint>` are required when fixed-size
7integers are used. In this file, this include only happened as a side
8effect of including SmallVector.h
9
10Although llvm compiles fine, the root-project would benefit from
11explicitly including it here, so we can backport the patch.
12
13Maybe interesting for @hahnjo and @vgvassilev
14
15Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/7abf44069aec61eee147ca67a6333fc34583b524]
16Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
17---
18 llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h | 1 +
19 1 file changed, 1 insertion(+)
20
21diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h b/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
22index 437a7bd6f..fd7d79484 100644
23--- a/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
24+++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
25@@ -13,6 +13,7 @@
26 #ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
27 #define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
28
29+#include <cstdint>
30 #include <memory>
31 #include <string>
32
diff --git a/meta/recipes-devtools/llvm/llvm_18.1.8.bb b/meta/recipes-devtools/llvm/llvm_18.1.8.bb
index 1f4b7e74d7..615c9f9e59 100644
--- a/meta/recipes-devtools/llvm/llvm_18.1.8.bb
+++ b/meta/recipes-devtools/llvm/llvm_18.1.8.bb
@@ -26,6 +26,9 @@ SRC_URI = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${PV}/
26 file://0007-llvm-allow-env-override-of-exe-path.patch;striplevel=2 \ 26 file://0007-llvm-allow-env-override-of-exe-path.patch;striplevel=2 \
27 file://0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch;striplevel=2 \ 27 file://0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch;striplevel=2 \
28 file://0002-llvm-Fix-CVE-2024-0151.patch;striplevel=2 \ 28 file://0002-llvm-Fix-CVE-2024-0151.patch;striplevel=2 \
29 file://0036-Add-cstdint-to-SmallVector-101761.patch;striplevel=2 \
30 file://0037-Include-cstdint-in-AMDGPUMCTargetDesc-101766.patch;striplevel=2 \
31 file://0038-Add-missing-include-to-X86MCTargetDesc.h-123320.patch;striplevel=2 \
29 file://llvm-config \ 32 file://llvm-config \
30 " 33 "
31SRC_URI[sha256sum] = "0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a" 34SRC_URI[sha256sum] = "0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a"