Skip to contentSkip to conversation

package/llvm-project: fix build with gcc 15

PATCH Applied James Hilliard 3 participants 3 messages May 17, 2025 – Jun 4, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/llvm-project: fix build with gcc 15

Adapt gentoo gcc patches from https://bugs.gentoo.org/939498 to fix build with gcc 15.

The llvm project no longer maintains the llvm 15 branch.

---
 .../compiler-rt/0001-include-cstdint.patch    | 31 ++++++++++++++++
 ...DT-Add-cstdint-to-SmallVector-101761.patch | 35 +++++++++++++++++++
 ...cstdint-in-AMDGPUMCTargetDesc-101766.patch | 31 ++++++++++++++++
 ...03-Another-gcc-15-fix-from-Sam-James.patch | 31 ++++++++++++++++
 4 files changed, 128 insertions(+)
 create mode 100644 package/llvm-project/compiler-rt/0001-include-cstdint.patch
 create mode 100644 package/llvm-project/llvm/0001-ADT-Add-cstdint-to-SmallVector-101761.patch
 create mode 100644 package/llvm-project/llvm/0002-AMDGPU-Include-cstdint-in-AMDGPUMCTargetDesc-101766.patch
 create mode 100644 package/llvm-project/llvm/0003-Another-gcc-15-fix-from-Sam-James.patch
