[lld] 53ff952 - Reland D78837 [lld] Remove special cases from default ld driver mode.
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 29 14:45:52 PDT 2020
Author: Fangrui Song
Date: 2020-04-29T14:45:44-07:00
New Revision: 53ff95254df4be3365a0bf4da2677e75ccbf32ba
URL: https://github.com/llvm/llvm-project/commit/53ff95254df4be3365a0bf4da2677e75ccbf32ba
DIFF: https://github.com/llvm/llvm-project/commit/53ff95254df4be3365a0bf4da2677e75ccbf32ba.diff
LOG: Reland D78837 [lld] Remove special cases from default ld driver mode.
Drops the behavior from rL217112.
Use the Gnu driver mode by default for all platforms when ld is
invoked. Other names for the program (such as link or ld64) continue
working as before.
Reviewed By: MaskRay, srhines, smeenai, ruiu
Differential Revision: https://reviews.llvm.org/D78837
Added:
Modified:
lld/tools/lld/lld.cpp
Removed:
lld/test/mach-o/Inputs/linker-as-ld.yaml
lld/test/mach-o/linker-as-ld.yaml
################################################################################
diff --git a/lld/test/mach-o/Inputs/linker-as-ld.yaml b/lld/test/mach-o/Inputs/linker-as-ld.yaml
deleted file mode 100644
index 0463154fcf28..000000000000
--- a/lld/test/mach-o/Inputs/linker-as-ld.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
---- !mach-o
-arch: x86_64
-file-type: MH_DYLIB
-install-name: /usr/lib/libSystem.B.dylib
-exports:
- - name: dyld_stub_binder
diff --git a/lld/test/mach-o/linker-as-ld.yaml b/lld/test/mach-o/linker-as-ld.yaml
deleted file mode 100644
index 21afdb2ea02e..000000000000
--- a/lld/test/mach-o/linker-as-ld.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
-# REQUIRES: system-linker-mach-o
-#
-# RUN: rm -rf %T/ld && ln -s `which lld` %T/ld \
-# RUN: && %T/ld -arch x86_64 -macosx_version_min 10.8 %s \
-# RUN: %p/Inputs/linker-as-ld.yaml -o %t \
-# RUN: && llvm-nm %t | FileCheck %s
-#
-# Test linker run as "ld" on darwin works as darwin linker.
-#
-
---- !mach-o
-arch: x86_64
-file-type: MH_OBJECT
-flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]
-has-UUID: false
-OS: unknown
-sections:
- - segment: __TEXT
- section: __text
- type: S_REGULAR
- attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
- address: 0x0000000000000000
- content: [ 0xC3 ]
-global-symbols:
- - name: _main
- type: N_SECT
- scope: [ N_EXT ]
- sect: 1
- value: 0x0000000000000000
-...
-
-# CHECK: T _main
diff --git a/lld/tools/lld/lld.cpp b/lld/tools/lld/lld.cpp
index 58a291d1e921..8a8f8d04bbda 100644
--- a/lld/tools/lld/lld.cpp
+++ b/lld/tools/lld/lld.cpp
@@ -96,17 +96,9 @@ static bool isPETarget(std::vector<const char *> &v) {
}
static Flavor parseProgname(StringRef progname) {
-#if __APPLE__
- // Use Darwin driver for "ld" on Darwin.
- if (progname == "ld")
- return Darwin;
-#endif
-
-#if LLVM_ON_UNIX
- // Use GNU driver for "ld" on other Unix-like system.
+ // Use GNU driver for "ld" by default.
if (progname == "ld")
return Gnu;
-#endif
// Progname may be something like "lld-gnu". Parse it.
SmallVector<StringRef, 3> v;
More information about the llvm-commits
mailing list