summaryrefslogtreecommitdiff
path: root/util/crossgcc
diff options
context:
space:
mode:
Diffstat (limited to 'util/crossgcc')
-rw-r--r--util/crossgcc/patches/clang-18.1.8.src_x86_baremetal.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/util/crossgcc/patches/clang-18.1.8.src_x86_baremetal.patch b/util/crossgcc/patches/clang-18.1.8.src_x86_baremetal.patch
new file mode 100644
index 0000000000..61c608cbbe
--- /dev/null
+++ b/util/crossgcc/patches/clang-18.1.8.src_x86_baremetal.patch
@@ -0,0 +1,29 @@
+diff --git a/lib/Driver/ToolChains/BareMetal.cpp b/lib/Driver/ToolChains/BareMetal.cpp
+index 852e0442..eb84a785 100644
+--- a/lib/Driver/ToolChains/BareMetal.cpp
++++ b/lib/Driver/ToolChains/BareMetal.cpp
+@@ -169,6 +169,12 @@ static bool isPPCBareMetal(const llvm::Triple &Triple) {
+ Triple.getEnvironment() == llvm::Triple::EABI;
+ }
+
++/// Is the triple x86_32 or x86_64 -*-none-elf?
++static bool isX86BareMetal(const llvm::Triple &Triple) {
++ return Triple.isX86() && Triple.getOS() == llvm::Triple::UnknownOS &&
++ Triple.getEnvironmentName() == "elf";
++}
++
+ static void findMultilibsFromYAML(const ToolChain &TC, const Driver &D,
+ StringRef MultilibPath, const ArgList &Args,
+ DetectedMultilibs &Result) {
+@@ -234,9 +240,10 @@ void BareMetal::findMultilibs(const Driver &D, const llvm::Triple &Triple,
+
+ bool BareMetal::handlesTarget(const llvm::Triple &Triple) {
+ return isARMBareMetal(Triple) || isAArch64BareMetal(Triple) ||
+- isRISCVBareMetal(Triple) || isPPCBareMetal(Triple);
++ isRISCVBareMetal(Triple) || isPPCBareMetal(Triple) || isX86BareMetal(Triple);
+ }
+
++
+ Tool *BareMetal::buildLinker() const {
+ return new tools::baremetal::Linker(*this);
+ }