MaskRay added a comment. LGTM.
I looked at this in 2019 but did not change because GNU ld 2.25 (2014) introduced --push-state. (gold added it in 2016 but I think we can have higher version requirement for gold.) In 2021, binutils 2.24 (2013) compatibility should be irrelevant now... ================ Comment at: clang/lib/Driver/ToolChains/Fuchsia.cpp:143 if (OnlyLibstdcxxStatic) CmdArgs.push_back("-Bstatic"); ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs); ---------------- `--as-needed` only applies to shared objects so you can move it into the `else` code path. ================ Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:581 + CmdArgs.push_back("--push-state"); + CmdArgs.push_back("--as-needed"); if (OnlyLibstdcxxStatic) ---------------- The --as-needed change should be dropped from this patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110128/new/ https://reviews.llvm.org/D110128 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits