This avoids introducing unnecessary DT_NEEDED entries when using
C++ driver for linking C code or C++ code that doesn't use C++
standard library.
Details
Diff Detail
- Repository
- rC Clang
Event Timeline
lib/Driver/ToolChains/Fuchsia.cpp | ||
---|---|---|
128 | If Fuchsia doesn't use gold, it is fine. gold diverges from ld.bfd (lld) in that -static switches the whole link to its special static mode. (as usually while you link libstdc++/libc++ statically, you can still link other libraries normally) In ld.bfd/lld, -Bstatic is synonym with -static. |
lib/Driver/ToolChains/Fuchsia.cpp | ||
---|---|---|
128 | I think this part of the change was unintentional and should be undone. |
lib/Driver/ToolChains/Fuchsia.cpp | ||
---|---|---|
128 | Actually, it's wrong two ways: the --pop-state should come before -lm. Neither -static nor -Bstatic should apply to -lm (or to -lc that comes later, which -static might). -static vs -Bstatic is only a latent bug given lld, but the -lm issue breaks the Zircon build today. |
If Fuchsia doesn't use gold, it is fine. gold diverges from ld.bfd (lld) in that -static switches the whole link to its special static mode. (as usually while you link libstdc++/libc++ statically, you can still link other libraries normally)
In ld.bfd/lld, -Bstatic is synonym with -static.