-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang][driver] Fix -print-libgcc-file-name on Darwin platforms #98325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// Test the output of -print-libgcc-file-name on Darwin. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like the embedded targets are already tested to some extent inside
I'm not certain what we're testing, but we're testing the behavior that seems to exist today, so at least we'll have coverage for whatever we do today. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added these tests and unfortunately they fail (both before and after my change). I believe part of the problem is that The proper fix would be really involved. I shortly experimented with moving the processing of I am not really sure what is the correct solution here, I start to think that the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ack. I think it's reasonable not to try to fix everything in one go since it seems really involved. However, my thinking is more that the Darwin driver is the odd one out here, the driver should be initialized when we construct it, not "lazily" when we compute the arguments. I think it's the only driver which does that, and isn't that the source of all our problems? |
||
|
||
// | ||
// 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 | ||
|
||
// | ||
// Simulators | ||
// | ||
|
||
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \ | ||
// RUN: --target=arm64-apple-ios-simulator \ | ||
// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \ | ||
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-IOS-SIMULATOR %s | ||
// CHECK-CLANGRT-IOS-SIMULATOR: libclang_rt.iossim.a | ||
|
||
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \ | ||
// RUN: --target=arm64-apple-watchos-simulator \ | ||
// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \ | ||
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-WATCHOS-SIMULATOR %s | ||
// CHECK-CLANGRT-WATCHOS-SIMULATOR: libclang_rt.watchossim.a | ||
|
||
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \ | ||
// RUN: --target=arm64-apple-tvos-simulator \ | ||
// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \ | ||
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-TVOS-SIMULATOR %s | ||
// CHECK-CLANGRT-TVOS-SIMULATOR: libclang_rt.tvossim.a | ||
|
||
// Check the sanitizer and profile variants | ||
Xazax-hun marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// While the driver also links in sanitizer-specific dylibs, the result of | ||
// -print-libgcc-file-name is the path of the basic compiler-rt library. | ||
|
||
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \ | ||
// RUN: -fsanitize=address --target=x86_64-apple-macos \ | ||
// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \ | ||
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-MACOS-SAN %s | ||
// CHECK-CLANGRT-MACOS-SAN: libclang_rt.osx.a | ||
|
||
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \ | ||
// RUN: -fsanitize=address --target=arm64-apple-ios \ | ||
// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \ | ||
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-IOS-SAN %s | ||
// CHECK-CLANGRT-IOS-SAN: libclang_rt.ios.a | ||
|
||
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \ | ||
// RUN: -fsanitize=address --target=arm64-apple-watchos \ | ||
// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \ | ||
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-WATCHOS-SAN %s | ||
// CHECK-CLANGRT-WATCHOS-SAN: libclang_rt.watchos.a | ||
|
||
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \ | ||
// RUN: -fsanitize=address --target=arm64-apple-tvos \ | ||
// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \ | ||
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-TVOS-SAN %s | ||
// CHECK-CLANGRT-TVOS-SAN: libclang_rt.tvos.a | ||
|
||
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name \ | ||
// RUN: -fsanitize=address --target=arm64-apple-driverkit \ | ||
// RUN: -resource-dir=%S/Inputs/resource_dir 2>&1 \ | ||
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-DRIVERKIT-SAN %s | ||
// CHECK-CLANGRT-DRIVERKIT-SAN: libclang_rt.driverkit.a |
Uh oh!
There was an error while loading. Please reload this page.