-
Notifications
You must be signed in to change notification settings - Fork 727
build: fix LLVM 18 build on GCC 15 #4656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
XeniaLu
wants to merge
1
commit into
bytecodealliance:main
Choose a base branch
from
rustica-lang:build-llvm-on-gcc-15
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
build-scripts/llvm-patches/0001_Add_cstdint_to_SmallVector_101761.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
From aa01bd3a71399edb05fa9b0ab8e0bd35585aa1c5 Mon Sep 17 00:00:00 2001 | ||
From: Sam James <[email protected]> | ||
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 | ||
|
32 changes: 32 additions & 0 deletions
32
build-scripts/llvm-patches/0002_Add_missing_include_to_X86MCTargetDesc.h_123320.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From 3ba14e5ea319e138f8d0f5c06fd2f76d425e4093 Mon Sep 17 00:00:00 2001 | ||
From: Stephan Hageboeck <[email protected]> | ||
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 | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i suspect this should be target dependent.
while we are currently using the similar version (llvm-18) for all targets, it has not always been the case.
and it will unlikely be the case in future.
cf. #4654