From 096fba7df4a9d699015c5f5457be7fdd21cde33e Mon Sep 17 00:00:00 2001
From: Balint Reczey <balint@balintreczey.hu>
Date: Sun, 3 Jul 2016 21:09:36 +0200
Subject: [PATCH] Enable PIE on Debian for amd64, ppc64el and s390x

---
 debian/rules.defs | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/debian/rules.defs b/debian/rules.defs
index 47a067d..443eba4 100644
--- a/debian/rules.defs
+++ b/debian/rules.defs
@@ -1222,16 +1222,19 @@ endif
 
 # pie by default --------------------
 with_pie :=
+pie_archs := amd64 ppc64el s390x
 ifeq ($(distribution),Ubuntu)
   ifeq (,$(filter $(distrelease),lucid precise trusty utopic vivid wily))
     pie_archs = s390x
+  else
+    pie_archs =
   endif
   ifeq (,$(filter $(distrelease),lucid precise trusty utopic vivid wily xenial))
     pie_archs += amd64 ppc64el
   endif
-  ifneq (,$(filter $(DEB_TARGET_ARCH),$(pie_archs)))
-    with_pie := yes
-  endif
+endif
+ifneq (,$(filter $(DEB_TARGET_ARCH),$(pie_archs)))
+  with_pie := yes
 endif
 
 # gold --------------------
-- 
2.1.4

