This commit is contained in:
Xenia Lu 2026-04-08 13:13:35 +02:00 committed by GitHub
commit d0db1dadc6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 67 additions and 1 deletions

View File

@ -23,9 +23,15 @@ def clone_llvm(dst_dir, llvm_repo, llvm_branch):
if not llvm_dir.exists():
GIT_CLONE_CMD = f"git clone --depth 1 --branch {llvm_branch} {llvm_repo} llvm"
print(GIT_CLONE_CMD)
print(f"cd {dst_dir} && {GIT_CLONE_CMD}")
subprocess.check_output(shlex.split(GIT_CLONE_CMD), cwd=dst_dir)
patch_dir = pathlib.Path(__file__).parent.joinpath("llvm-patches").resolve()
for patch_file in patch_dir.glob("*.patch"):
cmd = f"git apply {patch_file}"
print(f"cd {llvm_dir} && {cmd}")
subprocess.check_output(shlex.split(cmd), cwd=llvm_dir)
return llvm_dir

View File

@ -0,0 +1,28 @@
From aa01bd3a71399edb05fa9b0ab8e0bd35585aa1c5 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Fri, 2 Aug 2024 23:07:21 +0100
Subject: [PATCH 1/2] Add `<cstdint>` to SmallVector (#101761)
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
---
llvm/include/llvm/ADT/SmallVector.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
index e34702bdb..1c0f3465b 100644
--- a/llvm/include/llvm/ADT/SmallVector.h
+++ b/llvm/include/llvm/ADT/SmallVector.h
@@ -19,6 +19,7 @@
#include <algorithm>
#include <cassert>
#include <cstddef>
+#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <functional>
--
2.51.0

View File

@ -0,0 +1,32 @@
From 3ba14e5ea319e138f8d0f5c06fd2f76d425e4093 Mon Sep 17 00:00:00 2001
From: Stephan Hageboeck <stephan.hageboeck@cern.ch>
Date: Mon, 20 Jan 2025 17:52:47 +0100
Subject: [PATCH 2/2] Add missing include to X86MCTargetDesc.h (#123320)
In gcc-15, explicit includes of `<cstdint>` are required when fixed-size
integers are used. In this file, this include only happened as a side
effect of including SmallVector.h
Although llvm compiles fine, the root-project would benefit from
explicitly including it here, so we can backport the patch.
Maybe interesting for @hahnjo and @vgvassilev
---
llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h b/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
index d0530bd4d..10b59462a 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
+++ b/llvm/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.51.0