This is an archive of the discontinued LLVM Phabricator instance.

clang: alias -static-{libstdc++,libgcc} for LLVM variants
AbandonedPublic

Authored by martell on Sep 11 2017, 6:53 PM.

Details

Reviewers
rnk
pcc
MaskRay
Summary

Alias -static-compiler-rt and static-libc++ to their gcc counterparts.
Currently invoking -static-libgcc or -static-libstdc++ will ensure only use of static libs.
In future if we want to do more accurate handling with better behaviour with the linker we can remove the alias and pass a custom flag.
For now this would be a great alias for sanity.

Diff Detail

Repository
rL LLVM

Event Timeline

martell created this revision.Sep 11 2017, 6:53 PM
MaskRay accepted this revision.Apr 3 2018, 10:49 AM
This revision is now accepted and ready to land.Apr 3 2018, 10:49 AM
rsmith added a subscriber: rsmith.Oct 12 2018, 5:53 PM

It would be nice to have a flag here that's agnostic to the value supplied to -rtlib or -stdlib. Perhaps -static-rtlib (for either libgcc or compiler-rt) and -static-stdlib (for either libc++ or libstdc++). (Yes, it's bad that we use stdlib to mean "the C++ standard library", but that is the status quo.)

It would be nice to have a flag here that's agnostic to the value supplied to -rtlib or -stdlib. Perhaps -static-rtlib (for either libgcc or compiler-rt) and -static-stdlib (for either libc++ or libstdc++). (Yes, it's bad that we use stdlib to mean "the C++ standard library", but that is the status quo.)

rC113891 introduced -stdlib... yes it would be nice if it were named -c++stdlib or -cxxstdlib... (I'm not good at naming)

We don't need to be 100% compatible with gcc here.. --push-state -Bstatic -lc++/-lstdc++ --pop-state can also be used. --pop-state works with ld.bfd/gold/lld

martell abandoned this revision.Dec 4 2018, 5:06 AM

Dropping in favour of D53238