[PATCH] D91884: clang+lld: Improve clang+ld.darwinnew.lld interaction, pass -demangle

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 20 11:06:18 PST 2020


thakis created this revision.
thakis added reviewers: int3, hans.
Herald added subscribers: dang, mgorny, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: MaskRay.
Herald added a project: LLVM.
thakis requested review of this revision.
Herald added a subscriber: aheejin.

This patch:

- adds an ld64.lld.darwinnew symlink for lld, to go with f2710d4b576 <https://reviews.llvm.org/rGf2710d4b576053d405af7a0e2a62ea06d5a978e3>, so that `clang -fuse-ld=lld.darwinnew` can be used to test new Mach-O lld while it's in bring-up. (The expectation is that we'll remove this again once new Mach-O lld is the defauld and only Mach-O lld.)
- lets the clang driver know if the linker is lld (currently only triggered if `-fuse-ld=lld` or `-fuse-ld=lld.darwinnew` is passed). Currently only used for the next point, but could be used to implement other features that need close coordination between compiler and linker, e.g. having a diag for calling `clang++` instead of `clang` when link errors are caused by a missing C++ stdlib.
- lets the clang driver pass `-demangle` to Mach-O lld (both old and new), in addition to ld64
- implementes -demangle for new Mach-O lld
- changes demangleItanium() to accept _Z, __Z, ___Z, ____Z prefixes (and removes one test added in D68014 <https://reviews.llvm.org/D68014> that doesnt' seem all that useful). Mach-O has an extra underscore for symbols, and the three (or, on Mach-O, four) underscores are used for block names.


https://reviews.llvm.org/D91884

Files:
  clang/include/clang/Driver/ToolChain.h
  clang/lib/Driver/ToolChain.cpp
  clang/lib/Driver/ToolChains/Darwin.cpp
  clang/lib/Driver/ToolChains/Darwin.h
  clang/test/Driver/darwin-ld-demangle-lld.c
  lld/Common/Strings.cpp
  lld/MachO/Config.h
  lld/MachO/Driver.cpp
  lld/MachO/Options.td
  lld/MachO/Symbols.cpp
  lld/MachO/Writer.cpp
  lld/test/ELF/undef.s
  lld/test/MachO/demangle.s
  lld/test/MachO/silent-ignore.test
  lld/tools/lld/CMakeLists.txt
  llvm/utils/gn/secondary/lld/tools/lld/BUILD.gn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91884.306743.patch
Type: text/x-patch
Size: 10342 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201120/f67556f6/attachment.bin>


More information about the llvm-commits mailing list