[PATCH] D11737: Add -linker (and -linker=) alias for -fuse-ld=

Filipe Cabecinhas via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 24 17:44:53 PDT 2015


filcab updated this revision to Diff 33030.
filcab marked an inline comment as done.
filcab added a comment.

Addressed Eric's comment.


http://reviews.llvm.org/D11737

Files:
  include/clang/Driver/Options.td
  test/Driver/fuse-ld.c

Index: test/Driver/fuse-ld.c
===================================================================
--- test/Driver/fuse-ld.c
+++ test/Driver/fuse-ld.c
@@ -24,6 +24,20 @@
 // RUN:   | FileCheck %s -check-prefix=CHECK-FREEBSD-PLIB
 // CHECK-FREEBSD-PLIB: error: invalid linker name
 
+// -linker= is an alias to fuse-ld. Don't need to retry all combinations
+// RUN: %clang %s -### -linker gold \
+// RUN:     --sysroot=%S/Inputs/basic_freebsd_tree \
+// RUN:     -target x86_64-unknown-freebsd \
+// RUN:     -B%S/Inputs/basic_freebsd_tree/usr/bin 2>&1 \
+// RUN:   | FileCheck %s -check-prefix=CHECK-FREEBSD-GOLD
+// CHECK-FREEBSD-LINKER-GOLD: Inputs/basic_freebsd_tree/usr/bin{{/|\\+}}ld.gold
+
+// RUN: %clang %s -### -linker=gold \
+// RUN:     --sysroot=%S/Inputs/basic_freebsd_tree \
+// RUN:     -target x86_64-unknown-freebsd \
+// RUN:     -B%S/Inputs/basic_freebsd_tree/usr/bin 2>&1 \
+// RUN:   | FileCheck %s -check-prefix=CHECK-FREEBSD-GOLD
+// CHECK-FREEBSD-LINKEREQ-GOLD: Inputs/basic_freebsd_tree/usr/bin{{/|\\+}}ld.gold
 
 
 // RUN: %clang %s -### \
Index: include/clang/Driver/Options.td
===================================================================
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -1849,7 +1849,8 @@
 
 def fprofile_dir : Joined<["-"], "fprofile-dir=">, Group<clang_ignored_gcc_optimization_f_Group>;
 
-def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group<f_Group>;
+def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, HelpText<"Use linker <name>">, Group<f_Group>;
+def linker_EQ : Joined<["-"], "linker=">, Alias<fuse_ld_EQ>, MetaVarName<"<name>">;
 
 defm align_functions : BooleanFFlag<"align-functions">, Group<clang_ignored_gcc_optimization_f_Group>;
 def falign_functions_EQ : Joined<["-"], "falign-functions=">, Group<clang_ignored_gcc_optimization_f_Group>;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11737.33030.patch
Type: text/x-patch
Size: 1822 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150825/ed9b3a96/attachment.bin>


More information about the cfe-commits mailing list