[PATCH] D11737: Add -linker (and -linker=) alias for -fuse-ld=
Filipe Cabecinhas
filcab+llvm.phabricator at gmail.com
Mon Aug 3 15:23:17 PDT 2015
filcab created this revision.
filcab added a reviewer: echristo.
filcab added a subscriber: cfe-commits.
This implements one of the changes in the initial PS4 toolchain
definition.
http://reviews.llvm.org/D11279#inline-92724
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
@@ -1829,7 +1829,9 @@
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 : Separate<["-"], "linker">, Alias<fuse_ld_EQ>, MetaVarName<"<name>">;
+def linker_EQ : Joined<["-"], "linker=">, Alias<fuse_ld_EQ>;
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.31275.patch
Type: text/x-patch
Size: 1882 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150803/f68d973c/attachment.bin>
More information about the cfe-commits
mailing list