clang+lld: Improve clang+ld.darwinnew.lld interaction, pass -demangle
This patch:
- adds an ld64.lld.darwinnew symlink for lld, to go with f2710d4b576,
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
- implements -demangle for new Mach-O lld
- changes demangleItanium() to accept _Z, __Z, ___Z, ____Z prefixes
(and updates one test added in D68014). Mach-O has an extra
underscore for symbols, and the three (or, on Mach-O, four)
underscores are used for block names.
Differential Revision: https://reviews.llvm.org/D91884
2020-11-21 02:57:44 +08:00
|
|
|
// With -fuse-ld=lld, -demangle is always passed to the linker on Darwin.
|
2020-11-24 22:43:22 +08:00
|
|
|
// REQUIRES: shell
|
clang+lld: Improve clang+ld.darwinnew.lld interaction, pass -demangle
This patch:
- adds an ld64.lld.darwinnew symlink for lld, to go with f2710d4b576,
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
- implements -demangle for new Mach-O lld
- changes demangleItanium() to accept _Z, __Z, ___Z, ____Z prefixes
(and updates one test added in D68014). Mach-O has an extra
underscore for symbols, and the three (or, on Mach-O, four)
underscores are used for block names.
Differential Revision: https://reviews.llvm.org/D91884
2020-11-21 02:57:44 +08:00
|
|
|
|
2021-03-03 01:50:51 +08:00
|
|
|
// FIXME: Remove this test case when we remove the lld.darwinold backend.
|
2020-11-24 22:43:22 +08:00
|
|
|
// RUN: %clang --target=x86_64-apple-darwin -### \
|
2021-03-03 01:50:51 +08:00
|
|
|
// RUN: -fuse-ld=lld.darwinold -B%S/Inputs/lld -mlinker-version=0 %s 2>&1 \
|
2020-11-24 22:43:22 +08:00
|
|
|
// RUN: | FileCheck %s
|
2021-03-03 01:50:51 +08:00
|
|
|
|
2020-11-24 22:43:22 +08:00
|
|
|
// RUN: %clang --target=x86_64-apple-darwin -### \
|
2021-03-03 01:50:51 +08:00
|
|
|
// RUN: -fuse-ld=lld -B%S/Inputs/lld -mlinker-version=0 %s 2>&1 \
|
2020-11-24 22:43:22 +08:00
|
|
|
// RUN: | FileCheck %s
|
|
|
|
|
|
|
|
// CHECK: "-demangle"
|