package/llvm-project/compiler-rt/0001-include-cstdint.patch new file +31 -0
new file mode 100644
index 0000000000..ce75b29f4e
@@ -0,0 +1,31 @@
+From 735207ac16bb15d88116bf00283eb0135ed2585a Mon Sep 17 00:00:00 2001
+From: Paul Zander <[email protected]>
+Date: Thu, 22 Aug 2024 11:40:13 +0200
+Subject: [PATCH] include cstdint
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Gentoo-Component: compiler-rt
+Signed-off-by: Paul Zander <[email protected]>
+Signed-off-by: Michał Górny <[email protected]>
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: https://bugs.gentoo.org/939498
+---
+ lib/orc/error.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/orc/error.h b/lib/orc/error.h
+index 92ac5a884ac6..33a599f71149 100644
+--- a/lib/orc/error.h
++++ b/lib/orc/error.h
+@@ -14,6 +14,7 @@
+ #include "stl_extras.h"
+ 
+ #include <cassert>
++#include <cstdint>
+ #include <memory>
+ #include <string>
+ #include <type_traits>
+-- 
+2.46.0
package/llvm-project/llvm/0001-ADT-Add-cstdint-to-SmallVector-101761.patch new file +35 -0
new file mode 100644
index 0000000000..eea83c27a8
@@ -0,0 +1,35 @@
+From 51d88407c1ae86c3b3c7b497d049f8980f2a3510 Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Fri, 2 Aug 2024 23:07:21 +0100
+Subject: [PATCH] [ADT] Add `<cstdint>` to SmallVector (#101761)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+SmallVector uses `uint32_t`, `uint64_t` without including `<cstdint>`
+which fails to build w/ GCC 15 after a change in libstdc++ [0]
+
+[0] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3a817a4a5a6d94da9127af3be9f84a74e3076ee2
+
+Gentoo-Component: llvm
+Signed-off-by: Michał Górny <[email protected]>
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: https://bugs.gentoo.org/939498
+---
+ include/llvm/ADT/SmallVector.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h
+index e34702bdbb3c..1c0f3465b2a9 100644
+--- a/include/llvm/ADT/SmallVector.h
++++ b/include/llvm/ADT/SmallVector.h
+@@ -19,6 +19,7 @@
+ #include <algorithm>
+ #include <cassert>
+ #include <cstddef>
++#include <cstdint>
+ #include <cstdlib>
+ #include <cstring>
+ #include <functional>
+-- 
+2.46.0
package/llvm-project/llvm/0002-AMDGPU-Include-cstdint-in-AMDGPUMCTargetDesc-101766.patch new file +31 -0
new file mode 100644
index 0000000000..73beab6c23
@@ -0,0 +1,31 @@
+From 000f92beb459096534a7bfaa8c5e99d77b7594c1 Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Sat, 3 Aug 2024 06:36:43 +0100
+Subject: [PATCH] [AMDGPU] Include `<cstdint>` in AMDGPUMCTargetDesc
+ (#101766)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Gentoo-Component: llvm
+Signed-off-by: Michał Górny <[email protected]>
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: https://bugs.gentoo.org/939498
+---
+ lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h b/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
+index c2e2563c3989..53aac8934100 100644
+--- a/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
++++ b/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
+@@ -15,6 +15,7 @@
+ #ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCTARGETDESC_H
+ #define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCTARGETDESC_H
+ 
++#include <cstdint>
+ #include <memory>
+ 
+ namespace llvm {
+-- 
+2.46.0
package/llvm-project/llvm/0003-Another-gcc-15-fix-from-Sam-James.patch new file +31 -0
new file mode 100644
index 0000000000..bc958bb056
@@ -0,0 +1,31 @@
+From 67fc0069c285b37f09d408aae43c37b8afdf11f7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]>
+Date: Sat, 3 Aug 2024 12:01:20 +0200
+Subject: [PATCH] Another gcc-15 fix from Sam James
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Bug: https://bugs.gentoo.org/937164
+Gentoo-Component: llvm
+Signed-off-by: Michał Górny <[email protected]>
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: https://bugs.gentoo.org/939498
+---
+ lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h b/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
+index d0530bd4d650..10b59462aebe 100644
+--- a/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
++++ b/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
+@@ -13,6 +13,7 @@
+ #ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
+ #define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
+ 
++#include <cstdint>
+ #include <memory>
+ #include <string>
+ 
+-- 
+2.46.0
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 6 lines · James Hilliard

Adapt gentoo gcc patches from https://bugs.gentoo.org/939498 to fix build with gcc 15.

The llvm project no longer maintains the llvm 15 branch.

Until we review and get llvm 20 bump patches merged, I applied this patch.

Best regards,

Julien.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
In reply to James Hilliard
Quoted 6 lines · James Hilliard

Adapt gentoo gcc patches from https://bugs.gentoo.org/939498 to fix build with gcc 15.

The llvm project no longer maintains the llvm 15 branch.

Applied to 2025.02.x, thanks.

Good that this patch around even if we're going to upgrade to LLVM 20 :-)

Regards,
Arnout

Quoted 153 lines
---
  .../compiler-rt/0001-include-cstdint.patch    | 31 ++++++++++++++++
  ...DT-Add-cstdint-to-SmallVector-101761.patch | 35 +++++++++++++++++++
  ...cstdint-in-AMDGPUMCTargetDesc-101766.patch | 31 ++++++++++++++++
  ...03-Another-gcc-15-fix-from-Sam-James.patch | 31 ++++++++++++++++
  4 files changed, 128 insertions(+)

create mode 100644 package/llvm-project/compiler-rt/0001-include-cstdint.patch
create mode 100644 package/llvm-project/llvm/0001-ADT-Add-cstdint-to-SmallVector-101761.patch create mode 100644 package/llvm-project/llvm/0002-AMDGPU-Include-cstdint-in-AMDGPUMCTargetDesc-101766.patch create mode 100644 package/llvm-project/llvm/0003-Another-gcc-15-fix-from-Sam-James.patch

package/llvm-project/compiler-rt/0001-include-cstdint.patch new file +31 -0
new file mode 100644
index 0000000000..ce75b29f4e
@@ -0,0 +1,31 @@
+From 735207ac16bb15d88116bf00283eb0135ed2585a Mon Sep 17 00:00:00 2001
+From: Paul Zander <[email protected]>
+Date: Thu, 22 Aug 2024 11:40:13 +0200
+Subject: [PATCH] include cstdint
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Gentoo-Component: compiler-rt
+Signed-off-by: Paul Zander <[email protected]>
+Signed-off-by: Michał Górny <[email protected]>
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: https://bugs.gentoo.org/939498
+---
+ lib/orc/error.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/orc/error.h b/lib/orc/error.h
+index 92ac5a884ac6..33a599f71149 100644
+--- a/lib/orc/error.h
++++ b/lib/orc/error.h
+@@ -14,6 +14,7 @@
+ #include "stl_extras.h"
+
+ #include <cassert>
++#include <cstdint>
+ #include <memory>
+ #include <string>
+ #include <type_traits>
+--
+2.46.0
package/llvm-project/llvm/0001-ADT-Add-cstdint-to-SmallVector-101761.patch new file +35 -0
new file mode 100644
index 0000000000..eea83c27a8
@@ -0,0 +1,35 @@
+From 51d88407c1ae86c3b3c7b497d049f8980f2a3510 Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Fri, 2 Aug 2024 23:07:21 +0100
+Subject: [PATCH] [ADT] Add `<cstdint>` to SmallVector (#101761)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+SmallVector uses `uint32_t`, `uint64_t` without including `<cstdint>`
+which fails to build w/ GCC 15 after a change in libstdc++ [0]
+
+[0] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3a817a4a5a6d94da9127af3be9f84a74e3076ee2
+
+Gentoo-Component: llvm
+Signed-off-by: Michał Górny <[email protected]>
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: https://bugs.gentoo.org/939498
+---
+ include/llvm/ADT/SmallVector.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h
+index e34702bdbb3c..1c0f3465b2a9 100644
+--- a/include/llvm/ADT/SmallVector.h
++++ b/include/llvm/ADT/SmallVector.h
+@@ -19,6 +19,7 @@
+ #include <algorithm>
+ #include <cassert>
+ #include <cstddef>
++#include <cstdint>
+ #include <cstdlib>
+ #include <cstring>
+ #include <functional>
+--
+2.46.0
package/llvm-project/llvm/0002-AMDGPU-Include-cstdint-in-AMDGPUMCTargetDesc-101766.patch new file +31 -0
new file mode 100644
index 0000000000..73beab6c23
@@ -0,0 +1,31 @@
+From 000f92beb459096534a7bfaa8c5e99d77b7594c1 Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Sat, 3 Aug 2024 06:36:43 +0100
+Subject: [PATCH] [AMDGPU] Include `<cstdint>` in AMDGPUMCTargetDesc
+ (#101766)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Gentoo-Component: llvm
+Signed-off-by: Michał Górny <[email protected]>
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: https://bugs.gentoo.org/939498
+---
+ lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h b/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
+index c2e2563c3989..53aac8934100 100644
+--- a/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
++++ b/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
+@@ -15,6 +15,7 @@
+ #ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCTARGETDESC_H
+ #define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCTARGETDESC_H
+
++#include <cstdint>
+ #include <memory>
+
+ namespace llvm {
+--
+2.46.0
package/llvm-project/llvm/0003-Another-gcc-15-fix-from-Sam-James.patch new file +21 -0
new file mode 100644
index 0000000000..bc958bb056
@@ -0,0 +1,31 @@
+From 67fc0069c285b37f09d408aae43c37b8afdf11f7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]>
+Date: Sat, 3 Aug 2024 12:01:20 +0200
+Subject: [PATCH] Another gcc-15 fix from Sam James
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Bug: https://bugs.gentoo.org/937164
+Gentoo-Component: llvm
+Signed-off-by: Michał Górny <[email protected]>
+Signed-off-by: James Hilliard <[email protected]>
+Upstream: https://bugs.gentoo.org/939498
+---
+ lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h b/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
+index d0530bd4d650..10b59462aebe 100644
+--- a/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
++++ b/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h

package/llvm-project/llvm/0003-Another-gcc-15-fix-from-Sam-James.patch line 31

Quoted 10 lines
package/llvm-project/llvm/0003-Another-gcc-15-fix-from-Sam-James.patch new file +10 -0
+@@ -13,6 +13,7 @@
+ #ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
+ #define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
+
++#include <cstdint>
+ #include <memory>
+ #include <string>
+
+--
+2.46.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot