[all-commits] [llvm/llvm-project] 03142c: [Driver] Correctly handle static C++ standard library
Petr Hosek via All-commits
all-commits at lists.llvm.org
Fri Sep 24 00:40:45 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 03142c5f67788bcc1573f76732d0fccd75c6b965
https://github.com/llvm/llvm-project/commit/03142c5f67788bcc1573f76732d0fccd75c6b965
Author: Petr Hosek <phosek at google.com>
Date: 2021-09-24 (Fri, 24 Sep 2021)
Changed paths:
M clang/lib/Driver/ToolChains/Fuchsia.cpp
M clang/lib/Driver/ToolChains/Gnu.cpp
M clang/test/Driver/fuchsia.cpp
M clang/test/Driver/linux-ld.c
Log Message:
-----------
[Driver] Correctly handle static C++ standard library
When statically linking C++ standard library, we shouldn't add -Bdynamic
after including the library on the link line because that might override
user settings like -static and -static-pie. Rather, we should surround
the library with --push-state/--pop-state to make sure that -Bstatic
only applies to C++ standard library and nothing else. This has been
supported since GNU ld 2.25 (2014) so backwards compatibility should
no longer be a concern.
Differential Revision: https://reviews.llvm.org/D110128
More information about the All-commits
mailing list