[PATCH] D59109: Add --unwindlib=[libgcc|compiler-rt] to parallel --rtlib= [take 2]

Sterling Augustine via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 8 11:51:24 PST 2019


saugustine marked an inline comment as done.
saugustine added inline comments.


================
Comment at: clang/include/clang/Driver/ToolChain.h:104
+    UNW_None,
+    UNW_CompilerRT,
+    UNW_Libgcc
----------------
phosek wrote:
> MaskRay wrote:
> > mgorny wrote:
> > > phosek wrote:
> > > > I think it's confusing to call LLVM's libunwind library compiler-rt since they're two separate and distinct LLVM subprojects. Is there a plan to move LLVM's libunwind into compiler-rt?
> > > Also, note that `-lunwind` may actually be 'non-GNU libunwind'. Both libraries normally use the same name.
> > Yeah there are lots of projects called "libunwind":
> > 
> > llvm libunwind
> > nongnu libunwind https://www.nongnu.org/libunwind/
> > PathScale libunwind https://github.com/pathscale/libunwind (this is used by default On FreeBSD)
> > (libgcc_s.so.1 doesn't call itself "libunwind")
> There have been suggestions to rename LLVM's libunwind to avoid this confusion in the past, maybe it's time to do it?
The issues with the name "libunwind" come up pretty much constantly, and various people have proposed renaming llvm's libunwind (as someone did when commenting on v1 of this patch), but it never really goes anywhere.  Others have suggested rolling it into compiler-rt, which makes quite a bit of sense to me, but is not really something I can do.

libgcc_s.so.1 doesn't call itself libunwind, but it provides the unwind symbols. As does libgcc_eh.

If you bootstrap clang with -DLLVM_ENABLE_PROJECTS="...,libunwind", then clang tries to use llvm's libunwind in its testing if -lunwind appears on the link line. It isn't built in enough variants to even run the test suite. For example, it would be missing a normal x86 abi build. Compare that to compiler-rt, which builds a copy for every variant.

So solving libunwind's name problem is out of scope for this patch.

Perhaps the best thing to do here is to make the option an actual driver argument string, rather than name an. --unwindlib="-lunwind" or "-lgcc_s".


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59109





More information about the llvm-commits mailing list