[gcc-7] 78/354: * GCC 7 snapshot build, taken from the trunk 20161229. * Update gdc to trunk 20161229. * Configure libphobos builds with --with-target-system-zlib. * Ignore dpkg's pie specs when pie is not enabled. Addresses: #848129.

Ximin Luo infinity0 at debian.org
Thu Nov 23 15:50:33 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 2f6c93a723144ad1d2faec21f441a6b07a090ecc
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date:   Thu Dec 29 06:42:06 2016 +0000

      * GCC 7 snapshot build, taken from the trunk 20161229.
      * Update gdc to trunk 20161229.
      * Configure libphobos builds with --with-target-system-zlib.
      * Ignore dpkg's pie specs when pie is not enabled. Addresses: #848129.
    
    
    git-svn-id: svn+ssh://svn.debian.org/svn/gcccvs/branches/sid/gcc-7@9204 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
 debian/changelog                                   |  10 +-
 debian/patches/gdc-libphobos-link.diff             | 108 ---------------------
 .../patches/ignore-pie-specs-when-not-enabled.diff |  56 +++++++++++
 debian/patches/libphobos-zlib.diff                 |  40 +++++---
 debian/patches/pr78748.diff                        |  53 ----------
 debian/rules.d/binary-d.mk                         |   4 +
 debian/rules.patch                                 |  14 ++-
 debian/rules2                                      |   4 +
 8 files changed, 109 insertions(+), 180 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index efbd961..ed28852 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,15 +1,17 @@
-gcc-7 (7-20161217-1) experimental; urgency=medium
+gcc-7 (7-20161229-1) experimental; urgency=medium
 
-  * GCC 7 snapshot build, taken from the trunk 20161217.
+  * GCC 7 snapshot build, taken from the trunk 20161229.
+  * Update gdc to trunk 20161229.
   * Build the cilk runtime on armel, armhf, sparc and sparc64.
   * Use --push-state/--pop-state for gold as well when linking libtsan.
   * In GCC ICE dumps, prefix each line with the PID of the driver.
   * Apply proposed patch for PR target/78748.
-  * Update gdc to trunk 20161217.
   * Apply proposed patch for PR libstdc++/64735.
   * Don't mark libphobos multilib packages as M-A: same.
+  * Configure libphobos builds with --with-target-system-zlib.
+  * Ignore dpkg's pie specs when pie is not enabled. Addresses: #848129.
 
- -- Matthias Klose <doko at debian.org>  Sat, 17 Dec 2016 13:59:47 +0100
+ -- Matthias Klose <doko at debian.org>  Thu, 29 Dec 2016 07:38:54 +0100
 
 gcc-7 (7-20161201-1) experimental; urgency=medium
 
