From 22e4d5dc5ddf5737176d7212c8136b4cdd8be804 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Tue, 16 Jul 2019 11:06:43 +0000 Subject: [PATCH] [Driver] Don't pass --dynamic-linker to ld on Solaris I noticed that clang currently passes --dynamic-linker to ld. This has been the case since Solaris 11 support was added initially back in 2012 by David Chisnall (r150580). I couldn't find any patch submission, let alone a justification, for this, and it seems completely useless: --dynamic-linker is a gld compatibility form of the option, the native option being -I. First of all, however, the dynamic linker passed is simply the default, so there's no reason at all to specify it in the first place. This patch removes passing the option and adjusts the affected testcase accordingly. Tested on x86_64-pc-solaris2.11 and sparcv9-sun-solaris2.11. Differential Revision: https://reviews.llvm.org/D64493 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366202 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChains/Solaris.cpp | 4 ---- test/Driver/Inputs/solaris_sparc_tree/usr/lib/ld.so.1 | 0 test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/ld.so.1 | 0 test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/ld.so.1 | 0 test/Driver/Inputs/solaris_x86_tree/usr/lib/ld.so.1 | 0 test/Driver/solaris-ld.c | 4 ---- 6 files changed, 8 deletions(-) delete mode 100644 test/Driver/Inputs/solaris_sparc_tree/usr/lib/ld.so.1 delete mode 100644 test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/ld.so.1 delete mode 100644 test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/ld.so.1 delete mode 100644 test/Driver/Inputs/solaris_x86_tree/usr/lib/ld.so.1 diff --git a/lib/Driver/ToolChains/Solaris.cpp b/lib/Driver/ToolChains/Solaris.cpp index c65b783739..38f24d4cf7 100644 --- a/lib/Driver/ToolChains/Solaris.cpp +++ b/lib/Driver/ToolChains/Solaris.cpp @@ -65,10 +65,6 @@ void solaris::Linker::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-Bdynamic"); if (Args.hasArg(options::OPT_shared)) { CmdArgs.push_back("-shared"); - } else { - CmdArgs.push_back("--dynamic-linker"); - CmdArgs.push_back( - Args.MakeArgString(getToolChain().GetFilePath("ld.so.1"))); } // libpthread has been folded into libc since Solaris 10, no need to do diff --git a/test/Driver/Inputs/solaris_sparc_tree/usr/lib/ld.so.1 b/test/Driver/Inputs/solaris_sparc_tree/usr/lib/ld.so.1 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/ld.so.1 b/test/Driver/Inputs/solaris_sparc_tree/usr/lib/sparcv9/ld.so.1 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/ld.so.1 b/test/Driver/Inputs/solaris_x86_tree/usr/lib/amd64/ld.so.1 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/Driver/Inputs/solaris_x86_tree/usr/lib/ld.so.1 b/test/Driver/Inputs/solaris_x86_tree/usr/lib/ld.so.1 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/Driver/solaris-ld.c b/test/Driver/solaris-ld.c index 2fc5c91272..59d03c4d82 100644 --- a/test/Driver/solaris-ld.c +++ b/test/Driver/solaris-ld.c @@ -11,7 +11,6 @@ // CHECK-LD-SPARC32: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "sparc-sun-solaris2.11" // CHECK-LD-SPARC32-SAME: "-isysroot" "[[SYSROOT:[^"]+]]" // CHECK-LD-SPARC32: "{{.*}}ld{{(.exe)?}}" -// CHECK-LD-SPARC32-SAME: "--dynamic-linker" "[[SYSROOT]]/usr/lib{{/|\\\\}}ld.so.1" // CHECK-LD-SPARC32-SAME: "[[SYSROOT]]/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2{{/|\\\\}}crt1.o" // CHECK-LD-SPARC32-SAME: "[[SYSROOT]]/usr/lib{{/|\\\\}}crti.o" // CHECK-LD-SPARC32-SAME: "[[SYSROOT]]/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2{{/|\\\\}}crtbegin.o" @@ -35,7 +34,6 @@ // CHECK-LD-SPARC64: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "sparcv9-sun-solaris2.11" // CHECK-LD-SPARC64-SAME: "-isysroot" "[[SYSROOT:[^"]+]]" // CHECK-LD-SPARC64: "{{.*}}ld{{(.exe)?}}" -// CHECK-LD-SPARC64-SAME: "--dynamic-linker" "[[SYSROOT]]/usr/lib/sparcv9{{/|\\\\}}ld.so.1" // CHECK-LD-SPARC64-SAME: "[[SYSROOT]]/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9{{/|\\\\}}crt1.o" // CHECK-LD-SPARC64-SAME: "[[SYSROOT]]/usr/lib/sparcv9{{/|\\\\}}crti.o" // CHECK-LD-SPARC64-SAME: "[[SYSROOT]]/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/sparcv9{{/|\\\\}}crtbegin.o" @@ -59,7 +57,6 @@ // CHECK-LD-X32: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "i386-pc-solaris2.11" // CHECK-LD-X32-SAME: "-isysroot" "[[SYSROOT:[^"]+]]" // CHECK-LD-X32: "{{.*}}ld{{(.exe)?}}" -// CHECK-LD-X32-SAME: "--dynamic-linker" "[[SYSROOT]]/usr/lib{{/|\\\\}}ld.so.1" // CHECK-LD-X32-SAME: "[[SYSROOT]]/usr/lib{{/|\\\\}}crt1.o" // CHECK-LD-X32-SAME: "[[SYSROOT]]/usr/lib{{/|\\\\}}crti.o" // CHECK-LD-X32-SAME: "[[SYSROOT]]/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4{{/|\\\\}}crtbegin.o" @@ -83,7 +80,6 @@ // CHECK-LD-X64: {{.*}}clang{{(.exe)?}}" "-cc1" "-triple" "x86_64-pc-solaris2.11" // CHECK-LD-X64-SAME: "-isysroot" "[[SYSROOT:[^"]+]]" // CHECK-LD-X64: "{{.*}}ld{{(.exe)?}}" -// CHECK-LD-X64-SAME: "--dynamic-linker" "[[SYSROOT]]/usr/lib/amd64{{/|\\\\}}ld.so.1" // CHECK-LD-X64-SAME: "[[SYSROOT]]/usr/lib/amd64{{/|\\\\}}crt1.o" // CHECK-LD-X64-SAME: "[[SYSROOT]]/usr/lib/amd64{{/|\\\\}}crti.o" // CHECK-LD-X64-SAME: "[[SYSROOT]]/usr/gcc/4.9/lib/gcc/i386-pc-solaris2.11/4.9.4/amd64{{/|\\\\}}crtbegin.o" -- 2.40.0