Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "[clang] Don't spuriously pass -stdlib=libc++ to CC1 on Darwin"
This broke the instrprof-darwin-exports.c test on mac, see e.g. https://green.lab.llvm.org/green/job/clang-stage1-RA/32351/ > Previously, we would be passing down -stdlib=libc++ from the Driver > to CC1 whenever the default standard library on the platform was libc++, > even if -stdlib= had not been passed to the Driver. This meant that we > would pass -stdlib=libc++ in nonsensical circumstances, such as when > compiling C code. > > This logic had been added in b534ce4 to make sure that header > search paths were set up properly. However, since libc++ is now the > default Standard Library on Darwin, passing this explicitly is not > required anymore. Indeed, if no -stdlib= is specified, CC1 will end > up using libc++ if it queries which standard library to use, without > having to be told. > > Not passing -stdlib= at all to CC1 on Darwin should become possible > once CC1 stops relying on it to set up framework search paths. > > Furthermore, this commit also removes a diagnostic checking whether the > deployment target is too old to support libc++. Nowadays, all supported > deployment targets use libc++ and compiling with libstdc++ is not > supported anymore. The Driver was the wrong place to issue this > diagnostic since it doesn't know whether libc++ will actually be linked > against (e.g. C vs C++), which would lead to spurious diagnostics. > Given that these targets are not supported anymore, we simply drop > the diagnostic instead of trying to refactor it into CC1. > > rdar://103198514 > > Differential Revision: https://reviews.llvm.org/D139938 This reverts commit 6540f32.
- Loading branch information
Showing
5 changed files
with
31 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,10 @@ | ||
// Make sure that the Driver passes down -stdlib=libc++ to CC1 when specified explicitly. | ||
// | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch arm64 -miphoneos-version-min=7.0 -stdlib=libc++ %s -### 2>&1 | FileCheck --check-prefix=CHECK-LIBCXX %s | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -mmacosx-version-min=10.9 -stdlib=libc++ %s -### 2>&1 | FileCheck --check-prefix=CHECK-LIBCXX %s | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7s -miphoneos-version-min=7.0 -stdlib=libc++ %s -### 2>&1 | FileCheck --check-prefix=CHECK-LIBCXX %s | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7k -stdlib=libc++ %s -### 2>&1 | FileCheck --check-prefix=CHECK-LIBCXX %s | ||
// CHECK-LIBCXX: "-stdlib=libc++" | ||
// CHECK-LIBCXX-NOT: "-stdlib=libstdc++" | ||
// This test will fail if CLANG_DEFAULT_CXX_STDLIB is set to libstdc++. | ||
// XFAIL: default-cxx-stdlib=libstdc++ | ||
|
||
// Make sure that the Driver passes down -stdlib=libstdc++ to CC1 when specified explicitly. Note that this | ||
// shouldn't really be used on Darwin because libstdc++ is not supported anymore, but we still pin down the | ||
// Driver behavior for now. | ||
// | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch arm64 -miphoneos-version-min=7.0 -stdlib=libstdc++ %s -### 2>&1 | FileCheck --check-prefix=CHECK-LIBSTDCXX %s | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -mmacosx-version-min=10.9 -stdlib=libstdc++ %s -### 2>&1 | FileCheck --check-prefix=CHECK-LIBSTDCXX %s | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7s -miphoneos-version-min=7.0 -stdlib=libstdc++ %s -### 2>&1 | FileCheck --check-prefix=CHECK-LIBSTDCXX %s | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7k -stdlib=libstdc++ %s -### 2>&1 | FileCheck --check-prefix=CHECK-LIBSTDCXX %s | ||
// CHECK-LIBSTDCXX: "-stdlib=libstdc++" | ||
// CHECK-LIBSTDCXX-NOT: "-stdlib=libc++" | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch arm64 -miphoneos-version-min=7.0 %s -### 2>&1 | FileCheck %s | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -mmacosx-version-min=10.9 %s -### 2>&1 | FileCheck %s | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7s -miphoneos-version-min=7.0 %s -### 2>&1 | FileCheck %s | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7k %s -### 2>&1 | FileCheck %s | ||
|
||
// Make sure that the Driver does not spuriously pass down any -stdlib=<...> option to CC1 if none is | ||
// specified on the command-line. In that case, CC1 should use the default standard library, which is | ||
// going to be libc++. | ||
// | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch arm64 -miphoneos-version-min=7.0 %s -### 2>&1 | FileCheck --check-prefix=CHECK-NONE %s | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -mmacosx-version-min=10.9 %s -### 2>&1 | FileCheck --check-prefix=CHECK-NONE %s | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7s -miphoneos-version-min=7.0 %s -### 2>&1 | FileCheck --check-prefix=CHECK-NONE %s | ||
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7k %s -### 2>&1 | FileCheck --check-prefix=CHECK-NONE %s | ||
// CHECK-NONE-NOT: "-stdlib=" | ||
// CHECK: "-stdlib=libc++" | ||
// CHECK-NOT: "-stdlib=libstdc++" |