diff --git a/debian/patches/gdc-libphobos-link.diff b/debian/patches/gdc-libphobos-link.diff
deleted file mode 100644
index 6b008b2..0000000
--- a/debian/patches/gdc-libphobos-link.diff
+++ /dev/null
@@ -1,108 +0,0 @@
-# DP: gdc: Always link with -ldl when linking with -lgphobos.
-
-Index: b/src/gcc/d/d-spec.c
-===================================================================
---- a/src/gcc/d/d-spec.c
-+++ b/src/gcc/d/d-spec.c
-@@ -35,6 +35,8 @@ along with GCC; see the file COPYING3.
- #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)
- 
-@@ -74,6 +76,10 @@ along with GCC; see the file COPYING3.
- #define LIBDRUNTIME_PROFILE LIBDRUNTIME
- #endif
- 
-+#ifndef DL_LIBRARY
-+#define DL_LIBRARY "dl"
-+#endif
-+
- void
- lang_specific_driver (cl_decoded_option **in_decoded_options,
- 		      unsigned int *in_decoded_options_count,
-@@ -129,6 +135,9 @@ lang_specific_driver (cl_decoded_option
-   /* By default, we throw on the time library if we have one.  */
-   bool 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. */
-   bool static_link = false;
- 
-@@ -162,6 +171,9 @@ lang_specific_driver (cl_decoded_option
-   /* The number of libraries added in.  */
-   int added_libraries = *in_added_libraries;
- 
-+  /* "-ldl" if it appears on the command line.  */
-+  const cl_decoded_option *saw_dl = 0;
-+
-   /* An array used to flag each argument that needs a bit set for
-      DSOURCE, MATHLIB, WITHTHREAD, WITHLIBC or WITHLIBCXX.  */
-   int *args = XCNEWVEC (int, argc);
-@@ -229,6 +241,11 @@ lang_specific_driver (cl_decoded_option
- 	      args[i] |= TIMELIB;
- 	      need_time = false;
- 	    }
-+	  else if (strcmp (arg, DL_LIBRARY) == 0)
-+	    {
-+	      args[i] |= DLLIB;
-+	      need_dl = 0;
-+	    }
- 	  else if (strcmp (arg, "c") == 0)
- 	    args[i] |= WITHLIBC;
- 	  else
-@@ -392,6 +409,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;
-@@ -449,9 +472,6 @@ lang_specific_driver (cl_decoded_option
-   /* Add `-lgphobos' if we haven't already done so.  */
-   if (library > 0 && need_phobos)
-     {
--      // Default to static linking
--      if (library == 1)
--        library = 2;
- 
- #ifdef HAVE_LD_STATIC_DYNAMIC
-       if (library == 3 && static_link)
-@@ -476,6 +496,10 @@ lang_specific_driver (cl_decoded_option
- 		       CL_DRIVER, &new_decoded_options[j]);
-       added_libraries++;
-       j++;
-+      generate_option (OPT_l, DL_LIBRARY, 1,
-+		       CL_DRIVER, &new_decoded_options[j]);
-+      added_libraries++;
-+      j++;
- 
- #ifdef HAVE_LD_STATIC_DYNAMIC
-       if (library == 3 && static_link)
-@@ -546,6 +570,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;
diff --git a/debian/patches/ignore-pie-specs-when-not-enabled.diff b/debian/patches/ignore-pie-specs-when-not-enabled.diff
new file mode 100644
index 0000000..8f5cc09
--- /dev/null
+++ b/debian/patches/ignore-pie-specs-when-not-enabled.diff
@@ -0,0 +1,56 @@
+# DP: Ignore dpkg's pie specs when pie is not enabled.
+
+Index: b/src/gcc/gcc.c
+===================================================================
+--- a/src/gcc/gcc.c
++++ b/src/gcc/gcc.c
+@@ -3715,6 +3715,36 @@ handle_foffload_option (const char *arg)
+     }
+ }
+ 
++static bool ignore_pie_specs_when_not_enabled(const char *envvar,
++					      const char *specname)
++{
++  const char *envval = secure_getenv(envvar);
++  char *hardening;
++  bool ignore;
++
++  if (strstr (specname, "/pie-compile.specs") == NULL
++      && strstr (specname, "/pie-link.specs") == NULL)
++    return false;
++  if (envval == NULL || strstr (envval, "hardening=") == NULL)
++    return true;
++  ignore = true;
++  hardening = (char *) xmalloc (strlen(envval) + 1);
++  strcpy (hardening, strstr (envval, "hardening="));
++  if (strchr (hardening, ' '))
++    *strchr (hardening, ' ') = '\0';
++  if (strstr(hardening, "+all"))
++    {
++      if (strstr(hardening, "-pie") == NULL)
++	ignore = false;
++    }
++  else if (strstr(hardening, "+pie"))
++    {
++      ignore = false;
++    }
++  free (hardening);
++  return ignore;
++}
++
+ /* Handle a driver option; arguments and return value as for
+    handle_option.  */
+ 
+@@ -3989,6 +4019,12 @@ driver_handle_option (struct gcc_options
+       break;
+ 
+     case OPT_specs_:
++      if (ignore_pie_specs_when_not_enabled("DEB_BUILD_MAINT_OPTIONS", arg)
++	  && ignore_pie_specs_when_not_enabled("DEB_BUILD_OPTIONS", arg))
++	{
++	  inform (0, "pie specs %s ignored when pie is not enabled", arg);
++	  return true;
++	}
+       {
+ 	struct user_specs *user = XNEW (struct user_specs);
+ 
diff --git a/debian/patches/libphobos-zlib.diff b/debian/patches/libphobos-zlib.diff
index 2328599..1aa8282 100644
--- a/debian/patches/libphobos-zlib.diff
+++ b/debian/patches/libphobos-zlib.diff
@@ -4,28 +4,42 @@ Index: b/src/libphobos/configure.ac
 ===================================================================
 --- a/src/libphobos/configure.ac
 +++ b/src/libphobos/configure.ac
-@@ -91,6 +91,7 @@ DRUNTIME_OS_THREAD_MODEL
- DRUNTIME_OS_ARM_EABI_UNWINDER
- DRUNTIME_OS_MINFO_BRACKETING
- DRUNTIME_LIBRARIES_THREAD
-+dnl fake change to regenerate the configure file
- DRUNTIME_LIBRARIES_ZLIB
+@@ -104,6 +104,7 @@ WITH_LOCAL_DRUNTIME([
+ 
  DRUNTIME_LIBBACKTRACE_SETUP
  DRUNTIME_INSTALL_DIRECTORIES
++dnl fake change to regenerate the configure file
+ 
+ # Add dependencies for libgphobos.spec file
+ LIBS="$LIBS $LIBADD_DLOPEN"
 Index: b/src/libphobos/m4/druntime/libraries.m4
 ===================================================================
 --- a/src/libphobos/m4/druntime/libraries.m4
 +++ b/src/libphobos/m4/druntime/libraries.m4
-@@ -28,5 +28,39 @@ AC_DEFUN([DRUNTIME_LIBRARIES_ZLIB],
-     AS_HELP_STRING([--with-system-zlib],
-                    [use installed libz (default: no)]),
-     [system_zlib=yes],[system_zlib=no])
-+
+@@ -39,18 +39,44 @@ AC_DEFUN([DRUNTIME_LIBRARIES_ZLIB],
+ [
+   AC_ARG_WITH(target-system-zlib,
+     AS_HELP_STRING([--with-target-system-zlib],
+-                   [use installed libz (default: no)]))
++                   [use installed libz (default: no)]),
++     [system_zlib=yes],[system_zlib=no])
+ 
+-  system_zlib=false
+-  AS_IF([test "x$with_target_system_zlib" = "xyes"], [
+-    AC_CHECK_LIB([z], [deflate], [
+-      system_zlib=yes
+-      ], [
+-      AC_MSG_ERROR([System zlib not found])])
+-  ], [
+-    AC_MSG_CHECKING([for zlib])
+-    AC_MSG_RESULT([just compiled])
+-  ])
 +  AC_MSG_CHECKING([for system zlib])
 +  save_LIBS=$LIBS
 +  LIBS="$LIBS -lz"
 +  dnl the link test is not good enough for ARM32 multilib detection,
 +  dnl first check to link, then to run
++  AC_LANG_PUSH(C)
 +  AC_LINK_IFELSE(
 +    [AC_LANG_PROGRAM([#include <zlib.h>],[gzopen("none", "rb")])],
 +    [
@@ -54,5 +68,7 @@ Index: b/src/libphobos/m4/druntime/libraries.m4
 +  else
 +    AC_MSG_RESULT([not enabled])
 +  fi
-   AM_CONDITIONAL([DRUNTIME_ZLIB_SYSTEM], [test "$system_zlib" = yes])
++  AC_LANG_POP
+ 
+   AM_CONDITIONAL([DRUNTIME_ZLIB_SYSTEM], [test "$with_target_system_zlib" = yes])
  ])
diff --git a/debian/patches/pr78748.diff b/debian/patches/pr78748.diff
deleted file mode 100644
index 6cd2a2e..0000000
--- a/debian/patches/pr78748.diff
+++ /dev/null
@@ -1,53 +0,0 @@
->From b48da97e3b2f5b0b49543ed35d8c667a607067cf Mon Sep 17 00:00:00 2001
-From: Dominik Vogt <vogt at linux.vnet.ibm.com>
-Date: Mon, 12 Dec 2016 10:35:21 +0100
-Subject: [PATCH] PR target/78748: S/390: Fix ICE with ANDC splitter.
-
----
- gcc/config/s390/s390.md                       |  6 +++++-
- gcc/testsuite/gcc.c-torture/compile/pr78748.c | 16 ++++++++++++++++
- 2 files changed, 21 insertions(+), 1 deletion(-)
- create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr78748.c
-
-diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
-index 4f2effd..9d8e6b6 100644
---- a/src/gcc/config/s390/s390.md
-+++ b/src/gcc/config/s390/s390.md
-@@ -7420,7 +7420,11 @@
- 	(and:GPR (not:GPR (match_operand:GPR 1 "nonimmediate_operand" ""))
- 		 (match_operand:GPR 2 "general_operand" "")))
-    (clobber (reg:CC CC_REGNUM))]
--  "! reload_completed && s390_logical_operator_ok_p (operands)"
-+  "! reload_completed
-+   && (GET_CODE (operands[0]) != MEM
-+      /* Ensure that s390_logical_operator_ok_p will succeed even
-+	 on the split xor if (b & a) is stored into a pseudo.  */
-+       || rtx_equal_p (operands[0], operands[2]))"
-   "#"
-   "&& 1"
-   [
-diff --git a/gcc/testsuite/gcc.c-torture/compile/pr78748.c b/gcc/testsuite/gcc.c-torture/compile/pr78748.c
-new file mode 100644
-index 0000000..d24a334
---- /dev/null
-+++ b/src/gcc/testsuite/gcc.c-torture/compile/pr78748.c
-@@ -0,0 +1,16 @@
-+/* PR target/78748 */
-+/* { dg-options "-march=zEC12" { target { s390*-*-* } } } */
-+
-+void
-+foo (int *p, int *q)
-+{
-+  *q = *p & ~*q;
-+}
-+
-+#if 0 /*!!!*/
-+void
-+bar (int *p, int *q)
-+{
-+  *q = ~*p & *q;
-+}
-+#endif
--- 
-2.3.0
-
diff --git a/debian/rules.d/binary-d.mk b/debian/rules.d/binary-d.mk
index c409f68..21b27da 100644
--- a/debian/rules.d/binary-d.mk
+++ b/debian/rules.d/binary-d.mk
@@ -101,6 +101,10 @@ $(binary_stamp)-gdc: $(install_stamp)
 
 	$(dh_compat2) dh_movefiles -p$(p_gdc) -X/zlib/ $(files_gdc)
 
+ifeq ($(with_libphobos),yes)
+	mv $(d)/$(usr_lib)/libgphobos.spec $(d_gdc)/$(gcc_lib_dir)/
+endif
+
 ifeq ($(unprefixed_names),yes)
 	ln -sf $(cmd_prefix)gdc$(pkg_ver) \
 	    $(d_gdc)/$(PF)/bin/gdc$(pkg_ver)
diff --git a/debian/rules.patch b/debian/rules.patch
index 4273075..679f0e8 100644
--- a/debian/rules.patch
+++ b/debian/rules.patch
@@ -86,7 +86,7 @@ ifeq ($(with_ssp)-$(with_ssp_default),yes-yes)
     hardening_patches += gcc-default-ssp-strong
   endif
 endif
-ifeq ($(distribution),Ubuntu)
+ifneq (,$(filter $(derivative),Ubuntu))
   ifneq (,$(findstring gcc-7, $(PKGSOURCE)))
     hardening_patches += \
 	gcc-default-fortify-source \
@@ -98,6 +98,16 @@ ifeq ($(distribution),Ubuntu)
     ifeq ($(with_pie),yes)
       hardening_patches += \
 	bind_now_when_pie
+    else
+      hardening_patches += \
+        ignore-pie-specs-when-not-enabled
+    endif
+  endif
+else ifneq (,$(filter $(derivative),Debian))
+  ifneq (,$(findstring gcc-7, $(PKGSOURCE)))
+    ifneq ($(with_pie),yes)
+      hardening_patches += \
+        ignore-pie-specs-when-not-enabled
     endif
   endif
 endif
@@ -148,7 +158,6 @@ ifeq ($(with_d),yes)
 	gdc-frontend-posix \
 	gdc-base-version \
 	gdc-profiledbuild \
-	gdc-libphobos-link \
 #	gdc-multiarch
   ifneq ($(GFDL_INVARIANT_FREE),yes)
     debian_patches += gdc-7-doc
@@ -226,7 +235,6 @@ debian_patches += skip-bootstrap-multilib
 debian_patches += libffi-ro-eh_frame_sect
 debian_patches += libffi-mips
 debian_patches += ada-kfreebsd
-debian_patches += pr78748
 
 # sigaction on sparc changed between glibc 2.19 and 2.21
 ifeq (,$(filter 2.1%, $(shell dpkg-query -l libc-bin | awk '/^.i/ {print $$3}')))
diff --git a/debian/rules2 b/debian/rules2
index 5def638..7e5587a 100644
--- a/debian/rules2
+++ b/debian/rules2
@@ -357,6 +357,10 @@ endif # !DEB_STAGE
 
 CONFARGS += --with-system-zlib
 
+ifeq ($(with_libphobos),yes)
+  CONFARGS += --with-target-system-zlib
+endif
+
 ifeq ($(with_objc)-$(with_objc_gc),yes-yes)
   CONFARGS += --enable-objc-gc=auto
 endif

-- 
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