[all-commits] [llvm/llvm-project] ae623d: [Driver, Gnu] Simplify -static -static-pie -shared ...
Fangrui Song via All-commits
all-commits at lists.llvm.org
Thu Nov 16 13:48:18 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ae623d16d50c9f12de7ae7ac1aa11c9d6857e081
https://github.com/llvm/llvm-project/commit/ae623d16d50c9f12de7ae7ac1aa11c9d6857e081
Author: Fangrui Song <i at maskray.me>
Date: 2023-11-16 (Thu, 16 Nov 2023)
Changed paths:
M clang/lib/Driver/ToolChains/Gnu.cpp
M clang/test/Driver/dynamic-linker.c
M clang/test/Driver/linux-ld.c
M clang/test/Driver/ohos.c
Log Message:
-----------
[Driver,Gnu] Simplify -static -static-pie -shared -pie handling and suppress -shared -rdynamic warning
These options select different link modes (note: -shared -static can be
used together for musl and mingw). It makes sense to place them
together, which enables some simplification. The relevant ld options
are now consistently placed after -m, similar to GCC.
While here, suppress -Wunused-command-line-argument warning when -shared
-rdynamic are used together (introduced by commit
291f4a00232b5742940d67e2ecf9168631251317). It can be argued either way
whether the warning is justified (in ELF linkers --export-dynamic
functionality is subsumed by -shared), but it is not useful (users can
do -Wl,--export-dynamic, bypassing the driver diagnostic).
More information about the All-commits
mailing list