[PATCH] D77154: [cmake] Add LLVM_USE_GDB_INDEX option for gold/lld linkers

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 13:41:40 PDT 2020


dblaikie added a comment.

In D77154#1953480 <https://reviews.llvm.org/D77154#1953480>, @hliao wrote:

> In D77154#1953423 <https://reviews.llvm.org/D77154#1953423>, @MaskRay wrote:
>
> > This seems fine. I have `-DCMAKE_EXE_LINKER_FLAGS=-Wl,--gdb-index -DCMAKE_SHARED_LINKER_FLAGS=-Wl,--gdb-index -DLLVM_USE_SPLIT_DWARF=On` in my long cmake command line. I am just wondering whether this new option will be discoverable.
> >
> > Some people don't use -DLLVM_USE_LINKER=lld, but use -DLLVM_ENABLE_LLD=On.
>
>
> As I mentioned in https://reviews.llvm.org/D58628, if your system's default linker doesn't recognize `--gdb-index`, adding option into CMAKE_EXE_LINKER_FLAGS fails the make detection stage, where the default linker is used.


Perhaps that issue should be fixed (so that LLVM_ENABLE_LLD/LLVM_USE_LINKER kicks in early enough (same as putting -fuse-ld in CMAKE_EXE_LINKER_FLAGS) - seems a bit problematic to have different compilation modes at different points along that (but I guess make those LLD/linker enabling features are designed to use make detection to silently not do the thing you asked for if it's unsupported)

To my mind this all seems a bit complicated - and I wonder what the point of all these cmake supported features is compared to users specifying the flags in the flag variables directly?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77154





More information about the llvm-commits mailing list