1 // UNSUPPORTED: system-windows
2 // General tests that ld invocations on Linux targets sane. Note that we use
3 // sysroot to make these tests independent of the host system.
5 // RUN: %clang -### %s -no-pie 2>&1 \
6 // RUN: --target=i386-unknown-linux -rtlib=platform --unwindlib=platform \
7 // RUN: --gcc-toolchain="" \
8 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
9 // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
10 // CHECK-LD-32-NOT: warning:
11 // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
12 // CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/10.2.0{{/|\\\\}}crtbegin.o"
13 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0"
14 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0/../../../../i386-unknown-linux/lib"
15 // CHECK-LD-32: "-L[[SYSROOT]]/lib"
16 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib"
18 // RUN: %clang -### %s -no-pie 2>&1 \
19 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
20 // RUN: --gcc-toolchain="" \
21 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
22 // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s
23 // CHECK-LD-64-NOT: warning:
24 // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
25 // CHECK-LD-64: "--eh-frame-hdr"
26 // CHECK-LD-64: "-m" "elf_x86_64"
27 // CHECK-LD-64: "-dynamic-linker"
28 // CHECK-LD-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/10.2.0{{/|\\\\}}crtbegin.o"
29 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0"
30 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib"
31 // CHECK-LD-64: "-L[[SYSROOT]]/lib"
32 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib"
33 // CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
35 // CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
37 // RUN: %clang -### %s -no-pie 2>&1 \
38 // RUN: --target=x86_64-unknown-linux-gnux32 -rtlib=platform --unwindlib=platform \
39 // RUN: --gcc-toolchain="" \
40 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
41 // RUN: | FileCheck --check-prefix=CHECK-LD-X32 %s
42 // CHECK-LD-X32-NOT: warning:
43 // CHECK-LD-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
44 // CHECK-LD-X32: "--eh-frame-hdr"
45 // CHECK-LD-X32: "-m" "elf32_x86_64"
46 // CHECK-LD-X32: "-dynamic-linker"
47 // CHECK-LD-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
48 // CHECK-LD-X32: "-lc"
49 // CHECK-LD-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
51 // RUN: %clang -### %s -no-pie 2>&1 \
52 // RUN: --target=x86_64-unknown-linux \
53 // RUN: -resource-dir=%S/Inputs/resource_dir \
54 // RUN: --gcc-toolchain="" \
55 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
56 // RUN: --rtlib=compiler-rt \
57 // RUN: | FileCheck --check-prefix=CHECK-LD-RT %s
58 // CHECK-LD-RT-NOT: warning:
59 // CHECK-LD-RT: "-resource-dir" "[[RESDIR:[^"]*]]"
60 // CHECK-LD-RT: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
61 // CHECK-LD-RT: "--eh-frame-hdr"
62 // CHECK-LD-RT: "-m" "elf_x86_64"
63 // CHECK-LD-RT: "-dynamic-linker"
64 // CHECK-LD-RT: "[[RESDIR]]{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}clang_rt.crtbegin-x86_64.o"
65 // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0"
66 // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib"
67 // CHECK-LD-RT: "-L[[SYSROOT]]/lib"
68 // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib"
69 // CHECK-LD-RT: libclang_rt.builtins-x86_64.a"
71 // CHECK-LD-RT: libclang_rt.builtins-x86_64.a"
72 // CHECK-LD-RT: "[[RESDIR]]{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}clang_rt.crtend-x86_64.o"
74 // RUN: %clang -### %s -no-pie 2>&1 \
75 // RUN: --target=i686-unknown-linux \
76 // RUN: -resource-dir=%S/Inputs/resource_dir \
77 // RUN: --gcc-toolchain="" \
78 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
79 // RUN: --rtlib=compiler-rt \
80 // RUN: | FileCheck --check-prefix=CHECK-LD-RT-I686 %s
81 // CHECK-LD-RT-I686-NOT: warning:
82 // CHECK-LD-RT-I686: "-resource-dir" "[[RESDIR:[^"]*]]"
83 // CHECK-LD-RT-I686: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
84 // CHECK-LD-RT-I686: "--eh-frame-hdr"
85 // CHECK-LD-RT-I686: "-m" "elf_i386"
86 // CHECK-LD-RT-I686: "-dynamic-linker"
87 // CHECK-LD-RT-I686: "[[RESDIR]]{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}clang_rt.crtbegin-i386.o"
88 // CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/10.2.0"
89 // CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/10.2.0/../../../../i686-unknown-linux/lib"
90 // CHECK-LD-RT-I686: "-L[[SYSROOT]]/lib"
91 // CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib"
92 // CHECK-LD-RT-I686: libclang_rt.builtins-i386.a"
93 // CHECK-LD-RT-I686: "-lc"
94 // CHECK-LD-RT-I686: libclang_rt.builtins-i386.a"
95 // CHECK-LD-RT-I686: "[[RESDIR]]{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}clang_rt.crtend-i386.o"
97 // RUN: %clang -### %s -no-pie 2>&1 \
98 // RUN: --target=arm-linux-androideabi \
99 // RUN: --gcc-toolchain="" \
100 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
101 // RUN: --rtlib=compiler-rt \
102 // RUN: | FileCheck --check-prefix=CHECK-LD-RT-ANDROID %s
103 // CHECK-LD-RT-ANDROID-NOT: warning:
104 // CHECK-LD-RT-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
105 // CHECK-LD-RT-ANDROID: "--eh-frame-hdr"
106 // CHECK-LD-RT-ANDROID: "-m" "armelf_linux_eabi"
107 // CHECK-LD-RT-ANDROID: "-dynamic-linker"
108 // CHECK-LD-RT-ANDROID: libclang_rt.builtins-arm-android.a"
109 // CHECK-LD-RT-ANDROID: "-lc"
110 // CHECK-LD-RT-ANDROID: libclang_rt.builtins-arm-android.a"
112 // RUN: %clang -### %s -no-pie 2>&1 \
113 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
114 // RUN: --gcc-toolchain="" \
115 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
116 // RUN: | FileCheck --check-prefix=CHECK-LD-GCC %s
117 // CHECK-LD-GCC-NOT: warning:
118 // CHECK-LD-GCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
119 // CHECK-LD-GCC: "--eh-frame-hdr"
120 // CHECK-LD-GCC: "-m" "elf_x86_64"
121 // CHECK-LD-GCC: "-dynamic-linker"
122 // CHECK-LD-GCC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/10.2.0{{/|\\\\}}crtbegin.o"
123 // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0"
124 // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib"
125 // CHECK-LD-GCC: "-L[[SYSROOT]]/lib"
126 // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib"
127 // CHECK-LD-GCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
128 // CHECK-LD-GCC: "-lc"
129 // CHECK-LD-GCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
131 // RUN: %clang -### %s -no-pie 2>&1 \
132 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
133 // RUN: -static-libgcc \
134 // RUN: --gcc-toolchain="" \
135 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
136 // RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC-LIBGCC %s
137 // CHECK-LD-64-STATIC-LIBGCC-NOT: warning:
138 // CHECK-LD-64-STATIC-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
139 // CHECK-LD-64-STATIC-LIBGCC: "--eh-frame-hdr"
140 // CHECK-LD-64-STATIC-LIBGCC: "-m" "elf_x86_64"
141 // CHECK-LD-64-STATIC-LIBGCC: "-dynamic-linker"
142 // CHECK-LD-64-STATIC-LIBGCC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/10.2.0{{/|\\\\}}crtbegin.o"
143 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0"
144 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib"
145 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/lib"
146 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib"
147 // CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh"
148 // CHECK-LD-64-STATIC-LIBGCC: "-lc"
149 // CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh"
151 // RUN: %clang -### %s -no-pie 2>&1 \
152 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
153 // RUN: --gcc-toolchain="" \
154 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
155 // RUN: | FileCheck --check-prefix=CHECK-CLANG-NO-LIBGCC %s
156 // CHECK-CLANG-NO-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
157 // CHECK-CLANG-NO-LIBGCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
158 // CHECK-CLANG-NO-LIBGCC: "-lc"
159 // CHECK-CLANG-NO-LIBGCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
161 // RUN: %clangxx -### %s -no-pie 2>&1 \
162 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
163 // RUN: --gcc-toolchain="" \
164 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
165 // RUN: | FileCheck --check-prefix=CHECK-CLANGXX-NO-LIBGCC %s
166 // CHECK-CLANGXX-NO-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
167 // CHECK-CLANGXX-NO-LIBGCC: "-lgcc_s" "-lgcc"
168 // CHECK-CLANGXX-NO-LIBGCC: "-lc"
169 // CHECK-CLANGXX-NO-LIBGCC: "-lgcc_s" "-lgcc"
171 // RUN: %clang -static -### %s 2>&1 \
172 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
173 // RUN: --gcc-toolchain="" \
174 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
175 // RUN: | FileCheck --check-prefix=CHECK-CLANG-NO-LIBGCC-STATIC %s
176 // CHECK-CLANG-NO-LIBGCC-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
177 // CHECK-CLANG-NO-LIBGCC-STATIC: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group"
179 // RUN: %clang -static-pie -### %s 2>&1 \
180 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
181 // RUN: --gcc-toolchain="" \
182 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
183 // RUN: | FileCheck --check-prefix=CHECK-CLANG-LD-STATIC-PIE %s
184 // CHECK-CLANG-LD-STATIC-PIE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
185 // CHECK-CLANG-LD-STATIC-PIE: "-static"
186 // CHECK-CLANG-LD-STATIC-PIE: "-pie"
187 // CHECK-CLANG-LD-STATIC-PIE: "--no-dynamic-linker"
188 // CHECK-CLANG-LD-STATIC-PIE: "-z"
189 // CHECK-CLANG-LD-STATIC-PIE: "text"
190 // CHECK-CLANG-LD-STATIC-PIE: "-m" "elf_x86_64"
191 // CHECK-CLANG-LD-STATIC-PIE: "{{.*}}rcrt1.o"
192 // CHECK-CLANG-LD-STATIC-PIE: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group"
194 // RUN: not %clang -static-pie -pie -### %s -no-pie 2>&1 \
195 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
196 // RUN: --gcc-toolchain="" \
197 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
198 // RUN: | FileCheck --check-prefix=CHECK-CLANG-LD-STATIC-PIE-PIE %s
199 // CHECK-CLANG-LD-STATIC-PIE-PIE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
200 // CHECK-CLANG-LD-STATIC-PIE-PIE: "-static"
201 // CHECK-CLANG-LD-STATIC-PIE-PIE: "-pie"
202 // CHECK-CLANG-LD-STATIC-PIE-PIE: "--no-dynamic-linker"
203 // CHECK-CLANG-LD-STATIC-PIE-PIE: "-z"
204 // CHECK-CLANG-LD-STATIC-PIE-PIE: "text"
205 // CHECK-CLANG-LD-STATIC-PIE-PIE: "-m" "elf_x86_64"
206 // CHECK-CLANG-LD-STATIC-PIE-PIE: "{{.*}}rcrt1.o"
207 // CHECK-CLANG-LD-STATIC-PIE-PIE: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group"
209 // RUN: not %clang -static-pie -static -### %s -no-pie 2>&1 \
210 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
211 // RUN: --gcc-toolchain="" \
212 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
213 // RUN: | FileCheck --check-prefix=CHECK-CLANG-LD-STATIC-PIE-STATIC %s
214 // CHECK-CLANG-LD-STATIC-PIE-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
215 // CHECK-CLANG-LD-STATIC-PIE-STATIC: "-static"
216 // CHECK-CLANG-LD-STATIC-PIE-STATIC: "-pie"
217 // CHECK-CLANG-LD-STATIC-PIE-STATIC: "--no-dynamic-linker"
218 // CHECK-CLANG-LD-STATIC-PIE-STATIC: "-z"
219 // CHECK-CLANG-LD-STATIC-PIE-STATIC: "text"
220 // CHECK-CLANG-LD-STATIC-PIE-STATIC: "-m" "elf_x86_64"
221 // CHECK-CLANG-LD-STATIC-PIE-STATIC: "{{.*}}rcrt1.o"
222 // CHECK-CLANG-LD-STATIC-PIE-STATIC: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group"
224 // RUN: not %clang -static-pie -nopie -### %s -no-pie 2>&1 \
225 // RUN: --target=x86_64-unknown-linux -rtlib=platform \
226 // RUN: --gcc-toolchain="" \
227 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
228 // RUN: | FileCheck --check-prefix=CHECK-CLANG-LD-STATIC-PIE-NOPIE %s
229 // CHECK-CLANG-LD-STATIC-PIE-NOPIE: error: cannot specify 'nopie' along with 'static-pie'
231 // RUN: %clang -dynamic -### %s -no-pie 2>&1 \
232 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
233 // RUN: --gcc-toolchain="" \
234 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
235 // RUN: | FileCheck --check-prefix=CHECK-CLANG-NO-LIBGCC-DYNAMIC %s
236 // CHECK-CLANG-NO-LIBGCC-DYNAMIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
237 // CHECK-CLANG-NO-LIBGCC-DYNAMIC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
238 // CHECK-CLANG-NO-LIBGCC-DYNAMIC: "-lc"
239 // CHECK-CLANG-NO-LIBGCC-DYNAMIC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
241 // RUN: %clang -static-libgcc -### %s -no-pie 2>&1 \
242 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
243 // RUN: --gcc-toolchain="" \
244 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
245 // RUN: | FileCheck --check-prefix=CHECK-CLANG-STATIC-LIBGCC %s
246 // CHECK-CLANG-STATIC-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
247 // CHECK-CLANG-STATIC-LIBGCC: "-lgcc" "-lgcc_eh"
248 // CHECK-CLANG-STATIC-LIBGCC: "-lc"
249 // CHECK-CLANG-STATIC-LIBGCC: "-lgcc" "-lgcc_eh"
251 // RUN: %clang -static-libgcc -dynamic -### %s -no-pie 2>&1 \
252 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
253 // RUN: --gcc-toolchain="" \
254 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
255 // RUN: | FileCheck --check-prefix=CHECK-CLANG-STATIC-LIBGCC-DYNAMIC %s
256 // CHECK-CLANG-STATIC-LIBGCC-DYNAMIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
257 // CHECK-CLANG-STATIC-LIBGCC-DYNAMIC: "-lgcc" "-lgcc_eh"
258 // CHECK-CLANG-STATIC-LIBGCC-DYNAMIC: "-lc"
259 // CHECK-CLANG-STATIC-LIBGCC-DYNAMIC: "-lgcc" "-lgcc_eh"
261 // RUN: %clang -shared-libgcc -### %s -no-pie 2>&1 \
262 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
263 // RUN: --gcc-toolchain="" \
264 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
265 // RUN: | FileCheck --check-prefix=CHECK-CLANG-SHARED-LIBGCC %s
266 // CHECK-CLANG-SHARED-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
267 // CHECK-CLANG-SHARED-LIBGCC: "-lgcc_s" "-lgcc"
268 // CHECK-CLANG-SHARED-LIBGCC: "-lc"
269 // CHECK-CLANG-SHARED-LIBGCC: "-lgcc_s" "-lgcc"
271 // RUN: %clang -shared-libgcc -dynamic -### %s -no-pie 2>&1 \
272 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
273 // RUN: --gcc-toolchain="" \
274 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
275 // RUN: | FileCheck --check-prefix=CHECK-CLANG-SHARED-LIBGCC-DYNAMIC %s
276 // CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lgcc_s" "-lgcc"
277 // CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lc"
278 // CHECK-CLANG-SHARED-LIBGCC-DYNAMIC: "-lgcc_s" "-lgcc"
280 // RUN: %clang -### %s -no-pie 2>&1 \
281 // RUN: --target=aarch64-linux-android -rtlib=platform --unwindlib=platform \
282 // RUN: --gcc-toolchain="" \
283 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
284 // RUN: | FileCheck --check-prefix=CHECK-CLANG-ANDROID-NONE %s
285 // CHECK-CLANG-ANDROID-NONE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
286 // CHECK-CLANG-ANDROID-NONE: "-l:libunwind.a" "-ldl" "-lc"
288 // RUN: %clang -shared -### %s -no-pie 2>&1 \
289 // RUN: --target=aarch64-linux-android -rtlib=platform --unwindlib=platform \
290 // RUN: --gcc-toolchain="" \
291 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
292 // RUN: | FileCheck --check-prefix=CHECK-CLANG-ANDROID-SHARED %s
293 // CHECK-CLANG-ANDROID-SHARED: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
294 // CHECK-CLANG-ANDROID-SHARED: "-l:libunwind.a" "-ldl" "-lc"
296 // RUN: %clang -static -### %s -no-pie 2>&1 \
297 // RUN: --target=aarch64-linux-android -rtlib=platform --unwindlib=platform \
298 // RUN: --gcc-toolchain="" \
299 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
300 // RUN: | FileCheck --check-prefix=CHECK-CLANG-ANDROID-STATIC %s
301 // CHECK-CLANG-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
302 // CHECK-CLANG-ANDROID-STATIC: "--start-group" "{{[^"]*}}{{/|\\\\}}libclang_rt.builtins-aarch64-android.a" "-l:libunwind.a" "-lc" "--end-group"
304 // RUN: %clang -### %s 2>&1 \
305 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
307 // RUN: --gcc-toolchain="" \
308 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
309 // RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s
310 // CHECK-LD-64-STATIC-NOT: warning:
311 // CHECK-LD-64-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
312 // CHECK-LD-64-STATIC: "--eh-frame-hdr"
313 // CHECK-LD-64-STATIC: "-m" "elf_x86_64"
314 // CHECK-LD-64-STATIC-NOT: "-dynamic-linker"
315 // CHECK-LD-64-STATIC: "-static"
316 // CHECK-LD-64-STATIC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/10.2.0{{/|\\\\}}crtbeginT.o"
317 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0"
318 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib"
319 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/lib"
320 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib"
321 // CHECK-LD-64-STATIC: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group"
323 // RUN: %clang -no-pie -### %s --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform -shared -static \
324 // RUN: --gcc-toolchain= --sysroot=%S/Inputs/basic_linux_tree 2>&1 | FileCheck --check-prefix=CHECK-LD-SHARED-STATIC %s
325 // CHECK-LD-SHARED-STATIC: "-shared" "-static"
326 // CHECK-LD-SHARED-STATIC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/10.2.0{{/|\\\\}}crtbeginS.o"
327 // CHECK-LD-SHARED-STATIC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/10.2.0{{/|\\\\}}crtendS.o"
329 // Check that flags can be combined. The -static dominates.
330 // RUN: %clang -### %s 2>&1 \
331 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform \
332 // RUN: -static-libgcc -static \
333 // RUN: --gcc-toolchain="" \
334 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
335 // RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s
337 // RUN: %clang -### %s -no-pie 2>&1 \
338 // RUN: --target=i386-unknown-linux -rtlib=platform --unwindlib=platform -m32 \
339 // RUN: --gcc-toolchain="" \
340 // RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \
341 // RUN: | FileCheck --check-prefix=CHECK-32-TO-32 %s
342 // CHECK-32-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
343 // CHECK-32-TO-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/10.2.0{{/|\\\\}}crtbegin.o"
344 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0"
345 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0/../../../../i386-unknown-linux/lib/../lib32"
346 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0/../../../../lib32"
347 // CHECK-32-TO-32: "-L[[SYSROOT]]/lib/../lib32"
348 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32"
349 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0/../../../../i386-unknown-linux/lib"
350 // CHECK-32-TO-32: "-L[[SYSROOT]]/lib"
351 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib"
353 // RUN: %clang -### %s -no-pie 2>&1 \
354 // RUN: --target=i386-unknown-linux -rtlib=platform --unwindlib=platform -m64 \
355 // RUN: --gcc-toolchain="" \
356 // RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \
357 // RUN: | FileCheck --check-prefix=CHECK-32-TO-64 %s
358 // CHECK-32-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
359 // CHECK-32-TO-64: "{{.*}}/usr/lib/gcc/i386-unknown-linux/10.2.0/64{{/|\\\\}}crtbegin.o"
360 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0/64"
361 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0/../../../../i386-unknown-linux/lib/../lib64"
362 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0/../../../../lib64"
363 // CHECK-32-TO-64: "-L[[SYSROOT]]/lib/../lib64"
364 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64"
365 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/10.2.0/../../../../i386-unknown-linux/lib"
366 // CHECK-32-TO-64: "-L[[SYSROOT]]/lib"
367 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib"
369 // RUN: %clang -### %s -no-pie 2>&1 \
370 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform -m64 \
371 // RUN: --gcc-toolchain="" \
372 // RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
373 // RUN: | FileCheck --check-prefix=CHECK-64-TO-64 %s
374 // CHECK-64-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
375 // CHECK-64-TO-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/10.2.0{{/|\\\\}}crtbegin.o"
376 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0"
377 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib/../lib64"
378 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../lib64"
379 // CHECK-64-TO-64: "-L[[SYSROOT]]/lib/../lib64"
380 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64"
381 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib"
382 // CHECK-64-TO-64: "-L[[SYSROOT]]/lib"
383 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib"
385 // RUN: not %clang -### %s -no-pie 2>&1 \
386 // RUN: --target=x86_64-unknown-linux -rtlib=plaform --unwindlib=platform -m32 \
387 // RUN: --gcc-toolchain="" \
388 // RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
389 // RUN: | FileCheck --check-prefix=CHECK-64-TO-32 %s
390 // CHECK-64-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
391 // CHECK-64-TO-32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/10.2.0/32{{/|\\\\}}crtbegin.o"
392 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/32"
393 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib/../lib32"
394 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../lib32"
395 // CHECK-64-TO-32: "-L[[SYSROOT]]/lib/../lib32"
396 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32"
397 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib"
398 // CHECK-64-TO-32: "-L[[SYSROOT]]/lib"
399 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib"
401 // RUN: %clang -### %s -no-pie 2>&1 \
402 // RUN: --target=x86_64-unknown-linux-gnux32 -rtlib=platform --unwindlib=platform \
403 // RUN: --gcc-toolchain="" \
404 // RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
405 // RUN: | FileCheck --check-prefix=CHECK-X32 %s
406 // CHECK-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
407 // CHECK-X32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/10.2.0/x32{{/|\\\\}}crtbegin.o"
408 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/x32"
409 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib/../libx32"
410 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../libx32"
411 // CHECK-X32: "-L[[SYSROOT]]/lib/../libx32"
412 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/../libx32"
413 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib"
414 // CHECK-X32: "-L[[SYSROOT]]/lib"
415 // CHECK-X32: "-L[[SYSROOT]]/usr/lib"
417 // RUN: %clang -### %s -no-pie 2>&1 \
418 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform -mx32 \
419 // RUN: --gcc-toolchain="" \
420 // RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
421 // RUN: | FileCheck --check-prefix=CHECK-64-TO-X32 %s
422 // CHECK-64-TO-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
423 // CHECK-64-TO-X32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/10.2.0/x32{{/|\\\\}}crtbegin.o"
424 // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/x32"
425 // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib/../libx32"
426 // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../libx32"
427 // CHECK-64-TO-X32: "-L[[SYSROOT]]/lib/../libx32"
428 // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/../libx32"
429 // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib"
430 // CHECK-64-TO-X32: "-L[[SYSROOT]]/lib"
431 // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib"
433 // RUN: %clang -### %s -no-pie 2>&1 \
434 // RUN: --target=i386-unknown-linux -rtlib=platform --unwindlib=platform -mx32 \
435 // RUN: --gcc-toolchain="" \
436 // RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
437 // RUN: | FileCheck --check-prefix=CHECK-32-TO-X32 %s
438 // CHECK-32-TO-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
439 // CHECK-32-TO-X32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/10.2.0/x32{{/|\\\\}}crtbegin.o"
440 // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/x32"
441 // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib/../libx32"
442 // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../libx32"
443 // CHECK-32-TO-X32: "-L[[SYSROOT]]/lib/../libx32"
444 // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/../libx32"
445 // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib"
446 // CHECK-32-TO-X32: "-L[[SYSROOT]]/lib"
447 // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib"
449 // RUN: %clang -### %s -no-pie 2>&1 \
450 // RUN: --target=x86_64-unknown-linux-gnux32 -rtlib=platform --unwindlib=platform -m64 \
451 // RUN: --gcc-toolchain="" \
452 // RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
453 // RUN: | FileCheck --check-prefix=CHECK-X32-TO-64 %s
454 // CHECK-X32-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
455 // CHECK-X32-TO-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/10.2.0{{/|\\\\}}crtbegin.o"
456 // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0"
457 // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib/../lib64"
458 // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../lib64"
459 // CHECK-X32-TO-64: "-L[[SYSROOT]]/lib/../lib64"
460 // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64"
461 // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib"
462 // CHECK-X32-TO-64: "-L[[SYSROOT]]/lib"
463 // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib"
465 // RUN: %clang -### %s -no-pie 2>&1 \
466 // RUN: --target=x86_64-unknown-linux-gnux32 -rtlib=platform --unwindlib=platform -m32 \
467 // RUN: --gcc-toolchain="" \
468 // RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \
469 // RUN: | FileCheck --check-prefix=CHECK-X32-TO-32 %s
470 // CHECK-X32-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
471 // CHECK-X32-TO-32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/10.2.0/32{{/|\\\\}}crtbegin.o"
472 // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/32"
473 // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib/../lib32"
474 // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../lib32"
475 // CHECK-X32-TO-32: "-L[[SYSROOT]]/lib/../lib32"
476 // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32"
477 // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/10.2.0/../../../../x86_64-unknown-linux/lib"
478 // CHECK-X32-TO-32: "-L[[SYSROOT]]/lib"
479 // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib"
481 // RUN: %clang -### %s -no-pie 2>&1 \
482 // RUN: --target=x86_64-unknown-linux -rtlib=platform --unwindlib=platform -m32 \
483 // RUN: --gcc-toolchain=%S/Inputs/multilib_64bit_linux_tree/usr \
484 // RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \
485 // RUN: | FileCheck --check-prefix=CHECK-64-TO-32-SYSROOT %s
486 // CHECK-64-TO-32-SYSROOT: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
487 // CHECK-64-TO-32-SYSROOT: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/10.2.0/32{{/|\\\\}}crtbegin.o"
488 // CHECK-64-TO-32-SYSROOT: "-L{{[^"]*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/10.2.0/32"
489 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/lib/../lib32"
490 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/usr/lib/../lib32"
491 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/lib"
492 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/usr/lib"
494 // Check that we support unusual patch version formats, including missing that
496 // RUN: %clang -### %s -no-pie 2>&1 \
497 // RUN: --target=i386-unknown-linux -rtlib=platform --unwindlib=platform -m32 \
498 // RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing1/bin \
499 // RUN: --gcc-toolchain="" \
500 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
501 // RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION1 %s
502 // CHECK-GCC-VERSION1: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
503 // CHECK-GCC-VERSION1: "{{.*}}/Inputs/basic_linux_tree/usr/lib/gcc/i386-unknown-linux/10.2.0{{/|\\\\}}crtbegin.o"
505 // Test a simulated installation of libc++ on Linux, both through sysroot and
506 // the installation path of Clang.
507 // RUN: %clangxx -x c++ -### %s -no-pie 2>&1 \
508 // RUN: --target=x86_64-unknown-linux-gnu \
509 // RUN: -stdlib=libc++ \
510 // RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
511 // RUN: --gcc-toolchain="" \
512 // RUN: -resource-dir=%S/Inputs/resource_dir \
513 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \
514 // RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-SYSROOT %s
515 // CHECK-BASIC-LIBCXX-SYSROOT: "-cc1"
516 // CHECK-BASIC-LIBCXX-SYSROOT: "-isysroot" "[[SYSROOT:[^"]+]]"
517 // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1"
518 // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
519 // CHECK-BASIC-LIBCXX-SYSROOT: "--sysroot=[[SYSROOT]]"
520 // RUN: %clang -x c++ -### %s -no-pie 2>&1 \
521 // RUN: --target=x86_64-unknown-linux-gnu \
522 // RUN: -stdlib=libc++ \
523 // RUN: -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \
524 // RUN: --gcc-toolchain="" \
525 // RUN: -resource-dir=%S/Inputs/resource_dir \
526 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \
527 // RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-INSTALL %s
528 // CHECK-BASIC-LIBCXX-INSTALL: "-cc1"
529 // CHECK-BASIC-LIBCXX-INSTALL: "-isysroot" "[[SYSROOT:[^"]+]]"
530 // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/c++/v1"
531 // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
532 // CHECK-BASIC-LIBCXX-INSTALL: "--sysroot=[[SYSROOT]]"
534 // Test that we can use -stdlib=libc++ in a build system even when it
535 // occasionally links C code instead of C++ code.
536 // RUN: %clang -x c -### %s -no-pie 2>&1 \
537 // RUN: --target=x86_64-unknown-linux-gnu \
538 // RUN: -stdlib=libc++ \
539 // RUN: -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \
540 // RUN: --gcc-toolchain="" \
541 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \
542 // RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-C-LINK %s
543 // CHECK-BASIC-LIBCXX-C-LINK-NOT: warning:
544 // CHECK-BASIC-LIBCXX-C-LINK: "-cc1"
545 // CHECK-BASIC-LIBCXX-C-LINK: "-isysroot" "[[SYSROOT:[^"]+]]"
546 // CHECK-BASIC-LIBCXX-C-LINK-NOT: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/c++/v1"
547 // CHECK-BASIC-LIBCXX-C-LINK: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
548 // CHECK-BASIC-LIBCXX-C-LINK: "--sysroot=[[SYSROOT]]"
550 // Check multi arch support on Ubuntu 12.04 LTS.
551 // RUN: %clang -### %s -no-pie 2>&1 \
552 // RUN: --target=arm-unknown-linux-gnueabihf -rtlib=platform --unwindlib=platform \
553 // RUN: --gcc-toolchain="" \
554 // RUN: --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \
555 // RUN: | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM-HF %s
556 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
557 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/arm-linux-gnueabihf{{/|\\\\}}crt1.o"
558 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/arm-linux-gnueabihf{{/|\\\\}}crti.o"
559 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3{{/|\\\\}}crtbegin.o"
560 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3"
561 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/lib/arm-linux-gnueabihf"
562 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabihf"
563 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3{{/|\\\\}}crtend.o"
564 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/arm-linux-gnueabihf{{/|\\\\}}crtn.o"
566 // Check Ubuntu 13.10 on x86-64 targeting arm-linux-gnueabihf.
567 // RUN: %clang -### %s -no-pie 2>&1 \
568 // RUN: --target=arm-linux-gnueabihf -rtlib=platform --unwindlib=platform \
569 // RUN: --gcc-toolchain="" \
570 // RUN: --sysroot=%S/Inputs/x86-64_ubuntu_13.10 \
571 // RUN: | FileCheck --check-prefix=CHECK-X86-64-UBUNTU-13-10-ARM-HF %s
572 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
573 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-dynamic-linker" "{{(/usr/arm--linux-gnueabihf)?}}/lib/ld-linux-armhf.so.3"
574 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crt1.o"
575 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crti.o"
576 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8{{/|\\\\}}crtbegin.o"
577 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8"
578 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib"
579 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/lib/../lib"
580 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/../lib"
581 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib"
582 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8{{/|\\\\}}crtend.o"
583 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crtn.o"
585 // Check Ubuntu 13.10 on x86-64 targeting arm-linux-gnueabi.
586 // RUN: %clang -### %s -no-pie 2>&1 \
587 // RUN: --target=arm-linux-gnueabi -rtlib=platform --unwindlib=platform \
588 // RUN: --gcc-toolchain="" \
589 // RUN: --sysroot=%S/Inputs/x86-64_ubuntu_13.10 \
590 // RUN: | FileCheck --check-prefix=CHECK-X86-64-UBUNTU-13-10-ARM %s
591 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
592 // CHECK-X86-64-UBUNTU-13-10-ARM: "-dynamic-linker" "{{(/usr/arm--linux-gnueabi)?}}/lib/ld-linux.so.3"
593 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crt1.o"
594 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crti.o"
595 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7{{/|\\\\}}crtbegin.o"
596 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7"
597 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib"
598 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/lib/../lib"
599 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/../lib"
600 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib"
601 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7{{/|\\\\}}crtend.o"
602 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crtn.o"
604 // Check Ubuntu 14.04 on powerpc64le.
605 // RUN: %clang -### %s -no-pie 2>&1 \
606 // RUN: --target=powerpc64le-unknown-linux-gnu -rtlib=platform --unwindlib=platform \
607 // RUN: --gcc-toolchain="" \
608 // RUN: --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
609 // RUN: | FileCheck --check-prefix=CHECK-UBUNTU-14-04-PPC64LE %s
610 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
611 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/powerpc64le-linux-gnu{{/|\\\\}}crt1.o"
612 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/powerpc64le-linux-gnu{{/|\\\\}}crti.o"
613 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8{{/|\\\\}}crtbegin.o"
614 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8"
615 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/lib/powerpc64le-linux-gnu"
616 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/powerpc64le-linux-gnu"
617 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8{{/|\\\\}}crtend.o"
618 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/powerpc64le-linux-gnu{{/|\\\\}}crtn.o"
620 // Check Ubuntu 14.04 on x32.
621 // "/usr/lib/gcc/x86_64-linux-gnu/4.8/x32/crtend.o" "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32/crtn.o"
622 // RUN: %clang -### %s -no-pie 2>&1 \
623 // RUN: --target=x86_64-unknown-linux-gnux32 -rtlib=platform --unwindlib=platform \
624 // RUN: --gcc-toolchain="" \
625 // RUN: --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
626 // RUN: | FileCheck --check-prefix=CHECK-UBUNTU-14-04-X32 %s
627 // CHECK-UBUNTU-14-04-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
628 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crt1.o"
629 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crti.o"
630 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/x32{{/|\\\\}}crtbegin.o"
631 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/x32"
632 // CHECK-UBUNTU-14-04-X32-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32"
633 // CHECK-UBUNTU-14-04-X32-SAME: {{^}} "-L[[SYSROOT]]/lib/../libx32"
634 // CHECK-UBUNTU-14-04-X32-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/../libx32"
635 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/x32{{/|\\\\}}crtend.o"
636 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crtn.o"
638 // Check fedora 18 on arm.
639 // RUN: %clang -### %s -no-pie 2>&1 \
640 // RUN: --target=armv7-unknown-linux-gnueabihf -rtlib=platform --unwindlib=platform \
641 // RUN: --gcc-toolchain="" \
642 // RUN: --sysroot=%S/Inputs/fedora_18_tree \
643 // RUN: | FileCheck --check-prefix=CHECK-FEDORA-18-ARM-HF %s
644 // CHECK-FEDORA-18-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
645 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crt1.o"
646 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crti.o"
647 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2{{/|\\\\}}crtbegin.o"
648 // CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2"
649 // CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib"
650 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2{{/|\\\\}}crtend.o"
651 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crtn.o"
653 // Check Fedora 21 on AArch64.
654 // RUN: %clang -### %s -no-pie 2>&1 \
655 // RUN: --target=arm64-unknown-linux-gnu -rtlib=platform --unwindlib=platform \
656 // RUN: --gcc-toolchain="" \
657 // RUN: --sysroot=%S/Inputs/fedora_21_tree \
658 // RUN: | FileCheck --check-prefix=CHECK-FEDORA-21-AARCH64 %s
659 // RUN: %clang -### %s -no-pie 2>&1 \
660 // RUN: --target=aarch64-unknown-linux-gnu -rtlib=platform --unwindlib=platform \
661 // RUN: --gcc-toolchain="" \
662 // RUN: --sysroot=%S/Inputs/fedora_21_tree \
663 // RUN: | FileCheck --check-prefix=CHECK-FEDORA-21-AARCH64 %s
664 // CHECK-FEDORA-21-AARCH64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
665 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crt1.o"
666 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crti.o"
667 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|\\\\}}crtbegin.o"
668 // CHECK-FEDORA-21-AARCH64: "-L[[SYSROOT]]/usr/lib/gcc/aarch64-redhat-linux/4.9.0"
669 // CHECK-FEDORA-21-AARCH64: "-L[[SYSROOT]]/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64"
670 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|\\\\}}crtend.o"
671 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crtn.o"
673 // Check Fedora 31 on riscv64.
674 // RUN: %clang -### %s -no-pie 2>&1 \
675 // RUN: --target=riscv64-redhat-linux -rtlib=platform --unwindlib=platform \
676 // RUN: --gcc-toolchain="" \
677 // RUN: --sysroot=%S/Inputs/fedora_31_riscv64_tree \
678 // RUN: | FileCheck --check-prefix=CHECK-FEDORA-31-RISCV64 %s
679 // CHECK-FEDORA-31-RISCV64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
680 // CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64{{/|\\\\}}crt1.o"
681 // CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|\\\\}}crti.o"
682 // CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|\\\\}}crtbegin.o"
683 // CHECK-FEDORA-31-RISCV64: "-L[[SYSROOT]]/usr/lib/gcc/riscv64-redhat-linux/9"
684 // CHECK-FEDORA-31-RISCV64: "-L[[SYSROOT]]/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64"
685 // CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|\\\\}}crtend.o"
686 // CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|\\\\}}crtn.o"
688 // RUN: %clang -### %s -no-pie 2>&1 \
689 // RUN: --target=arm-unknown-linux-gnueabi -rtlib=platform --unwindlib=platform \
690 // RUN: --gcc-toolchain="" \
691 // RUN: --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \
692 // RUN: | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM %s
693 // CHECK-UBUNTU-12-04-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
694 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/arm-linux-gnueabi{{/|\\\\}}crt1.o"
695 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/arm-linux-gnueabi{{/|\\\\}}crti.o"
696 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1{{/|\\\\}}crtbegin.o"
697 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1"
698 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/lib/arm-linux-gnueabi"
699 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabi"
700 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1{{/|\\\\}}crtend.o"
701 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/arm-linux-gnueabi{{/|\\\\}}crtn.o"
703 // Test the setup that shipped in SUSE 10.3 on ppc64.
704 // RUN: %clang -### %s -no-pie 2>&1 \
705 // RUN: --target=powerpc64-suse-linux -rtlib=platform --unwindlib=platform \
706 // RUN: --gcc-toolchain="" \
707 // RUN: --sysroot=%S/Inputs/suse_10.3_ppc64_tree \
708 // RUN: | FileCheck --check-prefix=CHECK-SUSE-10-3-PPC64 %s
709 // CHECK-SUSE-10-3-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
710 // CHECK-SUSE-10-3-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64{{/|\\\\}}crtbegin.o"
711 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64"
712 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/../../../../lib64"
713 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/lib/../lib64"
714 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/../lib64"
716 // Check openSuse Leap 42.2 on AArch64
717 // RUN: %clang -### %s -no-pie 2>&1 \
718 // RUN: --target=arm64-unknown-linux-gnu -rtlib=platform --unwindlib=platform \
719 // RUN: --gcc-toolchain="" \
720 // RUN: --sysroot=%S/Inputs/opensuse_42.2_aarch64_tree \
721 // RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-42-2-AARCH64 %s
722 // RUN: %clang -### %s -no-pie 2>&1 \
723 // RUN: --target=aarch64-unknown-linux-gnu -rtlib=platform --unwindlib=platform \
724 // RUN: --gcc-toolchain="" \
725 // RUN: --sysroot=%S/Inputs/opensuse_42.2_aarch64_tree \
726 // RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-42-2-AARCH64 %s
727 // CHECK-OPENSUSE-42-2-AARCH64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
728 // CHECK-OPENSUSE-42-2-AARCH64: "{{.*}}/usr/lib64/gcc/aarch64-suse-linux/4.8/../../../../lib64{{/|\\\\}}crt1.o"
729 // CHECK-OPENSUSE-42-2-AARCH64: "{{.*}}/usr/lib64/gcc/aarch64-suse-linux/4.8/../../../../lib64{{/|\\\\}}crti.o"
730 // CHECK-OPENSUSE-42-2-AARCH64: "{{.*}}/usr/lib64/gcc/aarch64-suse-linux/4.8{{/|\\\\}}crtbegin.o"
731 // CHECK-OPENSUSE-42-2-AARCH64: "-L[[SYSROOT]]/usr/lib64/gcc/aarch64-suse-linux/4.8"
732 // CHECK-OPENSUSE-42-2-AARCH64: "-L[[SYSROOT]]/usr/lib64/gcc/aarch64-suse-linux/4.8/../../../../lib64"
733 // CHECK-OPENSUSE-42-2-AARCH64: "{{.*}}/usr/lib64/gcc/aarch64-suse-linux/4.8{{/|\\\\}}crtend.o"
734 // CHECK-OPENSUSE-42-2-AARCH64: "{{.*}}/usr/lib64/gcc/aarch64-suse-linux/4.8/../../../../lib64{{/|\\\\}}crtn.o"
736 // Check openSUSE Tumbleweed on armv6hl
737 // RUN: %clang -### %s -no-pie 2>&1 \
738 // RUN: --target=armv6hl-suse-linux-gnueabi -rtlib=platform --unwindlib=platform \
739 // RUN: --gcc-toolchain="" \
740 // RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_armv6hl_tree \
741 // RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-ARMV6HL %s
742 // RUN: %clang -### %s -no-pie 2>&1 \
743 // RUN: --target=armv6hl-suse-linux-gnueabi -rtlib=platform --unwindlib=platform \
744 // RUN: --gcc-toolchain="" \
745 // RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_armv6hl_tree \
746 // RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-ARMV6HL %s
747 // CHECK-OPENSUSE-TW-ARMV6HL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
748 // CHECK-OPENSUSE-TW-ARMV6HL: "{{.*}}/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5/../../../../lib{{/|\\\\}}crt1.o"
749 // CHECK-OPENSUSE-TW-ARMV6HL: "{{.*}}/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5/../../../../lib{{/|\\\\}}crti.o"
750 // CHECK-OPENSUSE-TW-ARMV6HL: "{{.*}}/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5{{/|\\\\}}crtbegin.o"
751 // CHECK-OPENSUSE-TW-ARMV6HL: "-L[[SYSROOT]]/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5"
752 // CHECK-OPENSUSE-TW-ARMV6HL: "-L[[SYSROOT]]/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5/../../../../lib"
753 // CHECK-OPENSUSE-TW-ARMV6HL: "{{.*}}/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5{{/|\\\\}}crtend.o"
754 // CHECK-OPENSUSE-TW-ARMV6HL: "{{.*}}/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5/../../../../lib{{/|\\\\}}crtn.o"
756 // Check openSUSE Tumbleweed on armv7hl
757 // RUN: %clang -### %s -no-pie 2>&1 \
758 // RUN: --target=armv7hl-suse-linux-gnueabi -rtlib=platform --unwindlib=platform \
759 // RUN: --gcc-toolchain="" \
760 // RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_armv7hl_tree \
761 // RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-ARMV7HL %s
762 // RUN: %clang -### %s -no-pie 2>&1 \
763 // RUN: --target=armv7hl-suse-linux-gnueabi -rtlib=platform --unwindlib=platform \
764 // RUN: --gcc-toolchain="" \
765 // RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_armv7hl_tree \
766 // RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-ARMV7HL %s
767 // CHECK-OPENSUSE-TW-ARMV7HL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
768 // CHECK-OPENSUSE-TW-ARMV7HL: "{{.*}}/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5/../../../../lib{{/|\\\\}}crt1.o"
769 // CHECK-OPENSUSE-TW-ARMV7HL: "{{.*}}/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5/../../../../lib{{/|\\\\}}crti.o"
770 // CHECK-OPENSUSE-TW-ARMV7HL: "{{.*}}/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5{{/|\\\\}}crtbegin.o"
771 // CHECK-OPENSUSE-TW-ARMV7HL: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5"
772 // CHECK-OPENSUSE-TW-ARMV7HL: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5/../../../../lib"
773 // CHECK-OPENSUSE-TW-ARMV7HL: "{{.*}}/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5{{/|\\\\}}crtend.o"
774 // CHECK-OPENSUSE-TW-ARMV7HL: "{{.*}}/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5/../../../../lib{{/|\\\\}}crtn.o"
776 // Check openSUSE Tumbleweed on riscv64
777 // RUN: %clang -### %s -no-pie 2>&1 \
778 // RUN: --target=riscv64-suse-linux -rtlib=platform --unwindlib=platform \
779 // RUN: --gcc-toolchain="" \
780 // RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_riscv64_tree \
781 // RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-RISCV64 %s
782 // RUN: %clang -### %s -no-pie 2>&1 \
783 // RUN: --target=riscv64-suse-linux -rtlib=platform --unwindlib=platform \
784 // RUN: --gcc-toolchain="" \
785 // RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_riscv64_tree \
786 // RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-RISCV64 %s
787 // CHECK-OPENSUSE-TW-RISCV64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
788 // CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9/../../../../lib64{{/|\\\\}}crt1.o"
789 // CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9/../../../../lib64{{/|\\\\}}crti.o"
790 // CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9{{/|\\\\}}crtbegin.o"
791 // CHECK-OPENSUSE-TW-RISCV64: "-L[[SYSROOT]]/usr/lib64/gcc/riscv64-suse-linux/9"
792 // CHECK-OPENSUSE-TW-RISCV64: "-L[[SYSROOT]]/usr/lib64/gcc/riscv64-suse-linux/9/../../../../lib64"
793 // CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9{{/|\\\\}}crtend.o"
794 // CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9/../../../../lib64{{/|\\\\}}crtn.o"
796 // Check openSUSE Tumbleweed on ppc
797 // RUN: %clang -### %s -no-pie 2>&1 \
798 // RUN: --target=powerpc-unknown-linux-gnu -rtlib=platform --unwindlib=platform \
799 // RUN: --gcc-toolchain="" \
800 // RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_ppc_tree \
801 // RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-PPC %s
802 // CHECK-OPENSUSE-TW-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
803 // CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib{{/|\\\\}}crt1.o"
804 // CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib{{/|\\\\}}crti.o"
805 // CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/9{{/|\\\\}}crtbegin.o"
806 // CHECK-OPENSUSE-TW-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/9"
807 // CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/9{{/|\\\\}}crtend.o"
808 // CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib/crtn.o"
810 // Check dynamic-linker for different archs
811 // RUN: %clang -### %s -no-pie 2>&1 \
812 // RUN: --target=arm-linux-gnueabi \
813 // RUN: | FileCheck --check-prefix=CHECK-ARM %s
814 // CHECK-ARM: "{{.*}}ld{{(.exe)?}}"
815 // CHECK-ARM: "-m" "armelf_linux_eabi"
816 // CHECK-ARM: "-dynamic-linker" "{{.*}}/lib/ld-linux.so.3"
818 // RUN: %clang -### %s -no-pie 2>&1 \
819 // RUN: --target=arm-linux-gnueabi -mfloat-abi=hard \
820 // RUN: | FileCheck --check-prefix=CHECK-ARM-ABIHF %s
821 // CHECK-ARM-ABIHF: "{{.*}}ld{{(.exe)?}}"
822 // CHECK-ARM-ABIHF: "-m" "armelf_linux_eabi"
823 // CHECK-ARM-ABIHF: "-dynamic-linker" "{{.*}}/lib/ld-linux-armhf.so.3"
825 // RUN: %clang -### %s -no-pie 2>&1 \
826 // RUN: --target=arm-linux-gnueabihf \
827 // RUN: | FileCheck --check-prefix=CHECK-ARM-HF %s
828 // CHECK-ARM-HF: "{{.*}}ld{{(.exe)?}}"
829 // CHECK-ARM-HF: "-m" "armelf_linux_eabi"
830 // CHECK-ARM-HF: "-dynamic-linker" "{{.*}}/lib/ld-linux-armhf.so.3"
832 // RUN: %clang -### %s -no-pie 2>&1 \
833 // RUN: --target=loongarch64-linux-gnu \
834 // RUN: | FileCheck --check-prefix=CHECK-LOONGARCH-LP64D %s
835 // RUN: %clang -### %s -no-pie 2>&1 \
836 // RUN: --target=loongarch64-linux-gnuf64 \
837 // RUN: | FileCheck --check-prefix=CHECK-LOONGARCH-LP64D %s
838 // CHECK-LOONGARCH-LP64D: "{{.*}}ld{{(.exe)?}}"
839 // CHECK-LOONGARCH-LP64D: "-m" "elf64loongarch"
840 // CHECK-LOONGARCH-LP64D: "-dynamic-linker" "{{.*}}/lib64/ld-linux-loongarch-lp64d.so.1"
842 // RUN: %clang -### %s -no-pie 2>&1 \
843 // RUN: --target=loongarch64-linux-gnuf32 \
844 // RUN: | FileCheck --check-prefix=CHECK-LOONGARCH-LP64F %s
845 // CHECK-LOONGARCH-LP64F: "{{.*}}ld{{(.exe)?}}"
846 // CHECK-LOONGARCH-LP64F: "-m" "elf64loongarch"
847 // CHECK-LOONGARCH-LP64F: "-dynamic-linker" "{{.*}}/lib64/ld-linux-loongarch-lp64f.so.1"
849 // RUN: %clang -### %s -no-pie 2>&1 \
850 // RUN: --target=loongarch64-linux-gnusf \
851 // RUN: | FileCheck --check-prefix=CHECK-LOONGARCH-LP64S %s
852 // CHECK-LOONGARCH-LP64S: "{{.*}}ld{{(.exe)?}}"
853 // CHECK-LOONGARCH-LP64S: "-m" "elf64loongarch"
854 // CHECK-LOONGARCH-LP64S: "-dynamic-linker" "{{.*}}/lib64/ld-linux-loongarch-lp64s.so.1"
856 // RUN: %clang -### %s -no-pie 2>&1 \
857 // RUN: --target=powerpc64-linux-gnu \
858 // RUN: | FileCheck --check-prefix=CHECK-PPC64 %s
859 // CHECK-PPC64: "{{.*}}ld{{(.exe)?}}"
860 // CHECK-PPC64: "-m" "elf64ppc"
861 // CHECK-PPC64: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld64.so.1"
863 // RUN: %clang -### %s -no-pie 2>&1 \
864 // RUN: --target=powerpc64-linux-gnu -mabi=elfv1 \
865 // RUN: | FileCheck --check-prefix=CHECK-PPC64-ELFv1 %s
866 // CHECK-PPC64-ELFv1: "{{.*}}ld{{(.exe)?}}"
867 // CHECK-PPC64-ELFv1: "-m" "elf64ppc"
868 // CHECK-PPC64-ELFv1: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld64.so.1"
870 // RUN: %clang -### %s -no-pie 2>&1 \
871 // RUN: --target=powerpc64-linux-gnu -mabi=elfv2 \
872 // RUN: | FileCheck --check-prefix=CHECK-PPC64-ELFv2 %s
873 // CHECK-PPC64-ELFv2: "{{.*}}ld{{(.exe)?}}"
874 // CHECK-PPC64-ELFv2: "-m" "elf64ppc"
875 // CHECK-PPC64-ELFv2: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld64.so.2"
877 // RUN: %clang -### %s -no-pie 2>&1 \
878 // RUN: --target=powerpc64le-linux-gnu \
879 // RUN: | FileCheck --check-prefix=CHECK-PPC64LE %s
880 // CHECK-PPC64LE: "{{.*}}ld{{(.exe)?}}"
881 // CHECK-PPC64LE: "-m" "elf64lppc"
882 // CHECK-PPC64LE: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld64.so.2"
884 // RUN: %clang -### %s -no-pie 2>&1 \
885 // RUN: --target=powerpc64le-linux-gnu -mabi=elfv1 \
886 // RUN: | FileCheck --check-prefix=CHECK-PPC64LE-ELFv1 %s
887 // CHECK-PPC64LE-ELFv1: "{{.*}}ld{{(.exe)?}}"
888 // CHECK-PPC64LE-ELFv1: "-m" "elf64lppc"
889 // CHECK-PPC64LE-ELFv1: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld64.so.1"
891 // RUN: %clang -### %s -no-pie 2>&1 \
892 // RUN: --target=powerpc64le-linux-gnu -mabi=elfv2 \
893 // RUN: | FileCheck --check-prefix=CHECK-PPC64LE-ELFv2 %s
894 // CHECK-PPC64LE-ELFv2: "{{.*}}ld{{(.exe)?}}"
895 // CHECK-PPC64LE-ELFv2: "-m" "elf64lppc"
896 // CHECK-PPC64LE-ELFv2: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld64.so.2"
898 // Check that we do not pass --hash-style=gnu or --hash-style=both to
899 // hexagon linux linker
900 // RUN: %clang -### %s -no-pie 2>&1 \
901 // RUN: --target=hexagon-linux-gnu \
902 // RUN: | FileCheck --check-prefix=CHECK-HEXAGON %s
903 // CHECK-HEXAGON: "{{.*}}{{hexagon-link|ld}}{{(.exe)?}}"
904 // CHECK-HEXAGON-NOT: "--hash-style={{gnu|both}}"
906 // Check that we do not pass --hash-style=gnu and --hash-style=both to linker
907 // and provide correct path to the dynamic linker and emulation mode when build
908 // for MIPS platforms.
909 // RUN: %clang -### %s -no-pie 2>&1 \
910 // RUN: --target=mips-linux-gnu \
911 // RUN: | FileCheck --check-prefix=CHECK-MIPS %s
912 // CHECK-MIPS: "{{.*}}ld{{(.exe)?}}"
913 // CHECK-MIPS: "-m" "elf32btsmip"
914 // CHECK-MIPS: "-dynamic-linker" "{{.*}}/lib/ld.so.1"
915 // CHECK-MIPS-NOT: "--hash-style={{gnu|both}}"
917 // RUN: %clang -### %s -no-pie 2>&1 \
918 // RUN: --target=mipsel-linux-gnu \
919 // RUN: | FileCheck --check-prefix=CHECK-MIPSEL %s
920 // CHECK-MIPSEL: "{{.*}}ld{{(.exe)?}}"
921 // CHECK-MIPSEL: "-m" "elf32ltsmip"
922 // CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/lib/ld.so.1"
923 // CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}"
925 // RUN: %clang -### %s -no-pie 2>&1 --target=mipsel-linux-gnu -mnan=2008 \
926 // RUN: | FileCheck --check-prefix=CHECK-MIPSEL-NAN2008 %s
927 // CHECK-MIPSEL-NAN2008: "{{.*}}ld{{(.exe)?}}"
928 // CHECK-MIPSEL-NAN2008: "-m" "elf32ltsmip"
929 // CHECK-MIPSEL-NAN2008: "-dynamic-linker" "{{.*}}/lib/ld-linux-mipsn8.so.1"
930 // CHECK-MIPSEL-NAN2008-NOT: "--hash-style={{gnu|both}}"
932 // RUN: %clang -### %s -no-pie 2>&1 --target=mipsel-linux-gnu -mcpu=mips32r6 \
933 // RUN: | FileCheck --check-prefix=CHECK-MIPS32R6EL %s
934 // CHECK-MIPS32R6EL: "{{.*}}ld{{(.exe)?}}"
935 // CHECK-MIPS32R6EL: "-m" "elf32ltsmip"
936 // CHECK-MIPS32R6EL: "-dynamic-linker" "{{.*}}/lib/ld-linux-mipsn8.so.1"
937 // CHECK-MIPS32R6EL-NOT: "--hash-style={{gnu|both}}"
939 // RUN: %clang -### %s -no-pie 2>&1 \
940 // RUN: --target=mips64-linux-gnu \
941 // RUN: | FileCheck --check-prefix=CHECK-MIPS64 %s
942 // CHECK-MIPS64: "{{.*}}ld{{(.exe)?}}"
943 // CHECK-MIPS64: "-m" "elf64btsmip"
944 // CHECK-MIPS64: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld.so.1"
945 // CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}"
947 // RUN: %clang -### %s -no-pie 2>&1 \
948 // RUN: --target=mips64el-linux-gnu \
949 // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL %s
950 // CHECK-MIPS64EL: "{{.*}}ld{{(.exe)?}}"
951 // CHECK-MIPS64EL: "-m" "elf64ltsmip"
952 // CHECK-MIPS64EL: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld.so.1"
953 // CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}"
955 // RUN: %clang -### %s -no-pie 2>&1 --target=mips64el-linux-gnu -mnan=2008 \
956 // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-NAN2008 %s
957 // CHECK-MIPS64EL-NAN2008: "{{.*}}ld{{(.exe)?}}"
958 // CHECK-MIPS64EL-NAN2008: "-m" "elf64ltsmip"
959 // CHECK-MIPS64EL-NAN2008: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld-linux-mipsn8.so.1"
960 // CHECK-MIPS64EL-NAN2008-NOT: "--hash-style={{gnu|both}}"
962 // RUN: %clang -### %s -no-pie 2>&1 --target=mips64el-linux-gnu -mcpu=mips64r6 \
963 // RUN: | FileCheck --check-prefix=CHECK-MIPS64R6EL %s
964 // CHECK-MIPS64R6EL: "{{.*}}ld{{(.exe)?}}"
965 // CHECK-MIPS64R6EL: "-m" "elf64ltsmip"
966 // CHECK-MIPS64R6EL: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld-linux-mipsn8.so.1"
967 // CHECK-MIPS64R6EL-NOT: "--hash-style={{gnu|both}}"
969 // RUN: %clang -### %s -no-pie 2>&1 \
970 // RUN: --target=mips64-linux-gnu -mabi=n32 \
971 // RUN: | FileCheck --check-prefix=CHECK-MIPS64-N32 %s
972 // CHECK-MIPS64-N32: "{{.*}}ld{{(.exe)?}}"
973 // CHECK-MIPS64-N32: "-m" "elf32btsmipn32"
974 // CHECK-MIPS64-N32: "-dynamic-linker" "{{.*}}/lib{{(32)?}}/ld.so.1"
975 // CHECK-MIPS64-N32-NOT: "--hash-style={{gnu|both}}"
977 // RUN: %clang -### %s -no-pie 2>&1 \
978 // RUN: --target=mips64el-linux-gnu -mabi=n32 \
979 // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-N32 %s
980 // CHECK-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}"
981 // CHECK-MIPS64EL-N32: "-m" "elf32ltsmipn32"
982 // CHECK-MIPS64EL-N32: "-dynamic-linker" "{{.*}}/lib{{(32)?}}/ld.so.1"
983 // CHECK-MIPS64EL-N32-NOT: "--hash-style={{gnu|both}}"
985 // RUN: %clang -### %s -no-pie 2>&1 --target=mips64el-linux-gnu -mabi=n32 \
986 // RUN: -mnan=2008 | FileCheck --check-prefix=CHECK-MIPS64EL-N32-NAN2008 %s
987 // CHECK-MIPS64EL-N32-NAN2008: "{{.*}}ld{{(.exe)?}}"
988 // CHECK-MIPS64EL-N32-NAN2008: "-m" "elf32ltsmipn32"
989 // CHECK-MIPS64EL-N32-NAN2008: "-dynamic-linker" "{{.*}}/lib{{(32)?}}/ld-linux-mipsn8.so.1"
990 // CHECK-MIPS64EL-N32-NAN2008-NOT: "--hash-style={{gnu|both}}"
992 // RUN: %clang -### %s -no-pie 2>&1 --target=mips64el-redhat-linux \
993 // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-REDHAT %s
994 // CHECK-MIPS64EL-REDHAT: "{{.*}}ld{{(.exe)?}}"
995 // CHECK-MIPS64EL-REDHAT: "-m" "elf64ltsmip"
996 // CHECK-MIPS64EL-REDHAT: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld.so.1"
997 // CHECK-MIPS64EL-REDHAT-NOT: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld-musl-mipsel.so.1"
998 // CHECK-MIPS64EL-REDHAT-NOT: "--hash-style={{gnu|both}}"
1000 // Check that we pass --hash-style=both for pre-M Android versions and
1001 // --hash-style=gnu for newer Android versions.
1002 // RUN: %clang -### %s -no-pie 2>&1 \
1003 // RUN: --target=armv7-linux-android21 \
1004 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-HASH-STYLE-L %s
1005 // CHECK-ANDROID-HASH-STYLE-L: "{{.*}}ld{{(.exe)?}}"
1006 // CHECK-ANDROID-HASH-STYLE-L: "--hash-style=both"
1008 // RUN: %clang -### %s -no-pie 2>&1 \
1009 // RUN: --target=armv7-linux-android23 \
1010 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-HASH-STYLE-M %s
1011 // CHECK-ANDROID-HASH-STYLE-M: "{{.*}}ld{{(.exe)?}}"
1012 // CHECK-ANDROID-HASH-STYLE-M: "--hash-style=gnu"
1014 // RUN: %clang -### %s -no-pie 2>&1 --target=mips64-linux-gnuabin32 \
1015 // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-GNUABIN32 %s
1016 // CHECK-MIPS64EL-GNUABIN32: "{{.*}}ld{{(.exe)?}}"
1017 // CHECK-MIPS64EL-GNUABIN32: "-m" "elf32btsmipn32"
1018 // CHECK-MIPS64EL-GNUABIN32: "-dynamic-linker" "{{.*}}/lib{{(32)?}}/ld.so.1"
1019 // CHECK-MIPS64EL-GNUABIN32-NOT: "--hash-style={{gnu|both}}"
1021 // RUN: %clang -### %s -no-pie 2>&1 --target=mips64-linux-gnuabi64 \
1022 // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-GNUABI64 %s
1023 // CHECK-MIPS64EL-GNUABI64: "{{.*}}ld{{(.exe)?}}"
1024 // CHECK-MIPS64EL-GNUABI64: "-m" "elf64btsmip"
1025 // CHECK-MIPS64EL-GNUABI64: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld.so.1"
1026 // CHECK-MIPS64EL-GNUABI64-NOT: "--hash-style={{gnu|both}}"
1028 // RUN: %clang -### %s -no-pie 2>&1 \
1029 // RUN: --target=sparc-unknown-linux-gnu \
1030 // RUN: | FileCheck --check-prefix=CHECK-SPARCV8 %s
1031 // CHECK-SPARCV8: "{{.*}}ld{{(.exe)?}}"
1032 // CHECK-SPARCV8: "-m" "elf32_sparc"
1033 // CHECK-SPARCV8: "-dynamic-linker" "{{(/usr/sparc-unknown-linux-gnu)?}}/lib/ld-linux.so.2"
1034 // CHECK-SPARCV8: "--push-state" "--as-needed" "-latomic" "--pop-state"
1036 // RUN: %clang -### %s -no-pie 2>&1 \
1037 // RUN: --target=sparcel-unknown-linux-gnu \
1038 // RUN: | FileCheck --check-prefix=CHECK-SPARCV8EL %s
1039 // CHECK-SPARCV8EL: "{{.*}}ld{{(.exe)?}}"
1040 // CHECK-SPARCV8EL: "-m" "elf32_sparc"
1041 // CHECK-SPARCV8EL: "-dynamic-linker" "{{(/usr/sparcel-unknown-linux-gnu)?}}/lib/ld-linux.so.2"
1043 // RUN: %clang -### %s -no-pie 2>&1 \
1044 // RUN: --target=sparcv9-unknown-linux-gnu \
1045 // RUN: | FileCheck --check-prefix=CHECK-SPARCV9 %s
1046 // CHECK-SPARCV9: "{{.*}}ld{{(.exe)?}}"
1047 // CHECK-SPARCV9: "-m" "elf64_sparc"
1048 // CHECK-SPARCV9: "-dynamic-linker" "{{(/usr/sparcv9-unknown-linux-gnu)?}}/lib{{(64)?}}/ld-linux.so.2"
1049 // CHECK-SPARCV9-NOT: "-latomic"
1051 // Test linker invocation on Android.
1052 // RUN: %clang -### %s -no-pie 2>&1 \
1053 // RUN: --target=arm-linux-androideabi -rtlib=platform --unwindlib=platform \
1054 // RUN: --gcc-toolchain="" \
1055 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1056 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
1057 // RUN: %clang -### %s -no-pie 2>&1 \
1058 // RUN: --target=arm-linux-android -rtlib=platform --unwindlib=platform \
1059 // RUN: --gcc-toolchain="" \
1060 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1061 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
1062 // RUN: %clang -### %s -no-pie 2>&1 \
1063 // RUN: --target=aarch64-linux-android -rtlib=platform --unwindlib=platform \
1064 // RUN: --gcc-toolchain="" \
1065 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1066 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
1067 // RUN: %clang -### %s -no-pie 2>&1 \
1068 // RUN: --target=arm64-linux-android -rtlib=platform --unwindlib=platform \
1069 // RUN: --gcc-toolchain="" \
1070 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1071 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
1072 // RUN: %clang -### %s -no-pie 2>&1 \
1073 // RUN: --target=i686-linux-android -rtlib=platform --unwindlib=platform \
1074 // RUN: --gcc-toolchain="" \
1075 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1076 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
1077 // RUN: %clang -### %s -no-pie 2>&1 \
1078 // RUN: --target=x86_64-linux-android -rtlib=platform --unwindlib=platform \
1079 // RUN: --gcc-toolchain="" \
1080 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1081 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
1082 // CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1083 // CHECK-ANDROID: "-z" "now"
1084 // CHECK-ANDROID: "-z" "relro"
1085 // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o"
1086 // CHECK-ANDROID: "-L[[SYSROOT]]/usr/lib"
1087 // CHECK-ANDROID-NOT: "-lgcc_s"
1088 // CHECK-ANDROID-NOT: "-lgcc"
1089 // CHECK-ANDROID: "-l:libunwind.a"
1090 // CHECK-ANDROID: "-ldl"
1091 // CHECK-ANDROID-NOT: "-lgcc_s"
1092 // CHECK-ANDROID-NOT: "-lgcc"
1093 // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtend_android.o"
1094 // RUN: %clang -### %s -no-pie 2>&1 \
1095 // RUN: --target=arm-linux-androideabi -rtlib=platform --unwindlib=platform \
1096 // RUN: --gcc-toolchain="" \
1097 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1099 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
1100 // RUN: %clang -### %s -no-pie 2>&1 \
1101 // RUN: --target=arm-linux-android -rtlib=platform --unwindlib=platform \
1102 // RUN: --gcc-toolchain="" \
1103 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1105 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
1106 // RUN: %clang -### %s -no-pie 2>&1 \
1107 // RUN: --target=aarch64-linux-android -rtlib=platform --unwindlib=platform \
1108 // RUN: --gcc-toolchain="" \
1109 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1111 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
1112 // RUN: %clang -### %s -no-pie 2>&1 \
1113 // RUN: --target=arm64-linux-android -rtlib=platform --unwindlib=platform \
1114 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1116 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
1117 // RUN: %clang -### %s -no-pie 2>&1 \
1118 // RUN: --target=i686-linux-android -rtlib=platform --unwindlib=platform \
1119 // RUN: --gcc-toolchain="" \
1120 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1122 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
1123 // RUN: %clang -### %s -no-pie 2>&1 \
1124 // RUN: --target=x86_64-linux-android -rtlib=platform --unwindlib=platform \
1125 // RUN: --gcc-toolchain="" \
1126 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1128 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
1129 // CHECK-ANDROID-SO: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1130 // CHECK-ANDROID-SO-NOT: "-Bsymbolic"
1131 // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtbegin_so.o"
1132 // CHECK-ANDROID-SO: "-L[[SYSROOT]]/usr/lib"
1133 // CHECK-ANDROID-SO-NOT: "-lgcc_s"
1134 // CHECK-ANDROID-SO-NOT: "-lgcc"
1135 // CHECK-ANDROID-SO: "-l:libunwind.a"
1136 // CHECK-ANDROID-SO: "-ldl"
1137 // CHECK-ANDROID-SO-NOT: "-lgcc_s"
1138 // CHECK-ANDROID-SO-NOT: "-lgcc"
1139 // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtend_so.o"
1140 // RUN: %clang -### %s -no-pie 2>&1 \
1141 // RUN: --target=arm-linux-androideabi -rtlib=platform --unwindlib=platform \
1142 // RUN: --gcc-toolchain="" \
1143 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1145 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
1146 // RUN: %clang -### %s -no-pie 2>&1 \
1147 // RUN: --target=arm-linux-android -rtlib=platform --unwindlib=platform \
1148 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1150 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
1151 // RUN: %clang -### %s -no-pie 2>&1 \
1152 // RUN: --target=aarch64-linux-android -rtlib=platform --unwindlib=platform \
1153 // RUN: --gcc-toolchain="" \
1154 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1156 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
1157 // RUN: %clang -### %s -no-pie 2>&1 \
1158 // RUN: --target=arm64-linux-android -rtlib=platform --unwindlib=platform \
1159 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1161 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
1162 // RUN: %clang -### %s -no-pie 2>&1 \
1163 // RUN: --target=i686-linux-android -rtlib=platform --unwindlib=platform \
1164 // RUN: --gcc-toolchain="" \
1165 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1167 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
1168 // RUN: %clang -### %s -no-pie 2>&1 \
1169 // RUN: --target=x86_64-linux-android -rtlib=platform --unwindlib=platform \
1170 // RUN: --gcc-toolchain="" \
1171 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1173 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
1174 // CHECK-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1175 // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtbegin_static.o"
1176 // CHECK-ANDROID-STATIC: "-L[[SYSROOT]]/usr/lib"
1177 // CHECK-ANDROID-STATIC-NOT: "-lgcc_eh"
1178 // CHECK-ANDROID-STATIC-NOT: "-lgcc"
1179 // CHECK-ANDROID-STATIC: "-l:libunwind.a"
1180 // CHECK-ANDROID-STATIC-NOT: "-ldl"
1181 // CHECK-ANDROID-STATIC-NOT: "-lgcc_eh"
1182 // CHECK-ANDROID-STATIC-NOT: "-lgcc"
1183 // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtend_android.o"
1184 // RUN: %clang -### %s -no-pie 2>&1 \
1185 // RUN: --target=arm-linux-androideabi -rtlib=platform --unwindlib=platform \
1186 // RUN: --gcc-toolchain="" \
1187 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1189 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
1190 // RUN: %clang -### %s -no-pie 2>&1 \
1191 // RUN: --target=arm-linux-android -rtlib=platform --unwindlib=platform \
1192 // RUN: --gcc-toolchain="" \
1193 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1195 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
1196 // RUN: %clang -### %s -no-pie 2>&1 \
1197 // RUN: --target=aarch64-linux-android -rtlib=platform --unwindlib=platform \
1198 // RUN: --gcc-toolchain="" \
1199 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1201 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
1202 // RUN: %clang -### %s -no-pie 2>&1 \
1203 // RUN: --target=arm64-linux-android -rtlib=platform --unwindlib=platform \
1204 // RUN: --gcc-toolchain="" \
1205 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1207 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
1208 // RUN: %clang -### %s -no-pie 2>&1 \
1209 // RUN: --target=i686-linux-android -rtlib=platform --unwindlib=platform \
1210 // RUN: --gcc-toolchain="" \
1211 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1213 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
1214 // RUN: %clang -### %s -no-pie 2>&1 \
1215 // RUN: --target=x86_64-linux-android -rtlib=platform --unwindlib=platform \
1216 // RUN: --gcc-toolchain="" \
1217 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1219 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
1220 // CHECK-ANDROID-PIE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1221 // CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o"
1222 // CHECK-ANDROID-PIE: "-L[[SYSROOT]]/usr/lib"
1223 // CHECK-ANDROID-PIE-NOT: "-lgcc_s"
1224 // CHECK-ANDROID-PIE-NOT: "-lgcc"
1225 // CHECK-ANDROID-PIE: "-l:libunwind.a"
1226 // CHECK-ANDROID-PIE-NOT: "-lgcc_s"
1227 // CHECK-ANDROID-PIE-NOT: "-lgcc"
1228 // CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtend_android.o"
1229 // RUN: %clang -### %s -no-pie 2>&1 \
1230 // RUN: --target=arm-linux-androideabi \
1231 // RUN: --gcc-toolchain="" \
1232 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1233 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-32 %s
1234 // RUN: %clang -### %s -no-pie 2>&1 \
1235 // RUN: --target=arm-linux-android \
1236 // RUN: --gcc-toolchain="" \
1237 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1238 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-32 %s
1239 // RUN: %clang -### %s -no-pie 2>&1 \
1240 // RUN: --target=aarch64-linux-android \
1241 // RUN: --gcc-toolchain="" \
1242 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1243 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-64 %s
1244 // RUN: %clang -### %s -no-pie 2>&1 \
1245 // RUN: --target=arm64-linux-android \
1246 // RUN: --gcc-toolchain="" \
1247 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1248 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-64 %s
1249 // RUN: %clang -### %s -no-pie 2>&1 \
1250 // RUN: --target=i686-linux-android \
1251 // RUN: --gcc-toolchain="" \
1252 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1253 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-32 %s
1254 // RUN: %clang -### %s -no-pie 2>&1 \
1255 // RUN: --target=x86_64-linux-android \
1256 // RUN: --gcc-toolchain="" \
1257 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1258 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-64 %s
1259 // CHECK-ANDROID-32: "-dynamic-linker" "/system/bin/linker"
1260 // CHECK-ANDROID-64: "-dynamic-linker" "/system/bin/linker64"
1262 // Test that Android 14 and newer use linker_hwasan64 for hwasan builds
1263 // RUN: %clang -### %s -no-pie 2>&1 \
1264 // RUN: -fsanitize=hwaddress \
1265 // RUN: --target=x86_64-linux-android33 \
1266 // RUN: --gcc-toolchain="" \
1267 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1268 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-OLD %s
1269 // RUN: %clang -### %s -no-pie 2>&1 \
1270 // RUN: -fsanitize=hwaddress \
1271 // RUN: --target=x86_64-linux-android34 \
1272 // RUN: --gcc-toolchain="" \
1273 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1274 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-NEW %s
1275 // CHECK-ANDROID-OLD: "-dynamic-linker" "/system/bin/linker64"
1276 // CHECK-ANDROID-NEW: "-dynamic-linker" "/system/bin/linker_hwasan64"
1278 // Test that -pthread does not add -lpthread on Android.
1279 // RUN: %clang -### %s -no-pie 2>&1 \
1280 // RUN: --target=arm-linux-androideabi -pthread \
1281 // RUN: --gcc-toolchain="" \
1282 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1283 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1284 // RUN: %clang -### %s -no-pie 2>&1 \
1285 // RUN: --target=arm-linux-android -pthread \
1286 // RUN: --gcc-toolchain="" \
1287 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1288 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1289 // RUN: %clang -### %s -no-pie 2>&1 \
1290 // RUN: --target=aarch64-linux-android -pthread \
1291 // RUN: --gcc-toolchain="" \
1292 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1293 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1294 // RUN: %clang -### %s -no-pie 2>&1 \
1295 // RUN: --target=arm64-linux-android -pthread \
1296 // RUN: --gcc-toolchain="" \
1297 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1298 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1299 // RUN: %clang -### %s -no-pie 2>&1 \
1300 // RUN: --target=i686-linux-android -pthread \
1301 // RUN: --gcc-toolchain="" \
1302 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1303 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1304 // RUN: %clang -### %s -no-pie 2>&1 \
1305 // RUN: --target=x86_64-linux-android -pthread \
1306 // RUN: --gcc-toolchain="" \
1307 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1308 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1309 // RUN: %clang -### %s -no-pie 2>&1 \
1310 // RUN: --target=arm-linux-androideabi -pthread \
1311 // RUN: --gcc-toolchain="" \
1312 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1314 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1315 // RUN: %clang -### %s -no-pie 2>&1 \
1316 // RUN: --target=arm-linux-android -pthread \
1317 // RUN: --gcc-toolchain="" \
1318 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1320 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1321 // RUN: %clang -### %s -no-pie 2>&1 \
1322 // RUN: --target=aarch64-linux-android -pthread \
1323 // RUN: --gcc-toolchain="" \
1324 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1326 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1327 // RUN: %clang -### %s -no-pie 2>&1 \
1328 // RUN: --target=arm64-linux-android -pthread \
1329 // RUN: --gcc-toolchain="" \
1330 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1332 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1333 // RUN: %clang -### %s -no-pie 2>&1 \
1334 // RUN: --target=i686-linux-android -pthread \
1335 // RUN: --gcc-toolchain="" \
1336 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1338 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1339 // RUN: %clang -### %s -no-pie 2>&1 \
1340 // RUN: --target=x86_64-linux-android -pthread \
1341 // RUN: --gcc-toolchain="" \
1342 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1344 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1345 // CHECK-ANDROID-PTHREAD-NOT: -lpthread
1347 // RUN: not %clang %t.o -no-pie -### -o %t 2>&1 \
1348 // RUN: --target=arm-linux-androideabi -pthread \
1349 // RUN: --gcc-toolchain="" \
1350 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
1351 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD-LINK %s
1352 // CHECK-ANDROID-PTHREAD-LINK-NOT: argument unused during compilation: '-pthread'
1354 // Check linker invocation on a Debian LoongArch sysroot.
1355 // RUN: %clang -### %s -no-pie 2>&1 \
1356 // RUN: --target=loongarch64-linux-gnu -rtlib=platform --unwindlib=platform \
1357 // RUN: --gcc-toolchain="" \
1358 // RUN: --sysroot=%S/Inputs/debian_loong64_tree \
1359 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-LOONG64 %s
1361 // Check that "-gnuf64" is seen as "-gnu" for loong64.
1362 // RUN: %clang -### %s -no-pie 2>&1 \
1363 // RUN: --target=loongarch64-linux-gnuf64 -rtlib=platform --unwindlib=platform \
1364 // RUN: --gcc-toolchain="" \
1365 // RUN: --sysroot=%S/Inputs/debian_loong64_tree \
1366 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-LOONG64 %s
1367 // CHECK-DEBIAN-ML-LOONG64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1368 // CHECK-DEBIAN-ML-LOONG64: "[[SYSROOT]]/usr/lib/loongarch64-linux-gnu/crt1.o"
1369 // CHECK-DEBIAN-ML-LOONG64: "[[SYSROOT]]/usr/lib/loongarch64-linux-gnu/crti.o"
1370 // CHECK-DEBIAN-ML-LOONG64: "[[SYSROOT]]/usr/lib/gcc/loongarch64-linux-gnu/13/crtbegin.o"
1371 // CHECK-DEBIAN-ML-LOONG64: "-L[[SYSROOT]]/usr/lib/gcc/loongarch64-linux-gnu/13"
1372 // CHECK-DEBIAN-ML-LOONG64: "-L[[SYSROOT]]/usr/lib/loongarch64-linux-gnu"
1373 // CHECK-DEBIAN-ML-LOONG64: "-L[[SYSROOT]]/usr/lib"
1374 // CHECK-DEBIAN-ML-LOONG64: "[[SYSROOT]]/usr/lib/gcc/loongarch64-linux-gnu/13/crtend.o"
1375 // CHECK-DEBIAN-ML-LOONG64: "[[SYSROOT]]/usr/lib/loongarch64-linux-gnu/crtn.o"
1377 // Check linker invocation on Debian 6 MIPS 32/64-bit.
1378 // RUN: %clang -### %s -no-pie 2>&1 \
1379 // RUN: --target=mipsel-linux-gnu -rtlib=platform --unwindlib=platform \
1380 // RUN: --gcc-toolchain="" \
1381 // RUN: --sysroot=%S/Inputs/debian_6_mips_tree \
1382 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPSEL %s
1383 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1384 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib{{/|\\\\}}crt1.o"
1385 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib{{/|\\\\}}crti.o"
1386 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4{{/|\\\\}}crtbegin.o"
1387 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4"
1388 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib"
1389 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib/../lib"
1390 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/../lib"
1391 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib"
1392 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib"
1394 // RUN: %clang -### %s -no-pie 2>&1 \
1395 // RUN: --target=mips64el-linux-gnu -rtlib=platform --unwindlib=platform \
1396 // RUN: --gcc-toolchain="" \
1397 // RUN: --sysroot=%S/Inputs/debian_6_mips_tree \
1398 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL %s
1399 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1400 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64{{/|\\\\}}crt1.o"
1401 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64{{/|\\\\}}crti.o"
1402 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/64{{/|\\\\}}crtbegin.o"
1403 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/64"
1404 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64"
1405 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib/../lib64"
1406 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/../lib64"
1407 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib"
1408 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib"
1410 // RUN: %clang -### %s -no-pie 2>&1 \
1411 // RUN: --target=mips64el-linux-gnu -rtlib=platform --unwindlib=platform -mabi=n32 \
1412 // RUN: --gcc-toolchain="" \
1413 // RUN: --sysroot=%S/Inputs/debian_6_mips_tree \
1414 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-N32 %s
1415 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1416 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32{{/|\\\\}}crt1.o"
1417 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32{{/|\\\\}}crti.o"
1418 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/n32{{/|\\\\}}crtbegin.o"
1419 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/n32"
1420 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32"
1421 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib/../lib32"
1422 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/../lib32"
1423 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib"
1424 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib"
1426 // RUN: %clang -### %s -no-pie 2>&1 \
1427 // RUN: --target=mips64el-linux-gnuabi64 -rtlib=platform --unwindlib=platform -mabi=32 \
1428 // RUN: --gcc-toolchain="" \
1429 // RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \
1430 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-O32 %s
1431 // CHECK-DEBIAN-ML-MIPS64EL-O32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1432 // CHECK-DEBIAN-ML-MIPS64EL-O32: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../../libo32{{/|\\\\}}crt1.o"
1433 // CHECK-DEBIAN-ML-MIPS64EL-O32: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../../libo32{{/|\\\\}}crti.o"
1434 // CHECK-DEBIAN-ML-MIPS64EL-O32: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/32{{/|\\\\}}crtbegin.o"
1435 // CHECK-DEBIAN-ML-MIPS64EL-O32: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/32"
1436 // CHECK-DEBIAN-ML-MIPS64EL-O32: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../../libo32"
1437 // CHECK-DEBIAN-ML-MIPS64EL-O32: "-L[[SYSROOT]]/libo32"
1438 // CHECK-DEBIAN-ML-MIPS64EL-O32: "-L[[SYSROOT]]/usr/libo32"
1439 // CHECK-DEBIAN-ML-MIPS64EL-O32: "-L[[SYSROOT]]/lib"
1440 // CHECK-DEBIAN-ML-MIPS64EL-O32: "-L[[SYSROOT]]/usr/lib"
1442 // RUN: %clang -### %s -no-pie 2>&1 \
1443 // RUN: --target=mips64-unknown-linux-gnu --rtlib=platform --unwindlib=platform \
1444 // RUN: --gcc-toolchain="" \
1445 // RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \
1446 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64-GNUABI %s
1447 // RUN: %clang -### %s -no-pie 2>&1 \
1448 // RUN: --target=mips64-linux-gnuabi64 -rtlib=platform --unwindlib=platform -mabi=n64 \
1449 // RUN: --gcc-toolchain="" \
1450 // RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \
1451 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64-GNUABI %s
1452 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1453 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/mips64-linux-gnuabi64{{/|\\\\}}crt1.o"
1454 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/mips64-linux-gnuabi64{{/|\\\\}}crti.o"
1455 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9{{/|\\\\}}crtbegin.o"
1456 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9"
1457 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/lib/mips64-linux-gnuabi64"
1458 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/mips64-linux-gnuabi64"
1459 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/lib"
1460 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib"
1461 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9{{/|\\\\}}crtend.o"
1462 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/mips64-linux-gnuabi64{{/|\\\\}}crtn.o"
1464 // RUN: %clang -### %s -no-pie 2>&1 \
1465 // RUN: --target=mips64el-unknown-linux-gnu -rtlib=platform --unwindlib=platform \
1466 // RUN: --gcc-toolchain="" \
1467 // RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \
1468 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-GNUABI %s
1469 // RUN: %clang -### %s -no-pie 2>&1 \
1470 // RUN: --target=mips64el-linux-gnuabi64 -rtlib=platform --unwindlib=platform -mabi=n64 \
1471 // RUN: --gcc-toolchain="" \
1472 // RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \
1473 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-GNUABI %s
1474 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1475 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/mips64el-linux-gnuabi64{{/|\\\\}}crt1.o"
1476 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/mips64el-linux-gnuabi64{{/|\\\\}}crti.o"
1477 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9{{/|\\\\}}crtbegin.o"
1478 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9"
1479 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/lib/mips64el-linux-gnuabi64"
1480 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/mips64el-linux-gnuabi64"
1481 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/lib"
1482 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib"
1483 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9{{/|\\\\}}crtend.o"
1484 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/mips64el-linux-gnuabi64{{/|\\\\}}crtn.o"
1486 // Test linker invocation for Freescale SDK (OpenEmbedded).
1487 // RUN: %clang -### %s -no-pie 2>&1 \
1488 // RUN: --target=powerpc-fsl-linux -rtlib=platform --unwindlib=platform \
1489 // RUN: --gcc-toolchain="" \
1490 // RUN: --sysroot=%S/Inputs/freescale_ppc_tree \
1491 // RUN: | FileCheck --check-prefix=CHECK-FSL-PPC %s
1492 // CHECK-FSL-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1493 // CHECK-FSL-PPC: "-m" "elf32ppclinux"
1494 // CHECK-FSL-PPC: "{{.*}}{{/|\\\\}}crt1.o"
1495 // CHECK-FSL-PPC: "{{.*}}{{/|\\\\}}crtbegin.o"
1496 // CHECK-FSL-PPC: "-L[[SYSROOT]]/usr/lib"
1497 // RUN: %clang -### %s -no-pie 2>&1 \
1498 // RUN: --target=powerpc64-fsl-linux -rtlib=platform --unwindlib=platform \
1499 // RUN: --gcc-toolchain="" \
1500 // RUN: --sysroot=%S/Inputs/freescale_ppc64_tree \
1501 // RUN: | FileCheck --check-prefix=CHECK-FSL-PPC64 %s
1502 // CHECK-FSL-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1503 // CHECK-FSL-PPC64: "-m" "elf64ppc"
1504 // CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crt1.o"
1505 // CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crtbegin.o"
1507 // Check that crtfastmath.o is linked with -ffast-math and with -Ofast.
1508 // RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s \
1509 // RUN: --gcc-toolchain="" \
1510 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1511 // RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
1512 // RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -ffast-math \
1513 // RUN: --gcc-toolchain="" \
1514 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1515 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1516 // RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -funsafe-math-optimizations\
1517 // RUN: --gcc-toolchain="" \
1518 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1519 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1520 // RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -Ofast\
1521 // RUN: --gcc-toolchain="" \
1522 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1523 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1524 // RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -Ofast -O3\
1525 // RUN: --gcc-toolchain="" \
1526 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1527 // RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
1528 // RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -O3 -Ofast\
1529 // RUN: --gcc-toolchain="" \
1530 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1531 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1532 // RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -ffast-math -fno-fast-math \
1533 // RUN: --gcc-toolchain="" \
1534 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1535 // RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
1536 // RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -Ofast -fno-fast-math \
1537 // RUN: --gcc-toolchain="" \
1538 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1539 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1540 // RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -Ofast -fno-unsafe-math-optimizations \
1541 // RUN: --gcc-toolchain="" \
1542 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1543 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1544 // RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -fno-fast-math -Ofast \
1545 // RUN: --gcc-toolchain="" \
1546 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1547 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1548 // RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -fno-unsafe-math-optimizations -Ofast \
1549 // RUN: --gcc-toolchain="" \
1550 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1551 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1552 // We don't have crtfastmath.o in the i386 tree, use it to check that file
1554 // RUN: %clang --target=i386-unknown-linux -no-pie -### %s -ffast-math \
1555 // RUN: --gcc-toolchain="" \
1556 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1557 // RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
1558 // CHECK-CRTFASTMATH: usr/lib/gcc/x86_64-unknown-linux/10.2.0{{/|\\\\}}crtfastmath.o
1559 // CHECK-NOCRTFASTMATH-NOT: crtfastmath.o
1561 // Check that we link in gcrt1.o when compiling with -pg
1562 // RUN: %clang -pg --target=x86_64-unknown-linux -no-pie -### %s \
1563 // RUN: --gcc-toolchain="" \
1564 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \
1565 // RUN: | FileCheck --check-prefix=CHECK-PG %s
1566 // CHECK-PG: gcrt1.o
1568 // GCC forwards -u to the linker.
1569 // RUN: %clang -u asdf --target=x86_64-unknown-linux -no-pie -### %s \
1570 // RUN: --gcc-toolchain="" \
1571 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \
1572 // RUN: | FileCheck --check-prefix=CHECK-u %s
1573 // CHECK-u: "-u" "asdf"
1575 // RUN: %clang -### %s -no-pie 2>&1 \
1576 // RUN: --target=armeb-unknown-linux \
1577 // RUN: --gcc-toolchain="" \
1578 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
1579 // RUN: | FileCheck --check-prefix=CHECK-ARMEB %s
1580 // CHECK-ARMEB: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1581 // CHECK-ARMEB-NOT: "--be8"
1582 // CHECK-ARMEB: "-EB"
1583 // CHECK-ARMEB: "-m" "armelfb_linux_eabi"
1585 // RUN: %clang -### %s -no-pie 2>&1 \
1586 // RUN: --target=armebv7-unknown-linux \
1587 // RUN: --gcc-toolchain="" \
1588 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
1589 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EB %s
1590 // CHECK-ARMV7EB: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1591 // CHECK-ARMV7EB: "--be8"
1592 // CHECK-ARMV7EB: "-EB"
1593 // CHECK-ARMV7EB: "-m" "armelfb_linux_eabi"
1595 // RUN: %clang -### %s -no-pie 2>&1 \
1596 // RUN: --target=armv7-unknown-linux \
1597 // RUN: -mbig-endian \
1598 // RUN: --gcc-toolchain="" \
1599 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
1600 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EB %s
1602 // RUN: %clang -### %s -no-pie 2>&1 \
1603 // RUN: --target=armebv7-unknown-linux \
1604 // RUN: -mbig-endian \
1605 // RUN: --gcc-toolchain="" \
1606 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
1607 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EB %s
1609 // RUN: %clang -### %s -no-pie 2>&1 \
1610 // RUN: --target=armv7-unknown-linux \
1611 // RUN: --gcc-toolchain="" \
1612 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
1613 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EL %s
1614 // CHECK-ARMV7EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1615 // CHECK-ARMV7EL-NOT: "--be8"
1616 // CHECK-ARMV7EL: "-EL"
1617 // CHECK-ARMV7EL: "-m" "armelf_linux_eabi"
1619 // RUN: %clang -### %s -no-pie 2>&1 \
1620 // RUN: --target=armebv7-unknown-linux \
1621 // RUN: -mlittle-endian \
1622 // RUN: --gcc-toolchain="" \
1623 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
1624 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EL %s
1626 // RUN: %clang -### %s -no-pie 2>&1 \
1627 // RUN: --target=armv7-unknown-linux \
1628 // RUN: -mlittle-endian \
1629 // RUN: --gcc-toolchain="" \
1630 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
1631 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EL %s
1633 // RUN: %clang -### %s -no-pie 2>&1 \
1634 // RUN: --target=aarch64_be-unknown-linux \
1635 // RUN: --gcc-toolchain="" \
1636 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
1637 // RUN: | FileCheck --check-prefix=CHECK-AARCH64BE %s
1638 // CHECK-AARCH64BE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1639 // CHECK-AARCH64BE-NOT: "--be8"
1640 // CHECK-AARCH64BE: "-EB"
1641 // CHECK-AARCH64BE: "-m" "aarch64linuxb"
1643 // RUN: %clang -### %s -no-pie 2>&1 \
1644 // RUN: --target=aarch64-unknown-linux \
1645 // RUN: -mbig-endian \
1646 // RUN: --gcc-toolchain="" \
1647 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
1648 // RUN: | FileCheck --check-prefix=CHECK-AARCH64BE %s
1650 // RUN: %clang -### %s -no-pie 2>&1 \
1651 // RUN: --target=aarch64_be-unknown-linux \
1652 // RUN: -mbig-endian \
1653 // RUN: --gcc-toolchain="" \
1654 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
1655 // RUN: | FileCheck --check-prefix=CHECK-AARCH64BE %s
1657 // RUN: %clang -### %s -no-pie 2>&1 \
1658 // RUN: --target=aarch64-unknown-linux \
1659 // RUN: --gcc-toolchain="" \
1660 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
1661 // RUN: | FileCheck --check-prefix=CHECK-AARCH64LE %s
1662 // CHECK-AARCH64LE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1663 // CHECK-AARCH64LE-NOT: "--be8"
1664 // CHECK-AARCH64LE: "-EL"
1665 // CHECK-AARCH64LE: "-m" "aarch64linux"
1667 // RUN: %clang -### %s -no-pie 2>&1 \
1668 // RUN: --target=aarch64_be-unknown-linux \
1669 // RUN: -mlittle-endian \
1670 // RUN: --gcc-toolchain="" \
1671 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
1672 // RUN: | FileCheck --check-prefix=CHECK-AARCH64LE %s
1674 // Check dynamic-linker for musl-libc
1675 // RUN: %clang -### %s -no-pie 2>&1 \
1676 // RUN: --target=i386-pc-linux-musl \
1677 // RUN: | FileCheck --check-prefix=CHECK-MUSL-X86 %s
1678 // RUN: %clang -### %s -no-pie 2>&1 \
1679 // RUN: --target=x86_64-pc-linux-musl \
1680 // RUN: | FileCheck --check-prefix=CHECK-MUSL-X86_64 %s
1681 // RUN: %clang -### %s -no-pie 2>&1 \
1682 // RUN: --target=mips-pc-linux-musl \
1683 // RUN: | FileCheck --check-prefix=CHECK-MUSL-MIPS %s
1684 // RUN: %clang -### %s -no-pie 2>&1 \
1685 // RUN: --target=mipsel-pc-linux-musl \
1686 // RUN: | FileCheck --check-prefix=CHECK-MUSL-MIPSEL %s
1687 // RUN: %clang -### %s -no-pie 2>&1 \
1688 // RUN: --target=mips64-pc-linux-musl \
1689 // RUN: | FileCheck --check-prefix=CHECK-MUSL-MIPS64 %s
1690 // RUN: %clang -### %s -no-pie 2>&1 \
1691 // RUN: --target=mips64el-pc-linux-musl \
1692 // RUN: | FileCheck --check-prefix=CHECK-MUSL-MIPS64EL %s
1693 // RUN: %clang -### %s -no-pie 2>&1 \
1694 // RUN: --target=powerpc-pc-linux-musl \
1695 // RUN: | FileCheck --check-prefix=CHECK-MUSL-PPC %s
1696 // RUN: %clang -### %s -no-pie 2>&1 \
1697 // RUN: --target=powerpc64-pc-linux-musl \
1698 // RUN: | FileCheck --check-prefix=CHECK-MUSL-PPC64 %s
1699 // RUN: %clang -### %s -no-pie 2>&1 \
1700 // RUN: --target=powerpcspe-pc-linux-musl \
1701 // RUN: | FileCheck --check-prefix=CHECK-MUSL-PPCSPE %s
1702 // RUN: %clang -### %s -no-pie 2>&1 \
1703 // RUN: --target=thumb-pc-linux-musleabi \
1704 // RUN: | FileCheck --check-prefix=CHECK-MUSL-ARM %s
1705 // RUN: %clang -### %s -no-pie 2>&1 \
1706 // RUN: --target=thumb-pc-linux-musleabihf \
1707 // RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMHF %s
1708 // RUN: %clang -### %s -no-pie 2>&1 \
1709 // RUN: --target=thumbv7-pc-linux-musleabi -mhard-float \
1710 // RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMHF %s
1711 // RUN: %clang -### %s -no-pie 2>&1 \
1712 // RUN: --target=thumbeb-pc-linux-musleabi \
1713 // RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMEB %s
1714 // RUN: %clang -### %s -no-pie 2>&1 \
1715 // RUN: --target=thumbeb-pc-linux-musleabihf \
1716 // RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMEBHF %s
1717 // RUN: %clang -### %s -no-pie 2>&1 \
1718 // RUN: --target=thumbv7eb-pc-linux-musleabi -mhard-float \
1719 // RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMEBHF %s
1720 // RUN: %clang -### %s -no-pie 2>&1 \
1721 // RUN: --target=arm-pc-linux-musleabi \
1722 // RUN: | FileCheck --check-prefix=CHECK-MUSL-ARM %s
1723 // RUN: %clang -### %s -no-pie 2>&1 \
1724 // RUN: --target=arm-pc-linux-musleabihf \
1725 // RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMHF %s
1726 // RUN: %clang -### %s -no-pie 2>&1 \
1727 // RUN: --target=armv7-pc-linux-musleabi -mhard-float \
1728 // RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMHF %s
1729 // RUN: %clang -### %s -no-pie 2>&1 \
1730 // RUN: --target=armeb-pc-linux-musleabi \
1731 // RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMEB %s
1732 // RUN: %clang -### %s -no-pie 2>&1 \
1733 // RUN: --target=armeb-pc-linux-musleabihf \
1734 // RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMEBHF %s
1735 // RUN: %clang -### %s -no-pie 2>&1 \
1736 // RUN: --target=armv7eb-pc-linux-musleabi -mhard-float \
1737 // RUN: | FileCheck --check-prefix=CHECK-MUSL-ARMEBHF %s
1738 // RUN: %clang -### %s -no-pie 2>&1 \
1739 // RUN: --target=aarch64-pc-linux-musleabi \
1740 // RUN: | FileCheck --check-prefix=CHECK-MUSL-AARCH64 %s
1741 // RUN: %clang -### %s -no-pie 2>&1 \
1742 // RUN: --target=aarch64_be-pc-linux-musleabi \
1743 // RUN: | FileCheck --check-prefix=CHECK-MUSL-AARCH64_BE %s
1744 // CHECK-MUSL-X86: "-dynamic-linker" "/lib/ld-musl-i386.so.1"
1745 // CHECK-MUSL-X86_64: "-dynamic-linker" "/lib/ld-musl-x86_64.so.1"
1746 // CHECK-MUSL-MIPS: "-dynamic-linker" "/lib/ld-musl-mips.so.1"
1747 // CHECK-MUSL-MIPSEL: "-dynamic-linker" "/lib/ld-musl-mipsel.so.1"
1748 // CHECK-MUSL-MIPS64: "-dynamic-linker" "/lib/ld-musl-mips64.so.1"
1749 // CHECK-MUSL-MIPS64EL: "-dynamic-linker" "/lib/ld-musl-mips64el.so.1"
1750 // CHECK-MUSL-PPC: "-dynamic-linker" "/lib/ld-musl-powerpc.so.1"
1751 // CHECK-MUSL-PPC64: "-dynamic-linker" "/lib/ld-musl-powerpc64.so.1"
1752 // CHECK-MUSL-PPCSPE: "-dynamic-linker" "/lib/ld-musl-powerpc-sf.so.1"
1753 // CHECK-MUSL-ARM: "-dynamic-linker" "/lib/ld-musl-arm.so.1"
1754 // CHECK-MUSL-ARMHF: "-dynamic-linker" "/lib/ld-musl-armhf.so.1"
1755 // CHECK-MUSL-ARMEB: "-dynamic-linker" "/lib/ld-musl-armeb.so.1"
1756 // CHECK-MUSL-ARMEBHF: "-dynamic-linker" "/lib/ld-musl-armebhf.so.1"
1757 // CHECK-MUSL-AARCH64: "-dynamic-linker" "/lib/ld-musl-aarch64.so.1"
1758 // CHECK-MUSL-AARCH64_BE: "-dynamic-linker" "/lib/ld-musl-aarch64_be.so.1"
1760 // Check whether multilib gcc install works fine on Gentoo with gcc-config
1761 // RUN: %clang -### %s -no-pie 2>&1 \
1762 // RUN: --target=x86_64-unknown-linux-gnu -rtlib=platform --unwindlib=platform \
1763 // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
1764 // RUN: --gcc-toolchain="" \
1765 // RUN: | FileCheck --check-prefix=CHECK-LD-GENTOO %s
1766 // CHECK-LD-GENTOO-NOT: warning:
1767 // CHECK-LD-GENTOO: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1768 // CHECK-LD-GENTOO: "--eh-frame-hdr"
1769 // CHECK-LD-GENTOO: "-m" "elf_x86_64"
1770 // CHECK-LD-GENTOO: "-dynamic-linker"
1771 // CHECK-LD-GENTOO: "{{.*}}/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3{{/|\\\\}}crtbegin.o"
1772 // CHECK-LD-GENTOO: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3"
1773 // CHECK-LD-GENTOO: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/lib"
1774 // CHECK-LD-GENTOO: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
1775 // CHECK-LD-GENTOO: "-lc"
1776 // CHECK-LD-GENTOO: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
1777 // RUN: %clang -### %s -no-pie 2>&1 \
1778 // RUN: --target=i686-unknown-linux-gnu -rtlib=platform --unwindlib=platform \
1779 // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
1780 // RUN: --gcc-toolchain="" \
1781 // RUN: | FileCheck --check-prefix=CHECK-LD-GENTOO-32 %s
1782 // CHECK-LD-GENTOO-32-NOT: warning:
1783 // CHECK-LD-GENTOO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1784 // CHECK-LD-GENTOO-32: "--eh-frame-hdr"
1785 // CHECK-LD-GENTOO-32: "-m" "elf_i386"
1786 // CHECK-LD-GENTOO-32: "-dynamic-linker"
1787 // CHECK-LD-GENTOO-32: "{{.*}}/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/32{{/|\\\\}}crtbegin.o"
1788 // CHECK-LD-GENTOO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/32"
1789 // CHECK-LD-GENTOO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/lib"
1790 // CHECK-LD-GENTOO-32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
1791 // CHECK-LD-GENTOO-32: "-lc"
1792 // CHECK-LD-GENTOO-32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
1793 // RUN: %clang -### %s -no-pie 2>&1 \
1794 // RUN: --target=x86_64-unknown-linux-gnux32 -rtlib=platform --unwindlib=platform \
1795 // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
1796 // RUN: --gcc-toolchain="" \
1797 // RUN: | FileCheck --check-prefix=CHECK-LD-GENTOO-X32 %s
1798 // CHECK-LD-GENTOO-X32-NOT: warning:
1799 // CHECK-LD-GENTOO-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1800 // CHECK-LD-GENTOO-X32: "--eh-frame-hdr"
1801 // CHECK-LD-GENTOO-X32: "-m" "elf32_x86_64"
1802 // CHECK-LD-GENTOO-X32: "-dynamic-linker"
1803 // CHECK-LD-GENTOO-X32: "{{.*}}/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/x32{{/|\\\\}}crtbegin.o"
1804 // CHECK-LD-GENTOO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/x32"
1805 // CHECK-LD-GENTOO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/lib"
1806 // CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
1807 // CHECK-LD-GENTOO-X32: "-lc"
1808 // CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
1810 // RUN: %clang -### %s -no-pie -fuse-ld=ld 2>&1 \
1811 // RUN: --target=x86_64-unknown-linux-gnu \
1812 // RUN: --gcc-toolchain="%S/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr" \
1813 // RUN: --sysroot="%S/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root" \
1814 // RUN: | FileCheck --check-prefix=CHECK-LD-RHEL7-DTS %s
1815 // CHECK-LD-RHEL7-DTS: "-isysroot" "[[SYSROOT:[^"]+]]"
1816 // CHECK-LD-RHEL7-DTS-NOT: /usr/bin/ld
1817 // CHECK-LD-RHEL7-DTS: [[SYSROOT]]/usr/lib/gcc/x86_64-redhat-linux/7/../../../../bin/ld
1819 // Check whether gcc7 install works fine on Amazon Linux AMI
1820 // RUN: %clang -### %s -no-pie 2>&1 \
1821 // RUN: --target=x86_64-amazon-linux -rtlib=libgcc --unwindlib=platform \
1822 // RUN: --gcc-toolchain="" \
1823 // RUN: --sysroot=%S/Inputs/ami_linux_tree \
1824 // RUN: | FileCheck --check-prefix=CHECK-LD-AMI %s
1825 // CHECK-LD-AMI-NOT: warning:
1826 // CHECK-LD-AMI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1827 // CHECK-LD-AMI: "--eh-frame-hdr"
1828 // CHECK-LD-AMI: "-m" "elf_x86_64"
1829 // CHECK-LD-AMI: "-dynamic-linker"
1830 // CHECK-LD-AMI: "{{.*}}/usr/lib/gcc/x86_64-amazon-linux/7{{/|\\\\}}crtbegin.o"
1831 // CHECK-LD-AMI: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-amazon-linux/7"
1832 // CHECK-LD-AMI: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-amazon-linux/7/../../../../lib64"
1833 // CHECK-LD-AMI: "-L[[SYSROOT]]/lib"
1834 // CHECK-LD-AMI: "-L[[SYSROOT]]/usr/lib"
1835 // CHECK-LD-AMI: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
1836 // CHECK-LD-AMI: "-lc"
1837 // CHECK-LD-AMI: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
1839 // Check whether the OpenEmbedded ARM libs are added correctly.
1840 // RUN: %clang -### %s -no-pie 2>&1 \
1841 // RUN: --target=arm-oe-linux-gnueabi -rtlib=libgcc --unwindlib=platform \
1842 // RUN: --gcc-toolchain="" \
1843 // RUN: --sysroot=%S/Inputs/openembedded_arm_linux_tree \
1844 // RUN: | FileCheck --check-prefix=CHECK-OE-ARM %s
1846 // CHECK-OE-ARM: "-cc1" "-triple" "armv4t-oe-linux-gnueabi"
1847 // CHECK-OE-ARM: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
1848 // CHECK-OE-ARM: "-m" "armelf_linux_eabi" "-dynamic-linker"
1849 // CHECK-OE-ARM: "[[SYSROOT]]/usr/lib/arm-oe-linux-gnueabi/6.3.0/../../../lib{{/|\\\\}}crt1.o"
1850 // CHECK-OE-ARM: "[[SYSROOT]]/usr/lib/arm-oe-linux-gnueabi/6.3.0/../../../lib{{/|\\\\}}crti.o"
1851 // CHECK-OE-ARM: "[[SYSROOT]]/usr/lib/arm-oe-linux-gnueabi/6.3.0{{/|\\\\}}crtbegin.o"
1852 // CHECK-OE-ARM: "-L[[SYSROOT]]/usr/lib/arm-oe-linux-gnueabi/6.3.0"
1853 // CHECK-OE-ARM: "-L[[SYSROOT]]/usr/lib"
1854 // CHECK-OE-ARM: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
1855 // CHECK-OE-ARM: "[[SYSROOT]]/usr/lib/arm-oe-linux-gnueabi/6.3.0{{/|\\\\}}crtend.o"
1856 // CHECK-OE-ARM: "[[SYSROOT]]/usr/lib/arm-oe-linux-gnueabi/6.3.0/../../../lib{{/|\\\\}}crtn.o"
1858 // Check whether the OpenEmbedded AArch64 libs are added correctly.
1859 // RUN: %clang -### %s -no-pie 2>&1 \
1860 // RUN: --target=aarch64-oe-linux -rtlib=libgcc --unwindlib=platform \
1861 // RUN: --gcc-toolchain="" \
1862 // RUN: --sysroot=%S/Inputs/openembedded_aarch64_linux_tree \
1863 // RUN: | FileCheck --check-prefix=CHECK-OE-AARCH64 %s
1865 // CHECK-OE-AARCH64: "-cc1" "-triple" "aarch64-oe-linux"
1866 // CHECK-OE-AARCH64: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
1867 // CHECK-OE-AARCH64: "-m" "aarch64linux" "-dynamic-linker"
1868 // CHECK-OE-AARCH64: "[[SYSROOT]]/usr/lib64/aarch64-oe-linux/6.3.0/../../../lib64{{/|\\\\}}crt1.o"
1869 // CHECK-OE-AARCH64: "[[SYSROOT]]/usr/lib64/aarch64-oe-linux/6.3.0/../../../lib64{{/|\\\\}}crti.o"
1870 // CHECK-OE-AARCH64: "[[SYSROOT]]/usr/lib64/aarch64-oe-linux/6.3.0{{/|\\\\}}crtbegin.o"
1871 // CHECK-OE-AARCH64: "-L[[SYSROOT]]/usr/lib64/aarch64-oe-linux/6.3.0"
1872 // CHECK-OE-AARCH64: "-L[[SYSROOT]]/usr/lib64"
1873 // CHECK-OE-AARCH64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
1874 // CHECK-OE-AARCH64: "[[SYSROOT]]/usr/lib64/aarch64-oe-linux/6.3.0{{/|\\\\}}crtend.o"
1875 // CHECK-OE-AARCH64: "[[SYSROOT]]/usr/lib64/aarch64-oe-linux/6.3.0/../../../lib64{{/|\\\\}}crtn.o"