[all-commits] [llvm/llvm-project] 49dd02: Revert "[clang] Don't spuriously pass -stdlib=libc...
Hans via All-commits
all-commits at lists.llvm.org
Tue Dec 20 08:45:47 PST 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 49dd02bd081901db6011bdbe676573bfd5482627
https://github.com/llvm/llvm-project/commit/49dd02bd081901db6011bdbe676573bfd5482627
Author: Hans Wennborg <hans at chromium.org>
Date: 2022-12-20 (Tue, 20 Dec 2022)
Changed paths:
M clang/include/clang/Basic/DiagnosticDriverKinds.td
M clang/lib/Driver/ToolChains/Darwin.cpp
M clang/test/Driver/darwin-header-search-libcxx.cpp
R clang/test/Driver/darwin-stdlib-dont-pass-in-c.c
M clang/test/Driver/darwin-stdlib.cpp
Log Message:
-----------
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 b534ce46bd40 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 6540f32db09cf6b367812642fbd91d44cbb6638d.
More information about the All-commits
mailing list