[EXT] Re: [Driver] Add support for -fuse-ld=lld

Romain Geissler romain.geissler@amadeus.com
Mon Feb 4 12:08:00 GMT 2019


On Fri, 25 Jan 2019, Jonathan Wakely wrote:

> This patch was committed to trunk (r265940), but HJ's review comments
> were never addressed (and look correct to me):
> https://clicktime.symantec.com/3QJw9yc7Scra74WXzR3yBDR6H2?u=https%3A%2F%2Fgcc.gnu.org%2Fml%2Fgcc-patches%2F2016-07%2Fmsg00146.html
>
> The multi-line condition should be split before the || operator not
> after it, and the negation of -fuse-ld=lld is not -fuse-ld-lld.

Hi,

This small cosmetic patch should address it. I don't know how much spaces
should be used to indent the second and third lines in the if condition,
this of course can be changed if it doesn't follow the gcc guidelines.

Cheers,
Romain

2019-02-04  Romain Geissler  <romain.geissler@amadeus.com>

	* collect2.c (main): Use one condition per line when checking for
	selected_linker.
	* common.opt (-fuse-ld=gold, -fuse-ld=lld): Adjust negative driver option.


>From ff9489bad0eda7b1a551ba454300022def0c8c77 Mon Sep 17 00:00:00 2001
From: Romain Geissler <romain.geissler@amadeus.com>
Date: Mon, 4 Feb 2019 11:49:41 +0000
Subject: [PATCH] Cosmetic changes for -fuse-ld=lld patch.

---
 gcc/collect2.c | 5 +++--
 gcc/common.opt | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/collect2.c b/gcc/collect2.c
index da956bfd984..96e449962e9 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -1127,8 +1127,9 @@ main (int argc, char **argv)
   /* Maybe we know the right file to use (if not cross).  */
   ld_file_name = 0;
 #ifdef DEFAULT_LINKER
-  if (selected_linker == USE_BFD_LD || selected_linker == USE_GOLD_LD ||
-      selected_linker == USE_LLD_LD)
+  if (selected_linker == USE_BFD_LD
+      || selected_linker == USE_GOLD_LD
+      || selected_linker == USE_LLD_LD)
     {
       char *linker_name;
 # ifdef HOST_EXECUTABLE_SUFFIX
diff --git a/gcc/common.opt b/gcc/common.opt
index 295cb1f55e1..03d8bc36260 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2792,11 +2792,11 @@ Common Driver Negative(fuse-ld=gold)
 Use the bfd linker instead of the default linker.

 fuse-ld=gold
-Common Driver Negative(fuse-ld=bfd)
+Common Driver Negative(fuse-ld=lld)
 Use the gold linker instead of the default linker.

 fuse-ld=lld
-Common Driver Negative(fuse-ld=lld)
+Common Driver Negative(fuse-ld=bfd)
 Use the lld LLVM linker instead of the default linker.

 fuse-linker-plugin
-- 
2.17.1



More information about the Gcc-patches mailing list