-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0090-esp-riscv-Add-multilib-support-for-riscv32-esp-elf.patch
51 lines (46 loc) · 1.88 KB
/
0090-esp-riscv-Add-multilib-support-for-riscv32-esp-elf.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 0b0e723880cc61d62a67ff6f4ead43a3236b881d Mon Sep 17 00:00:00 2001
From: Andrei Safronov <[email protected]>
Date: Wed, 5 Apr 2023 00:59:23 +0300
Subject: [PATCH 090/158] esp/riscv: Add multilib support for 'riscv32-esp-elf'
GCC toolcahin
---
clang/lib/Driver/ToolChains/Gnu.cpp | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 708975524d80..4392bb31e147 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -1694,6 +1694,7 @@ static void findRISCVBareMetalMultilibs(const Driver &D,
// TODO: support MULTILIB_REUSE
constexpr RiscvMultilib RISCVMultilibSet[] = {
{"rv32i", "ilp32"}, {"rv32im", "ilp32"}, {"rv32iac", "ilp32"},
+ {"rv32imc", "ilp32"},
{"rv32imac", "ilp32"}, {"rv32imafc", "ilp32f"}, {"rv64imac", "lp64"},
{"rv64imafdc", "lp64d"}};
@@ -1712,14 +1713,23 @@ static void findRISCVBareMetalMultilibs(const Driver &D,
MultilibSet RISCVMultilibs =
MultilibSet()
.Either(ArrayRef<Multilib>(Ms))
- .FilterOut(NonExistent)
+ .FilterOut(NonExistent);
+ if (TargetTriple.getVendor() == llvm::Triple::Espressif) {
+ RISCVMultilibs
+ .setFilePathsCallback([](const Multilib &M) {
+ return std::vector<std::string>(
+ {M.gccSuffix(),
+ "/../../../../riscv32-esp-elf/lib" + M.gccSuffix()});
+ });
+ } else {
+ RISCVMultilibs
.setFilePathsCallback([](const Multilib &M) {
return std::vector<std::string>(
{M.gccSuffix(),
"/../../../../riscv64-unknown-elf/lib" + M.gccSuffix(),
"/../../../../riscv32-unknown-elf/lib" + M.gccSuffix()});
});
-
+ }
Multilib::flags_list Flags;
llvm::StringSet<> Added_ABIs;
--
2.40.1