[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#892281: gcc: make PIE opt-out rather than opt-in



Control: tags -1 + patch

On Wed, Mar 07, 2018 at 07:16:26PM +0100, Helmut Grohne wrote:
> Since it practically is the default "everywhere", can we move on to
> enable PIE for all "new" architectures by turning the opt-in list
> opt-out? While at it, can we keep this list as small as possible? At
> least for musl-linux-any and x32, we know that !PIE causes more harm
> than PIE.

The attached patch implements opt-in. It does not change x32 to be
conservative. It does change musl to keep the list short, but there is
no relevant Debian musl deployment anyhow.

Helmut
diff -u gcc-8-8.2.0/debian/changelog gcc-8-8.2.0/debian/changelog
--- gcc-8-8.2.0/debian/changelog
+++ gcc-8-8.2.0/debian/changelog
@@ -1,3 +1,10 @@
+gcc-8 (8.2.0-7.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Make PIE opt-out starting with buster. (Closes: 892281)
+
+ -- Helmut Grohne <helmut@subdivi.de>  Sat, 29 Sep 2018 09:37:18 +0200
+
 gcc-8 (8.2.0-7) unstable; urgency=medium
 
   * Update to SVN 20180917 (r264370) from the gcc-8-branch.
diff -u gcc-8-8.2.0/debian/rules.defs gcc-8-8.2.0/debian/rules.defs
--- gcc-8-8.2.0/debian/rules.defs
+++ gcc-8-8.2.0/debian/rules.defs
@@ -1243,7 +1243,8 @@
 		hurd-i386 riscv64
   endif
   ifeq (,$(filter $(distrelease),wheezy squeeze jessie stretch))
-    pie_archs += powerpc ppc64
+    nopie_archs = alpha arm arm64ilp32 armeb avr32 hppa ia64 m32r m68k nios2 \
+		  or1k powerpcel powerpcspe s390 sh3 sh3eb sh4 sh4eb tilegx x32
   endif
 else ifeq ($(distribution),Ubuntu)
   ifeq (,$(filter $(distrelease),lucid precise trusty utopic vivid wily))
@@ -1256,8 +1257,14 @@
     pie_archs += armhf arm64 i386
   endif
 endif
-ifneq (,$(filter $(DEB_TARGET_ARCH),$(pie_archs)))
-  with_pie := yes
+ifneq (,$(nopie_archs))
+  ifeq (,$(filter $(DEB_TARGET_ARCH),$(nopie_archs)))
+    with_pie := yes
+  endif
+else
+  ifneq (,$(filter $(DEB_TARGET_ARCH),$(pie_archs)))
+    with_pie := yes
+  endif
 endif
 ifeq ($(trunk_build),yes)
   with_pie := disabled for trunk builds

Reply to: