[clang] Fix --print-libgcc-file-name on Darwin platforms (PR #98325)
Louis Dionne via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 10 07:40:52 PDT 2024
================
@@ -0,0 +1,55 @@
+// Test the output of -print-libgcc-file-name on Darwin.
+
+//
+// All platforms
+//
+
+// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \
+// RUN: --target=x86_64-apple-macos \
+// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-MACOS %s
+// CHECK-CLANGRT-MACOS: libclang_rt.osx.a
+
+// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \
+// RUN: --target=arm64-apple-ios \
+// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-IOS %s
+// CHECK-CLANGRT-IOS: libclang_rt.ios.a
+
+// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \
+// RUN: --target=arm64-apple-watchos \
+// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-WATCHOS %s
+// CHECK-CLANGRT-WATCHOS: libclang_rt.watchos.a
+
+// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \
+// RUN: --target=arm64-apple-tvos \
+// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-TVOS %s
+// CHECK-CLANGRT-TVOS: libclang_rt.tvos.a
+
+// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \
+// RUN: --target=arm64-apple-driverkit \
+// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-DRIVERKIT %s
+// CHECK-CLANGRT-DRIVERKIT: libclang_rt.driverkit.a
+
+// TODO add simulators
+
+//
+// Check the cc_kext variants
+//
+
+// TODO
+
+//
+// Check the sanitizer and profile variants
+//
+
+// TODO
----------------
ldionne wrote:
I'm actually not sure what to do about sanitizers. I am figuring out which libraries we're actually linking by running this command and looking at what we link:
```
echo | xcrun --sdk <SDK> clang++ -### -fsanitize=address -xc++ -
```
For the sanitizers, I see that we link both `libclang_rt.osx.a` and `libclang_rt.asan_osx_dynamic.dylib`. I am not certain what we should output as the result of `-print-libgcc-file-name`.
https://github.com/llvm/llvm-project/pull/98325
More information about the cfe-commits
mailing list