forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clang+lld: Improve clang+ld.darwinnew.lld interaction, pass -demangle
This patch: - adds an ld64.lld.darwinnew symlink for lld, to go with f2710d4, 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
- Loading branch information
Showing
16 changed files
with
62 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// With -fuse-ld=lld, -demangle is always passed to the linker on Darwin. | ||
|
||
// RUN: %clang -### -fuse-ld=lld %s 2>&1 | FileCheck %s | ||
// FIXME: Remove ld.darwinnew once it's the default (and only) mach-o lld. | ||
// RUN: %clang -### -fuse-ld=lld.darwinnew %s 2>&1 | FileCheck %s | ||
// CHECK: -demangle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# REQUIRES: x86 | ||
|
||
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o | ||
|
||
# RUN: not %lld %t.o -o /dev/null 2>&1 | FileCheck %s | ||
# RUN: not %lld -demangle %t.o -o /dev/null 2>&1 | \ | ||
# RUN: FileCheck --check-prefix=DEMANGLE %s | ||
|
||
# CHECK: undefined symbol __Z1fv | ||
# DEMANGLE: undefined symbol f() | ||
|
||
.globl _main | ||
_main: | ||
callq __Z1fv | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
RUN: %lld -v \ | ||
RUN: -demangle \ | ||
RUN: -dynamic \ | ||
RUN: -no_deduplicate \ | ||
RUN: -lto_library /lib/foo \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters