[gcc-7] 149/354: * Allow to use lld with -fuse-ld=ld.lld.

Ximin Luo infinity0 at debian.org
Thu Nov 23 15:50:44 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository gcc-7.

commit e1eef6b6ef7137768b51b01b6fdbc43558b29c3c
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date:   Wed Mar 15 13:04:19 2017 +0000

      * Allow to use lld with -fuse-ld=ld.lld.
    
    
    git-svn-id: svn+ssh://svn.debian.org/svn/gcccvs/branches/sid/gcc-7@9367 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
 debian/changelog                        |  1 +
 debian/patches/gcc-fuse-ld-lld-doc.diff | 17 +++++++
 debian/patches/gcc-fuse-ld-lld.diff     | 83 +++++++++++++++++++++++++++++++++
 debian/rules.patch                      |  2 +
 4 files changed, 103 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index c545e8a..2218ffb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 gcc-7 (7-20170314-2) UNRELEASED; urgency=medium
 
   * Install the gcov-dump utility.
+  * Allow to use lld with -fuse-ld=ld.lld.
 
  -- Matthias Klose <doko at debian.org>  Wed, 15 Mar 2017 13:21:41 +0100
 
diff --git a/debian/patches/gcc-fuse-ld-lld-doc.diff b/debian/patches/gcc-fuse-ld-lld-doc.diff
new file mode 100644
index 0000000..6483281
--- /dev/null
+++ b/debian/patches/gcc-fuse-ld-lld-doc.diff
@@ -0,0 +1,17 @@
+# DP: Allow to use lld with -fuse-ld=ld.lld (documentation)
+
+Index: gcc/doc/invoke.texi
+===================================================================
+--- a/src/gcc/doc/invoke.texi	(revision 246158)
++++ a/src/gcc/doc/invoke.texi	(working copy)
+@@ -10501,6 +10501,10 @@
+ @opindex fuse-ld=gold
+ Use the @command{gold} linker instead of the default linker.
+ 
++ at item -fuse-ld=lld
++ at opindex fuse-ld=lld
++Use the LLVM @command{lld} linker instead of the default linker.
++
+ @cindex Libraries
+ @item -l at var{library}
+ @itemx -l @var{library}
diff --git a/debian/patches/gcc-fuse-ld-lld.diff b/debian/patches/gcc-fuse-ld-lld.diff
new file mode 100644
index 0000000..1464267
--- /dev/null
+++ b/debian/patches/gcc-fuse-ld-lld.diff
@@ -0,0 +1,83 @@
+# DP: Allow to use lld with -fuse-ld=ld.lld
+
+Index: gcc/collect2.c
+===================================================================
+--- a/src/gcc/collect2.c	(revision 246158)
++++ a/src/gcc/collect2.c	(working copy)
+@@ -831,6 +831,7 @@
+       USE_PLUGIN_LD,
+       USE_GOLD_LD,
+       USE_BFD_LD,
++      USE_LLD_LD,
+       USE_LD_MAX
+     } selected_linker = USE_DEFAULT_LD;
+   static const char *const ld_suffixes[USE_LD_MAX] =
+@@ -838,7 +839,8 @@
+       "ld",
+       PLUGIN_LD_SUFFIX,
+       "ld.gold",
+-      "ld.bfd"
++      "ld.bfd",
++      "ld.lld"
+     };
+   static const char *const real_ld_suffix = "real-ld";
+   static const char *const collect_ld_suffix = "collect-ld";
+@@ -1004,6 +1006,8 @@
+ 	  selected_linker = USE_BFD_LD;
+ 	else if (strcmp (argv[i], "-fuse-ld=gold") == 0)
+ 	  selected_linker = USE_GOLD_LD;
++  else if (strcmp (argv[i], "-fuse-ld=lld") == 0)
++    selected_linker = USE_LLD_LD;
+ 
+ #ifdef COLLECT_EXPORT_LIST
+ 	/* These flags are position independent, although their order
+@@ -1093,7 +1097,8 @@
+   /* 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)
++  if (selected_linker == USE_BFD_LD || selected_linker == USE_GOLD_LD ||
++      selected_linker == USE_LLD_LD)
+     {
+       char *linker_name;
+ # ifdef HOST_EXECUTABLE_SUFFIX
+@@ -1307,7 +1312,7 @@
+ 	      else if (!use_collect_ld
+ 		       && strncmp (arg, "-fuse-ld=", 9) == 0)
+ 		{
+-		  /* Do not pass -fuse-ld={bfd|gold} to the linker. */
++		  /* Do not pass -fuse-ld={bfd|gold|lld} to the linker. */
+ 		  ld1--;
+ 		  ld2--;
+ 		}
+Index: gcc/common.opt
+===================================================================
+--- a/src/gcc/common.opt	(revision 246158)
++++ a/src/gcc/common.opt	(working copy)
+@@ -2512,9 +2512,13 @@
+ 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=bfd)
++Use the lld LLVM linker instead of the default linker.
++
+ fuse-linker-plugin
+ Common Undocumented Var(flag_use_linker_plugin)
+ 
+Index: gcc/opts.c
+===================================================================
+--- a/src/gcc/opts.c	(revision 246158)
++++ a/src/gcc/opts.c	(working copy)
+@@ -2168,6 +2168,7 @@
+ 
+     case OPT_fuse_ld_bfd:
+     case OPT_fuse_ld_gold:
++    case OPT_fuse_ld_lld:
+     case OPT_fuse_linker_plugin:
+       /* No-op. Used by the driver and passed to us because it starts with f.*/
+       break;
diff --git a/debian/rules.patch b/debian/rules.patch
index 1c80129..a0565ae 100644
--- a/debian/rules.patch
+++ b/debian/rules.patch
@@ -16,6 +16,7 @@ debian_patches = \
 	$(if $(with_linaro_branch),gcc-linaro) \
 	$(if $(with_linaro_branch),gcc-linaro-no-macros) \
 	$(if $(with_linaro_branch),linaro-issue2575) \
+	gcc-fuse-ld-lld-doc \
 
 #	svn-updates \
 
@@ -67,6 +68,7 @@ debian_patches += \
 	libffi-pax \
 	libffi-race-condition \
 	gcc-foffload-default \
+	gcc-fuse-ld-lld \
 
 
 #	$(if $(filter yes, $(DEB_CROSS)),,gcc-print-file-name) \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/gcc-7.git



More information about the Reproducible-commits mailing list