[gcc-6] 293/401: * gdc: Link with the shared libgphobos runtime by default. Closes: #845377.
Ximin Luo
infinity0 at debian.org
Wed Apr 5 15:50:05 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch pu/reproducible_builds
in repository gcc-6.
commit 144e966d53e15a9d4d7d9b861ba4cacdfac5bc5b
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date: Tue Nov 22 23:21:42 2016 +0000
* gdc: Link with the shared libgphobos runtime by default. Closes: #845377.
git-svn-id: svn://anonscm.debian.org/gcccvs/branches/sid/gcc-6@9118 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
debian/changelog | 1 +
debian/patches/gdc-libphobos-link.diff | 84 +++++++++++++++++++++++++++++++++-
2 files changed, 83 insertions(+), 2 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 91e5b15..cc60267 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ gcc-6 (6.2.1-5) UNRELEASED; urgency=medium
* Don't apply the ada patches for stage builds.
* Add pkg-config to the build dependencies.
* Drop the work around for PR libstdc++/65913.
+ * gdc: Link with the shared libgphobos runtime by default. Closes: #845377.
-- Matthias Klose <doko at debian.org> Sun, 20 Nov 2016 17:12:08 +0100
diff --git a/debian/patches/gdc-libphobos-link.diff b/debian/patches/gdc-libphobos-link.diff
index 8ed8bc4..9dc0e96 100644
--- a/debian/patches/gdc-libphobos-link.diff
+++ b/debian/patches/gdc-libphobos-link.diff
@@ -4,7 +4,16 @@ Index: b/src/gcc/d/d-spec.c
===================================================================
--- a/src/gcc/d/d-spec.c
+++ b/src/gcc/d/d-spec.c
-@@ -75,6 +75,10 @@
+@@ -36,6 +36,8 @@
+ #define WITHLIBCXX (1<<5)
+ /* this bit is set if they did `-lc'. */
+ #define WITHLIBC (1<<6)
++/* this bit is set if they did `-ldl'. */
++#define DLLIB (1<<7)
+ /* This bit is set when the argument should not be passed to gcc or the backend */
+ #define SKIPOPT (1<<8)
+
+@@ -75,6 +77,10 @@
#define LIBDRUNTIME_PROFILE LIBDRUNTIME
#endif
@@ -15,7 +24,62 @@ Index: b/src/gcc/d/d-spec.c
void
lang_specific_driver (cl_decoded_option **in_decoded_options,
unsigned int *in_decoded_options_count,
-@@ -510,6 +514,10 @@ lang_specific_driver (cl_decoded_option
+@@ -123,6 +129,9 @@ lang_specific_driver (cl_decoded_option
+ /* "-lstdc++" if it appears on the command line. */
+ const cl_decoded_option *saw_libcxx = 0;
+
++ /* "-ldl" if it appears on the command line. */
++ const cl_decoded_option *saw_libdl = 0;
++
+ /* An array used to flag each argument that needs a bit set for
+ DSOURCE, MATHLIB, WITHTHREAD, WITHLIBC or WITHLIBCXX. */
+ int *args;
+@@ -139,6 +148,9 @@ lang_specific_driver (cl_decoded_option
+ /* By default, we throw on the time library if we have one. */
+ int need_time = (TIME_LIBRARY[0] != '\0');
+
++ /* By default, we throw on the dl library if we have one. */
++ int need_dl = (DL_LIBRARY[0] != '\0');
++
+ /* True if we saw -static. */
+ int static_link = 0;
+
+@@ -248,6 +260,11 @@ lang_specific_driver (cl_decoded_option
+ args[i] |= TIMELIB;
+ need_time = 0;
+ }
++ else if (strcmp (arg, DL_LIBRARY) == 0)
++ {
++ args[i] |= DLLIB;
++ need_dl = 0;
++ }
+ else if (strcmp (arg, "c") == 0)
+ args[i] |= WITHLIBC;
+ else
+@@ -423,6 +440,12 @@ lang_specific_driver (cl_decoded_option
+ saw_time = &decoded_options[i];
+ }
+
++ if (!saw_dl && (args[i] & DLLIB) && library > 0)
++ {
++ --j;
++ saw_dl = &decoded_options[i];
++ }
++
+ if (!saw_libc && (args[i] & WITHLIBC) && library > 0)
+ {
+ --j;
+@@ -483,9 +506,6 @@ lang_specific_driver (cl_decoded_option
+ /* Add `-lgphobos' if we haven't already done so. */
+ if (library > 0 && phobos)
+ {
+- // Default to static linking
+- if (library == 1)
+- library = 2;
+
+ #ifdef HAVE_LD_STATIC_DYNAMIC
+ if (library == 3 && static_link)
+@@ -510,6 +530,10 @@ lang_specific_driver (cl_decoded_option
CL_DRIVER, &new_decoded_options[j]);
added_libraries++;
j++;
@@ -26,3 +90,19 @@ Index: b/src/gcc/d/d-spec.c
#ifdef HAVE_LD_STATIC_DYNAMIC
if (library == 3 && static_link)
+@@ -580,6 +604,15 @@ lang_specific_driver (cl_decoded_option
+ &new_decoded_options[j++]);
+ added_libraries++;
+ }
++
++ if (saw_dl)
++ new_decoded_options[j++] = *saw_dl;
++ else if (library > 0 && need_dl)
++ {
++ generate_option (OPT_l, DL_LIBRARY, 1, CL_DRIVER,
++ &new_decoded_options[j++]);
++ added_libraries++;
++ }
+
+ if (saw_libc)
+ new_decoded_options[j++] = *saw_libc;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/gcc-6.git
More information about the Reproducible-commits
mailing list