HomePhabricator

[Driver] Make -static-libgcc imply static libunwind

Authored by jkz on Nov 15 2019, 5:53 PM.

Description

[Driver] Make -static-libgcc imply static libunwind

In the GNU toolchain, -static-libgcc implies that the unwindlib will
be linked statically. However, when --unwindlib=libunwind, this flag is
ignored, and a bare -lunwind is added to the linker args. Unfortunately,
this means that if both libunwind.so, and libunwind.a are present
in the library path, libunwind.so will be chosen in all cases where
-static is not set.

This change makes -static-libgcc affect the -l flag produced by
--unwindlib=libunwind. After this patch, providing
-static-libgcc --unwindlib=libunwind will cause the driver to explicitly
emit -l:libunwind.a to statically link libunwind. For all other cases
it will emit -l:libunwind.so matching current behavior with a more
explicit link line.

https://reviews.llvm.org/D70416

Details

Committed
jkzNov 22 2019, 3:33 PM
Parents
rG1668685118cd: [MC] Reorder MCInst fields to make sizeof(MCInst) smaller
Branches
Unknown
Tags
Unknown