[PATCH] D70416: [Driver] Make -static-libgcc imply static libunwind

Josh Kunz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 20 12:33:03 PST 2019


jkz added a comment.

In D70416#1750978 <https://reviews.llvm.org/D70416#1750978>, @joerg wrote:

> This is normally done by using `-Bstatic`/`-Bdynamic` around the library. See `tools::addOpenMPRuntime`.


`-Bstatic`/`-Bdynamic` wrapping does seem to be more common, but that will change the linkage for libraries that are added after the run-time libraries <https://github.com/llvm/llvm-project/blob/master/clang/lib/Driver/ToolChains/Gnu.cpp#L574-L584> (e.g., `-lpthread`). We would need something like `--push-state -Bstatic -lunwind --pop-state` to preserve the "mode" of the link. (IMO, the existing usages of `-Bstatic`, `-Bdynamic` wrapping are wrong). The current approach is simpler.

Additionally, I think saugustine's reasoning makes sense here, and we should match the libgcc behavior of requiring a `.a` or `.so` depending on the "mode". I'd prefer to keep this patch the way it is.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70416/new/

https://reviews.llvm.org/D70416





More information about the cfe-commits mailing list