-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0086-esp-Adds-support-for-vendor-Espressif-to-target.patch
216 lines (201 loc) · 17.7 KB
/
0086-esp-Adds-support-for-vendor-Espressif-to-target.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
diff -up llvm-project-16.0.3.src/clang/lib/Driver/ToolChains/Gnu.cpp.119~ llvm-project-16.0.3.src/clang/lib/Driver/ToolChains/Gnu.cpp
--- llvm-project-16.0.3.src/clang/lib/Driver/ToolChains/Gnu.cpp.119~ 2023-05-04 18:30:19.318103611 +0200
+++ llvm-project-16.0.3.src/clang/lib/Driver/ToolChains/Gnu.cpp 2023-05-04 18:30:19.353103891 +0200
@@ -2411,8 +2411,7 @@ void Generic_GCC::GCCInstallationDetecto
static const char *const XtensaLibDirs[] = {"/lib"};
static const char *const XtensaTriples[] = {
- "xtensa-unknown-elf", "xtensa-esp32-elf", "xtensa-esp32s2-elf",
- "xtensa-esp32s3-elf"};
+ "xtensa-esp-elf", "xtensa-esp-unknown-elf"};
using std::begin;
using std::end;
diff -up llvm-project-16.0.3.src/clang/lib/Driver/ToolChains/Xtensa.cpp.119~ llvm-project-16.0.3.src/clang/lib/Driver/ToolChains/Xtensa.cpp
--- llvm-project-16.0.3.src/clang/lib/Driver/ToolChains/Xtensa.cpp.119~ 2023-05-04 18:30:19.348103851 +0200
+++ llvm-project-16.0.3.src/clang/lib/Driver/ToolChains/Xtensa.cpp 2023-05-04 18:30:19.353103891 +0200
@@ -36,8 +36,20 @@ XtensaToolChain::XtensaToolChain(const D
const ArgList &Args)
: Generic_ELF(D, Triple, Args) {
- GCCInstallation.init(Triple, Args);
+ std::vector<std::string> ExtraAliases;
+ if (Triple.getVendor() == llvm::Triple::Espressif) {
+ std::string ESPCpuName = "esp32";
+ if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) {
+ ESPCpuName = A->getValue();
+ }
+ ExtraAliases = {std::string("xtensa-") + ESPCpuName + "-elf"};
+ if (Args.hasArg(options::OPT_v)) {
+ llvm::errs() << "Use GCC target extra alias: " << ExtraAliases[0] << "\n";
+ }
+ }
+
+ GCCInstallation.init(Triple, Args, ExtraAliases);
if (!GCCInstallation.isValid()) {
llvm_unreachable("Unexpected Xtensa GCC toolchain version");
}
diff -up llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/bin/xtensa-esp32s2-elf-ld.119~ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/bin/xtensa-esp32s2-elf-ld
--- llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/bin/xtensa-esp32s2-elf-ld.119~ 2023-05-04 18:30:19.353103891 +0200
+++ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/bin/xtensa-esp32s2-elf-ld 2023-05-04 18:30:19.353103891 +0200
@@ -0,0 +1 @@
+#!/bin/true
diff -up llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/bin/xtensa-esp32s3-elf-ld.119~ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/bin/xtensa-esp32s3-elf-ld
--- llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/bin/xtensa-esp32s3-elf-ld.119~ 2023-05-04 18:30:19.353103891 +0200
+++ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/bin/xtensa-esp32s3-elf-ld 2023-05-04 18:30:19.353103891 +0200
@@ -0,0 +1 @@
+#!/bin/true
diff -up llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s2-elf/8.4.0/crtbegin.o.119~ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s2-elf/8.4.0/crtbegin.o
diff -up llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s2-elf/8.4.0/crtend.o.119~ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s2-elf/8.4.0/crtend.o
diff -up llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s2-elf/8.4.0/no-rtti/crtbegin.o.119~ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s2-elf/8.4.0/no-rtti/crtbegin.o
diff -up llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s2-elf/8.4.0/no-rtti/crtend.o.119~ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s2-elf/8.4.0/no-rtti/crtend.o
diff -up llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s3-elf/8.4.0/crtbegin.o.119~ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s3-elf/8.4.0/crtbegin.o
diff -up llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s3-elf/8.4.0/crtend.o.119~ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s3-elf/8.4.0/crtend.o
diff -up llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s3-elf/8.4.0/no-rtti/crtbegin.o.119~ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s3-elf/8.4.0/no-rtti/crtbegin.o
diff -up llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s3-elf/8.4.0/no-rtti/crtend.o.119~ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s3-elf/8.4.0/no-rtti/crtend.o
diff -up llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/xtensa-esp32s2-elf/lib/crt0.o.119~ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/xtensa-esp32s2-elf/lib/crt0.o
diff -up llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/xtensa-esp32s2-elf/lib/no-rtti/crt0.o.119~ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/xtensa-esp32s2-elf/lib/no-rtti/crt0.o
diff -up llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/xtensa-esp32s3-elf/lib/crt0.o.119~ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/xtensa-esp32s3-elf/lib/crt0.o
diff -up llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/xtensa-esp32s3-elf/lib/no-rtti/crt0.o.119~ llvm-project-16.0.3.src/clang/test/Driver/Inputs/multilib_xtensa_tree/xtensa-esp32s3-elf/lib/no-rtti/crt0.o
diff -up llvm-project-16.0.3.src/clang/test/Driver/xtensa-toolchain.c.119~ llvm-project-16.0.3.src/clang/test/Driver/xtensa-toolchain.c
--- llvm-project-16.0.3.src/clang/test/Driver/xtensa-toolchain.c.119~ 2023-05-04 18:30:19.329103699 +0200
+++ llvm-project-16.0.3.src/clang/test/Driver/xtensa-toolchain.c 2023-05-04 18:30:19.354103899 +0200
@@ -1,42 +1,93 @@
// A basic clang -cc1 command-line, and simple environment check.
-// RUN: %clang %s -### -no-canonical-prefixes -target xtensa \
+// RUN: %clang %s -### -no-canonical-prefixes -target xtensa-esp-elf \
// RUN: --gcc-toolchain=%S/Inputs/multilib_xtensa_tree 2>&1 \
-// RUN: | FileCheck -check-prefix=CC1 %s
-// CC1: clang{{.*}} "-cc1" "-triple" "xtensa"
+// RUN: | FileCheck -check-prefix=CC1-ESP-DEFAULT %s
+// CC1-ESP-DEFAULT: clang{{.*}} "-cc1" "-triple" "xtensa-esp-unknown-elf"
-// RUN: %clang %s -### -no-canonical-prefixes \
-// RUN: -target xtensa --rtlib=platform \
+// RUN: %clang %s -### -no-canonical-prefixes -target xtensa-esp-elf -mcpu=esp32\
// RUN: --gcc-toolchain=%S/Inputs/multilib_xtensa_tree 2>&1 \
-// RUN: | FileCheck -check-prefix=C-XTENSA-BAREMETAL %s
+// RUN: | FileCheck -check-prefix=CC1-ESP32 %s
+// CC1-ESP32: clang{{.*}} "-cc1" "-triple" "xtensa-esp-unknown-elf" {{.*}}"-target-cpu" "esp32"
-// C-XTENSA-BAREMETAL: "{{.*}}Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}xtensa-esp32-elf-ld"
-// C-XTENSA-BAREMETAL: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}8.4.0/no-rtti"
-// C-XTENSA-BAREMETAL: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}lib/no-rtti"
+// RUN: %clang %s -### -no-canonical-prefixes -target xtensa-esp-elf -mcpu=esp32s2\
+// RUN: --gcc-toolchain=%S/Inputs/multilib_xtensa_tree 2>&1 \
+// RUN: | FileCheck -check-prefix=CC1-ESP32S2 %s
+// CC1-ESP32S2: clang{{.*}} "-cc1" "-triple" "xtensa-esp-unknown-elf" {{.*}}"-target-cpu" "esp32s2"
+
+// RUN: %clang %s -### -no-canonical-prefixes -target xtensa-esp-elf -mcpu=esp32s3\
+// RUN: --gcc-toolchain=%S/Inputs/multilib_xtensa_tree 2>&1 \
+// RUN: | FileCheck -check-prefix=CC1-ESP32S3 %s
+// CC1-ESP32S3: clang{{.*}} "-cc1" "-triple" "xtensa-esp-unknown-elf" {{.*}}"-target-cpu" "esp32s3"
+
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld= \
+// RUN: -target xtensa-esp-elf --rtlib=platform \
+// RUN: --gcc-toolchain=%S/Inputs/multilib_xtensa_tree 2>&1 \
+// RUN: | FileCheck -check-prefix=C-XTENSA-ESP32-BAREMETAL %s
-// RUN: %clang %s -### -no-canonical-prefixes \
-// RUN: -target xtensa --rtlib=platform \
+// C-XTENSA-ESP32-BAREMETAL: "{{.*}}Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}xtensa-esp32-elf-ld"
+// C-XTENSA-ESP32-BAREMETAL: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}8.4.0/no-rtti"
+// C-XTENSA-ESP32-BAREMETAL: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}lib/no-rtti"
+
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld= \
+// RUN: -target xtensa-esp-elf --rtlib=platform \
// RUN: --gcc-toolchain=%S/Inputs/multilib_xtensa_tree -frtti 2>&1 \
-// RUN: | FileCheck -check-prefix=C-XTENSA-BAREMETAL-RTTI %s
+// RUN: | FileCheck -check-prefix=C-XTENSA-ESP32-BAREMETAL-RTTI %s
-// C-XTENSA-BAREMETAL-RTTI: "{{.*}}Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}xtensa-esp32-elf-ld"
-// C-XTENSA-BAREMETAL-RTTI: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}8.4.0"
-// C-XTENSA-BAREMETAL-RTTI: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}lib"
+// C-XTENSA-ESP32-BAREMETAL-RTTI: "{{.*}}Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}xtensa-esp32-elf-ld"
+// C-XTENSA-ESP32-BAREMETAL-RTTI: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}8.4.0"
+// C-XTENSA-ESP32-BAREMETAL-RTTI: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}lib"
-// RUN: %clang %s -### -no-canonical-prefixes \
-// RUN: -target xtensa --rtlib=platform \
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld= \
+// RUN: -target xtensa-esp-elf --rtlib=platform \
// RUN: --gcc-toolchain=%S/Inputs/multilib_xtensa_tree -mfix-esp32-psram-cache-issue 2>&1 \
-// RUN: | FileCheck -check-prefix=C-XTENSA-BAREMETAL-PSRAM %s
+// RUN: | FileCheck -check-prefix=C-XTENSA-ESP32-BAREMETAL-PSRAM %s
-// C-XTENSA-BAREMETAL-PSRAM: "{{.*}}Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}xtensa-esp32-elf-ld"
-// C-XTENSA-BAREMETAL-PSRAM: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}8.4.0/esp32-psram/no-rtti"
-// C-XTENSA-BAREMETAL-PSRAM: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}lib/esp32-psram/no-rtti"
+// C-XTENSA-ESP32-BAREMETAL-PSRAM: "{{.*}}Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}xtensa-esp32-elf-ld"
+// C-XTENSA-ESP32-BAREMETAL-PSRAM: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}8.4.0/esp32-psram/no-rtti"
+// C-XTENSA-ESP32-BAREMETAL-PSRAM: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}lib/esp32-psram/no-rtti"
-// RUN: %clang %s -### -no-canonical-prefixes \
-// RUN: -target xtensa --rtlib=platform \
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld= \
+// RUN: -target xtensa-esp-elf --rtlib=platform \
// RUN: --gcc-toolchain=%S/Inputs/multilib_xtensa_tree -mfix-esp32-psram-cache-issue -frtti 2>&1 \
-// RUN: | FileCheck -check-prefix=C-XTENSA-BAREMETAL-PSRAM-RTTI %s
+// RUN: | FileCheck -check-prefix=C-XTENSA-ESP32-BAREMETAL-PSRAM-RTTI %s
+
+// C-XTENSA-ESP32-BAREMETAL-PSRAM-RTTI: "{{.*}}Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}xtensa-esp32-elf-ld"
+// C-XTENSA-ESP32-BAREMETAL-PSRAM-RTTI: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}8.4.0/esp32-psram"
+// C-XTENSA-ESP32-BAREMETAL-PSRAM-RTTI: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}lib/esp32-psram"
+
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld= \
+// RUN: -target xtensa-esp-elf -mcpu=esp32s2 --rtlib=platform \
+// RUN: --gcc-toolchain=%S/Inputs/multilib_xtensa_tree 2>&1 \
+// RUN: | FileCheck -check-prefix=C-XTENSA-ESP32S2-BAREMETAL %s
+
+// C-XTENSA-ESP32S2-BAREMETAL: "{{.*}}Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s2-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}xtensa-esp32s2-elf-ld"
+// C-XTENSA-ESP32S2-BAREMETAL: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s2-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}xtensa-esp32s2-elf{{/|\\\\}}8.4.0/no-rtti"
+// C-XTENSA-ESP32S2-BAREMETAL: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s2-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}xtensa-esp32s2-elf{{/|\\\\}}lib/no-rtti"
+
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld= \
+// RUN: -target xtensa-esp-elf -mcpu=esp32s2 --rtlib=platform \
+// RUN: --gcc-toolchain=%S/Inputs/multilib_xtensa_tree -frtti 2>&1 \
+// RUN: | FileCheck -check-prefix=C-XTENSA-ESP32S2-BAREMETAL-RTTI %s
+
+// C-XTENSA-ESP32S2-BAREMETAL-RTTI: "{{.*}}Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s2-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}xtensa-esp32s2-elf-ld"
+// C-XTENSA-ESP32S2-BAREMETAL-RTTI: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s2-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}xtensa-esp32s2-elf{{/|\\\\}}8.4.0"
+// C-XTENSA-ESP32S2-BAREMETAL-RTTI: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s2-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}xtensa-esp32s2-elf{{/|\\\\}}lib"
+
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld= \
+// RUN: -target xtensa-esp-elf -mcpu=esp32s3 --rtlib=platform \
+// RUN: --gcc-toolchain=%S/Inputs/multilib_xtensa_tree 2>&1 \
+// RUN: | FileCheck -check-prefix=C-XTENSA-ESP32S3-BAREMETAL %s
+
+// C-XTENSA-ESP32S3-BAREMETAL: "{{.*}}Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s3-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}xtensa-esp32s3-elf-ld"
+// C-XTENSA-ESP32S3-BAREMETAL: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s3-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}xtensa-esp32s3-elf{{/|\\\\}}8.4.0/no-rtti"
+// C-XTENSA-ESP32S3-BAREMETAL: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s3-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}xtensa-esp32s3-elf{{/|\\\\}}lib/no-rtti"
+
+// RUN: %clang %s -### -no-canonical-prefixes -fuse-ld= \
+// RUN: -target xtensa-esp-elf -mcpu=esp32s3 --rtlib=platform \
+// RUN: --gcc-toolchain=%S/Inputs/multilib_xtensa_tree -frtti 2>&1 \
+// RUN: | FileCheck -check-prefix=C-XTENSA-ESP32S3-BAREMETAL-RTTI %s
-// C-XTENSA-BAREMETAL-PSRAM-RTTI: "{{.*}}Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}xtensa-esp32-elf-ld"
-// C-XTENSA-BAREMETAL-PSRAM-RTTI: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}8.4.0/esp32-psram"
-// C-XTENSA-BAREMETAL-PSRAM-RTTI: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}xtensa-esp32-elf{{/|\\\\}}lib/esp32-psram"
+// C-XTENSA-ESP32S3-BAREMETAL-RTTI: "{{.*}}Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s3-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}bin{{/|\\\\}}xtensa-esp32s3-elf-ld"
+// C-XTENSA-ESP32S3-BAREMETAL-RTTI: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s3-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}gcc{{/|\\\\}}xtensa-esp32s3-elf{{/|\\\\}}8.4.0"
+// C-XTENSA-ESP32S3-BAREMETAL-RTTI: "-L{{.*}}/Inputs/multilib_xtensa_tree/lib/gcc/xtensa-esp32s3-elf/8.4.0/../../..{{/|\\\\}}..{{/|\\\\}}xtensa-esp32s3-elf{{/|\\\\}}lib"
diff -up llvm-project-16.0.3.src/llvm/include/llvm/TargetParser/Triple.h.119~ llvm-project-16.0.3.src/llvm/include/llvm/TargetParser/Triple.h
--- llvm-project-16.0.3.src/llvm/include/llvm/TargetParser/Triple.h.119~ 2023-05-04 18:30:19.354103899 +0200
+++ llvm-project-16.0.3.src/llvm/include/llvm/TargetParser/Triple.h 2023-05-04 18:31:19.087581986 +0200
@@ -181,7 +181,8 @@ public:
SUSE,
OpenEmbedded,
OpenMandriva,
- LastVendorType = OpenMandriva
+ Espressif,
+ LastVendorType = Espressif
};
enum OSType {
UnknownOS,
diff -up llvm-project-16.0.3.src/llvm/lib/TargetParser/Triple.cpp.119~ llvm-project-16.0.3.src/llvm/lib/TargetParser/Triple.cpp
--- llvm-project-16.0.3.src/llvm/lib/TargetParser/Triple.cpp.119~ 2023-05-04 18:30:18.712098763 +0200
+++ llvm-project-16.0.3.src/llvm/lib/TargetParser/Triple.cpp 2023-05-04 18:31:57.637890694 +0200
@@ -197,6 +197,7 @@ StringRef Triple::getVendorTypeName(Vend
case PC: return "pc";
case SCEI: return "scei";
case SUSE: return "suse";
+ case Espressif: return "esp";
}
llvm_unreachable("Invalid VendorType!");
@@ -554,6 +555,7 @@ static Triple::VendorType parseVendor(St
.Case("suse", Triple::SUSE)
.Case("oe", Triple::OpenEmbedded)
.Case("openmandriva", Triple::OpenMandriva)
+ .Case("esp", Triple::Espressif)
.Default(Triple::UnknownVendor);
}