We shouldn't assume that libunwind.so is available. Rather can defer
the decision to the linker which defaults to libunwind.so, but if .so
isn't available, it'd pick libunwind.a. Users can use -static-libgcc
and -shared-libgcc to override this behavior and explicitly choose
the version they want.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
We ran into this in the Fuchsia toolchain where we only ship libunwind.a on Linux, but Clang is forcing the use of libunwind.so unless you explicitly set -shared-libgcc. With this change, the linker will choose whichever library is available by default.
LGTM in general, but I'd leave it to the others to formally approve.
clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
---|---|---|
1468 | Previously, OPT_shared_libgcc would override the default for android, but now it no longer would. I guess that might be sensible, but it seems slightly outside of what the patch says it does. (I guess it's fine to include the change too, but I just wanted to raise it for discussion.) |
clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
---|---|---|
1468 | No, there's no such shared library to even depend on, so it wouldn't be supported previously or in the future. |
Previously, OPT_shared_libgcc would override the default for android, but now it no longer would. I guess that might be sensible, but it seems slightly outside of what the patch says it does. (I guess it's fine to include the change too, but I just wanted to raise it for discussion.)