diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -620,11 +620,11 @@ std::string LinkerPath(GetProgramPath(LinkerName.c_str())); if (llvm::sys::fs::can_execute(LinkerPath)) { - // FIXME: Remove lld.darwinnew here once it's the only MachO lld. + // FIXME: Remove LinkerIsLLDDarwinNew once there's only one MachO lld. if (LinkerIsLLD) - *LinkerIsLLD = UseLinker == "lld" || UseLinker == "lld.darwinnew"; + *LinkerIsLLD = UseLinker == "lld" || UseLinker == "lld.darwinold"; if (LinkerIsLLDDarwinNew) - *LinkerIsLLDDarwinNew = UseLinker == "lld.darwinnew"; + *LinkerIsLLDDarwinNew = UseLinker == "lld"; return LinkerPath; } } diff --git a/clang/test/Driver/Inputs/lld/ld64.lld.darwinnew b/clang/test/Driver/Inputs/lld/ld64.lld.darwinold rename from clang/test/Driver/Inputs/lld/ld64.lld.darwinnew rename to clang/test/Driver/Inputs/lld/ld64.lld.darwinold diff --git a/clang/test/Driver/darwin-infer-simulator-sdkroot.c b/clang/test/Driver/darwin-infer-simulator-sdkroot.c --- a/clang/test/Driver/darwin-infer-simulator-sdkroot.c +++ b/clang/test/Driver/darwin-infer-simulator-sdkroot.c @@ -4,9 +4,9 @@ // // RUN: rm -rf %t/SDKs/iPhoneOS8.0.0.sdk // RUN: mkdir -p %t/SDKs/iPhoneOS8.0.0.sdk -// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \ +// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang -fuse-ld= %s -mlinker-version=400 -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-IPHONE %s -// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk IPHONEOS_DEPLOYMENT_TARGET=8.0 %clang %s -mlinker-version=400 -### 2>&1 \ +// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk IPHONEOS_DEPLOYMENT_TARGET=8.0 %clang -fuse-ld= %s -mlinker-version=400 -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-IPHONE %s // CHECK-IPHONE: clang // CHECK-IPHONE: "-cc1" @@ -17,7 +17,7 @@ // // RUN: rm -rf %t/SDKs/iPhoneSimulator8.0.sdk // RUN: mkdir -p %t/SDKs/iPhoneSimulator8.0.sdk -// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -arch x86_64 %s -mlinker-version=400 -### 2>&1 \ +// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -fuse-ld= -arch x86_64 %s -mlinker-version=400 -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-SIMULATOR %s // // CHECK-SIMULATOR: clang @@ -29,7 +29,7 @@ // // RUN: rm -rf %t/SDKs/iPhoneSimulator14.0.sdk // RUN: mkdir -p %t/SDKs/iPhoneSimulator14.0.sdk -// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator14.0.sdk %clang -arch arm64 %s -mlinker-version=400 -### 2>&1 \ +// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator14.0.sdk %clang -fuse-ld= -arch arm64 %s -mlinker-version=400 -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-SIMULATOR-ARM64 %s // // CHECK-SIMULATOR-ARM64: clang @@ -41,9 +41,9 @@ // // RUN: rm -rf %t/SDKs/WatchOS3.0.sdk // RUN: mkdir -p %t/SDKs/WatchOS3.0.sdk -// RUN: env SDKROOT=%t/SDKs/WatchOS3.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \ +// RUN: env SDKROOT=%t/SDKs/WatchOS3.0.sdk %clang %s -fuse-ld= -mlinker-version=400 -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-WATCH %s -// RUN: env WATCHOS_DEPLOYMENT_TARGET=3.0 %clang %s -isysroot %t/SDKs/WatchOS3.0.sdk -mlinker-version=400 -### 2>&1 \ +// RUN: env WATCHOS_DEPLOYMENT_TARGET=3.0 %clang %s -fuse-ld= -isysroot %t/SDKs/WatchOS3.0.sdk -mlinker-version=400 -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-WATCH %s // // CHECK-WATCH: clang @@ -55,7 +55,7 @@ // // RUN: rm -rf %t/SDKs/WatchSimulator3.0.sdk // RUN: mkdir -p %t/SDKs/WatchSimulator3.0.sdk -// RUN: env SDKROOT=%t/SDKs/WatchSimulator3.0.sdk %clang -arch x86_64 %s -mlinker-version=400 -### 2>&1 \ +// RUN: env SDKROOT=%t/SDKs/WatchSimulator3.0.sdk %clang -fuse-ld= -arch x86_64 %s -mlinker-version=400 -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-WATCH-SIMULATOR %s // // CHECK-WATCH-SIMULATOR: clang @@ -67,7 +67,7 @@ // // RUN: rm -rf %t/SDKs/WatchSimulator7.0.sdk // RUN: mkdir -p %t/SDKs/WatchSimulator7.0.sdk -// RUN: env SDKROOT=%t/SDKs/WatchSimulator7.0.sdk %clang -arch arm64 %s -mlinker-version=400 -### 2>&1 \ +// RUN: env SDKROOT=%t/SDKs/WatchSimulator7.0.sdk %clang -fuse-ld= -arch arm64 %s -mlinker-version=400 -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-WATCH-SIMULATOR-ARM64 %s // // CHECK-WATCH-SIMULATOR-ARM64: clang @@ -79,7 +79,7 @@ // // RUN: rm -rf %t/SDKs/AppleTVOS10.0.sdk // RUN: mkdir -p %t/SDKs/AppleTVOS10.0.sdk -// RUN: env SDKROOT=%t/SDKs/AppleTVOS10.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \ +// RUN: env SDKROOT=%t/SDKs/AppleTVOS10.0.sdk %clang %s -fuse-ld= -mlinker-version=400 -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-TV %s // // CHECK-TV: clang @@ -91,7 +91,7 @@ // // RUN: rm -rf %t/SDKs/AppleTVSimulator10.0.sdk // RUN: mkdir -p %t/SDKs/AppleTVSimulator10.0.sdk -// RUN: env SDKROOT=%t/SDKs/AppleTVSimulator10.0.sdk %clang -arch x86_64 %s -mlinker-version=400 -### 2>&1 \ +// RUN: env SDKROOT=%t/SDKs/AppleTVSimulator10.0.sdk %clang -fuse-ld= -arch x86_64 %s -mlinker-version=400 -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-TV-SIMULATOR %s // // CHECK-TV-SIMULATOR: clang @@ -103,7 +103,7 @@ // // RUN: rm -rf %t/SDKs/AppleTVSimulator14.0.sdk // RUN: mkdir -p %t/SDKs/AppleTVSimulator14.0.sdk -// RUN: env SDKROOT=%t/SDKs/AppleTVSimulator14.0.sdk %clang -arch arm64 %s -mlinker-version=400 -### 2>&1 \ +// RUN: env SDKROOT=%t/SDKs/AppleTVSimulator14.0.sdk %clang -fuse-ld= -arch arm64 %s -mlinker-version=400 -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-TV-SIMULATOR-ARM64 %s // // CHECK-TV-SIMULATOR-ARM64: clang diff --git a/clang/test/Driver/darwin-ld-demangle-lld.c b/clang/test/Driver/darwin-ld-demangle-lld.c --- a/clang/test/Driver/darwin-ld-demangle-lld.c +++ b/clang/test/Driver/darwin-ld-demangle-lld.c @@ -1,12 +1,13 @@ // With -fuse-ld=lld, -demangle is always passed to the linker on Darwin. // REQUIRES: shell +// FIXME: Remove this test case when we remove the lld.darwinold backend. // RUN: %clang --target=x86_64-apple-darwin -### \ -// RUN: -fuse-ld=lld -B%S/Inputs/lld -mlinker-version=0 %s 2>&1 \ +// RUN: -fuse-ld=lld.darwinold -B%S/Inputs/lld -mlinker-version=0 %s 2>&1 \ // RUN: | FileCheck %s -// FIXME: Remove ld.darwinnew once it's the default (and only) mach-o lld. + // RUN: %clang --target=x86_64-apple-darwin -### \ -// RUN: -fuse-ld=lld.darwinnew -B%S/Inputs/lld -mlinker-version=0 %s 2>&1 \ +// RUN: -fuse-ld=lld -B%S/Inputs/lld -mlinker-version=0 %s 2>&1 \ // RUN: | FileCheck %s // CHECK: "-demangle" diff --git a/clang/test/Driver/darwin-ld-lto.c b/clang/test/Driver/darwin-ld-lto.c --- a/clang/test/Driver/darwin-ld-lto.c +++ b/clang/test/Driver/darwin-ld-lto.c @@ -5,7 +5,7 @@ // RUN: mkdir -p %t/bin // RUN: mkdir -p %t/lib // RUN: touch %t/lib/libLTO.dylib -// RUN: %clang -target x86_64-apple-darwin10 -### %s \ +// RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 -### %s \ // RUN: -ccc-install-dir %t/bin -mlinker-version=133 2> %t.log // RUN: FileCheck -check-prefix=LINK_LTOLIB_PATH %s -input-file %t.log // @@ -14,7 +14,7 @@ // Also pass -lto_library even if the file doesn't exist; if it's needed at // link time, ld will complain instead. -// RUN: %clang -target x86_64-apple-darwin10 -### %s \ +// RUN: %clang -fuse-ld= -target x86_64-apple-darwin10 -### %s \ // RUN: -ccc-install-dir %S/dummytestdir -mlinker-version=133 2> %t.log // RUN: FileCheck -check-prefix=LINK_LTOLIB_PATH %s -input-file %t.log diff --git a/clang/test/Driver/darwin-ld-platform-version-ios.c b/clang/test/Driver/darwin-ld-platform-version-ios.c --- a/clang/test/Driver/darwin-ld-platform-version-ios.c +++ b/clang/test/Driver/darwin-ld-platform-version-ios.c @@ -1,6 +1,6 @@ // RUN: touch %t.o -// RUN: %clang -target arm64-apple-ios12.3 -fuse-ld= \ +// RUN: %clang -target arm64-apple-ios12.3 -fuse-ld=lld.darwinold \ // RUN: -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=0 \ // RUN: -### %t.o 2>&1 \ // RUN: | FileCheck --check-prefix=LINKER-OLD %s @@ -12,7 +12,7 @@ // RUN: -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=520 \ // RUN: -### %t.o 2>&1 \ // RUN: | FileCheck --check-prefix=LINKER-NEW %s -// RUN: %clang -target arm64-apple-ios12.3 -fuse-ld=lld.darwinnew \ +// RUN: %clang -target arm64-apple-ios12.3 -fuse-ld=lld \ // RUN: -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=0 \ // RUN: -### %t.o -B%S/Inputs/lld 2>&1 \ // RUN: | FileCheck --check-prefix=LINKER-NEW %s @@ -20,7 +20,7 @@ // RUN: -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=520 \ // RUN: -### %t.o 2>&1 \ // RUN: | FileCheck --check-prefix=SIMUL %s -// RUN: %clang -target x86_64-apple-ios13-simulator -fuse-ld=lld.darwinnew \ +// RUN: %clang -target x86_64-apple-ios13-simulator -fuse-ld=lld \ // RUN: -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=0 \ // RUN: -### %t.o -B%S/Inputs/lld 2>&1 \ // RUN: | FileCheck --check-prefix=SIMUL %s diff --git a/clang/test/Driver/darwin-ld-platform-version-macos.c b/clang/test/Driver/darwin-ld-platform-version-macos.c --- a/clang/test/Driver/darwin-ld-platform-version-macos.c +++ b/clang/test/Driver/darwin-ld-platform-version-macos.c @@ -1,10 +1,10 @@ // RUN: touch %t.o -// RUN: %clang -target x86_64-apple-macos10.13 -fuse-ld= \ +// RUN: %clang -target x86_64-apple-macos10.13 -fuse-ld=lld.darwinold \ // RUN: -isysroot %S/Inputs/MacOSX10.14.sdk -mlinker-version=0 \ // RUN: -### %t.o 2>&1 \ // RUN: | FileCheck --check-prefix=LINKER-OLD %s -// RUN: %clang -target x86_64-apple-macos10.13 -fuse-ld=lld.darwinnew \ +// RUN: %clang -target x86_64-apple-macos10.13 -fuse-ld=lld \ // RUN: -isysroot %S/Inputs/MacOSX10.14.sdk -mlinker-version=0 \ // RUN: -### %t.o -B%S/Inputs/lld 2>&1 \ // RUN: | FileCheck --check-prefix=LINKER-NEW %s @@ -21,7 +21,7 @@ // RUN: -isysroot %S/Inputs/MacOSX10.14.sdk -mlinker-version=400 \ // RUN: -### %t.o 2>&1 \ // RUN: | FileCheck --check-prefix=ARM64_OLD %s -// RUN: %clang -target arm64-apple-macos10.13 -fuse-ld=lld.darwinnew \ +// RUN: %clang -target arm64-apple-macos10.13 -fuse-ld=lld \ // RUN: -isysroot %S/Inputs/MacOSX10.14.sdk -mlinker-version=400 \ // RUN: -### %t.o -B%S/Inputs/lld 2>&1 \ // RUN: | FileCheck --check-prefix=ARM64_NEW %s diff --git a/clang/test/Driver/darwin-ld-platform-version-tvos.c b/clang/test/Driver/darwin-ld-platform-version-tvos.c --- a/clang/test/Driver/darwin-ld-platform-version-tvos.c +++ b/clang/test/Driver/darwin-ld-platform-version-tvos.c @@ -1,6 +1,6 @@ // RUN: touch %t.o -// RUN: %clang -target arm64-apple-tvos12.3 -fuse-ld= \ +// RUN: %clang -target arm64-apple-tvos12.3 -fuse-ld=lld.darwinold \ // RUN: -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=0 \ // RUN: -### %t.o 2>&1 \ // RUN: | FileCheck --check-prefix=LINKER-OLD %s @@ -8,7 +8,7 @@ // RUN: -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=400 \ // RUN: -### %t.o 2>&1 \ // RUN: | FileCheck --check-prefix=LINKER-OLD %s -// RUN: %clang -target arm64-apple-tvos12.3 -fuse-ld=lld.darwinnew \ +// RUN: %clang -target arm64-apple-tvos12.3 -fuse-ld=lld \ // RUN: -isysroot %S/Inputs/iPhoneOS13.0.sdk -mlinker-version=0 \ // RUN: -### %t.o -B%S/Inputs/lld 2>&1 \ // RUN: | FileCheck --check-prefix=LINKER-NEW %s diff --git a/clang/test/Driver/darwin-ld-platform-version-watchos.c b/clang/test/Driver/darwin-ld-platform-version-watchos.c --- a/clang/test/Driver/darwin-ld-platform-version-watchos.c +++ b/clang/test/Driver/darwin-ld-platform-version-watchos.c @@ -1,6 +1,6 @@ // RUN: touch %t.o -// RUN: %clang -target arm64_32-apple-watchos5.2 -fuse-ld= \ +// RUN: %clang -target arm64_32-apple-watchos5.2 -fuse-ld=lld.darwinold \ // RUN: -isysroot %S/Inputs/WatchOS6.0.sdk -mlinker-version=0 \ // RUN: -### %t.o 2>&1 \ // RUN: | FileCheck --check-prefix=LINKER-OLD %s @@ -8,7 +8,7 @@ // RUN: -isysroot %S/Inputs/WatchOS6.0.sdk -mlinker-version=400 \ // RUN: -### %t.o 2>&1 \ // RUN: | FileCheck --check-prefix=LINKER-OLD %s -// RUN: %clang -target arm64_32-apple-watchos5.2 -fuse-ld=lld.darwinnew \ +// RUN: %clang -target arm64_32-apple-watchos5.2 -fuse-ld=lld \ // RUN: -isysroot %S/Inputs/WatchOS6.0.sdk -mlinker-version=0 \ // RUN: -### %t.o -B%S/Inputs/lld 2>&1 \ // RUN: | FileCheck --check-prefix=LINKER-NEW %s diff --git a/clang/test/Driver/darwin-sdkroot.c b/clang/test/Driver/darwin-sdkroot.c --- a/clang/test/Driver/darwin-sdkroot.c +++ b/clang/test/Driver/darwin-sdkroot.c @@ -43,7 +43,7 @@ // // RUN: rm -rf %t/SDKs/iPhoneOS8.0.0.sdk // RUN: mkdir -p %t/SDKs/iPhoneOS8.0.0.sdk -// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang -target arm64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \ +// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang -fuse-ld= -target arm64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-IPHONE %s // // CHECK-IPHONE: clang @@ -55,7 +55,7 @@ // // RUN: rm -rf %t/SDKs/iPhoneSimulator8.0.sdk // RUN: mkdir -p %t/SDKs/iPhoneSimulator8.0.sdk -// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -target x86_64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \ +// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -fuse-ld= -target x86_64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-SIMULATOR %s // // CHECK-SIMULATOR: clang @@ -66,7 +66,7 @@ // // RUN: rm -rf %t/SDKs/MacOSX10.10.0.sdk // RUN: mkdir -p %t/SDKs/MacOSX10.10.0.sdk -// RUN: env SDKROOT=%t/SDKs/MacOSX10.10.0.sdk %clang -target x86_64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \ +// RUN: env SDKROOT=%t/SDKs/MacOSX10.10.0.sdk %clang -fuse-ld= -target x86_64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-MACOSX %s // // CHECK-MACOSX: clang diff --git a/clang/test/Driver/target-triple-deployment.c b/clang/test/Driver/target-triple-deployment.c --- a/clang/test/Driver/target-triple-deployment.c +++ b/clang/test/Driver/target-triple-deployment.c @@ -1,16 +1,16 @@ // RUN: touch %t.o -// RUN: %clang -target x86_64-apple-macosx10.4 -mlinker-version=400 -### %t.o 2> %t.log -// RUN: %clang -target x86_64-apple-darwin9 -mlinker-version=400 -### %t.o 2>> %t.log -// RUN: %clang -target x86_64-apple-macosx10.7 -mlinker-version=400 -### %t.o 2>> %t.log +// RUN: %clang -fuse-ld= -target x86_64-apple-macosx10.4 -mlinker-version=400 -### %t.o 2> %t.log +// RUN: %clang -fuse-ld= -target x86_64-apple-darwin9 -mlinker-version=400 -### %t.o 2>> %t.log +// RUN: %clang -fuse-ld= -target x86_64-apple-macosx10.7 -mlinker-version=400 -### %t.o 2>> %t.log // -// RUN: %clang -target armv7-apple-ios -mlinker-version=400 -### %t.o 2>> %t.log -// RUN: %clang -target armv7-apple-ios0.0 -mlinker-version=400 -### %t.o 2>> %t.log -// RUN: %clang -target armv7-apple-ios1.2.3 -mlinker-version=400 -### %t.o 2>> %t.log -// RUN: %clang -target armv7-apple-ios5.0 -mlinker-version=400 -### %t.o 2>> %t.log -// RUN: %clang -target armv7-apple-ios7.0 -mlinker-version=400 -### %t.o 2>> %t.log -// RUN: %clang -target arm64-apple-ios -mlinker-version=400 -### %t.o 2>> %t.log -// RUN: %clang -target arm64e-apple-ios13.0 -mlinker-version=400 -### %t.o 2>> %t.log -// RUN: %clang -target arm64e-apple-ios14.1 -mlinker-version=400 -### %t.o 2>> %t.log +// RUN: %clang -fuse-ld= -target armv7-apple-ios -mlinker-version=400 -### %t.o 2>> %t.log +// RUN: %clang -fuse-ld= -target armv7-apple-ios0.0 -mlinker-version=400 -### %t.o 2>> %t.log +// RUN: %clang -fuse-ld= -target armv7-apple-ios1.2.3 -mlinker-version=400 -### %t.o 2>> %t.log +// RUN: %clang -fuse-ld= -target armv7-apple-ios5.0 -mlinker-version=400 -### %t.o 2>> %t.log +// RUN: %clang -fuse-ld= -target armv7-apple-ios7.0 -mlinker-version=400 -### %t.o 2>> %t.log +// RUN: %clang -fuse-ld= -target arm64-apple-ios -mlinker-version=400 -### %t.o 2>> %t.log +// RUN: %clang -fuse-ld= -target arm64e-apple-ios13.0 -mlinker-version=400 -### %t.o 2>> %t.log +// RUN: %clang -fuse-ld= -target arm64e-apple-ios14.1 -mlinker-version=400 -### %t.o 2>> %t.log // // RUN: FileCheck %s < %t.log