[DHG_packages] 01/01: Patch GHC to pass `-no-pie' along with `-Wl, -r'

Ilias Tsitsimpis iliastsi-guest at moszumanska.debian.org
Mon Oct 24 16:53:08 UTC 2016


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

iliastsi-guest pushed a commit to branch experimental
in repository DHG_packages.

commit f9271c77f070b26b39a5847f9d3a52c516ad1af7
Author: Ilias Tsitsimpis <i.tsitsimpis at gmail.com>
Date:   Mon Oct 24 19:48:38 2016 +0300

    Patch GHC to pass `-no-pie' along with `-Wl,-r'
    
    GHC uncoditionally passes `-Wl,-r' to gcc in
    `compiler/main/DriverPipeline.hs'. This fails in cases where PIE is
    enabled by default with the following error:
    
      /usr/bin/ld: -r and -pie may not be used together
    
    Fix the above error by passing `-no-pie' along with `-Wl,-r' to the
    compiler.
---
 p/ghc/debian/changelog      |  8 ++++++++
 p/ghc/debian/patches/no-pie | 26 ++++++++++++++++++++++++++
 p/ghc/debian/patches/series |  1 +
 p/ghc/debian/rules          |  8 --------
 4 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/p/ghc/debian/changelog b/p/ghc/debian/changelog
index b3cc352..1f1b062 100644
--- a/p/ghc/debian/changelog
+++ b/p/ghc/debian/changelog
@@ -1,3 +1,11 @@
+ghc (8.0.1-6) experimental; urgency=medium
+
+  * Patch GHC to pass `-no-pie' along with `-Wl,-r'.
+  * Do not disable PIE during package configuration in d/rules.
+    The above patch seems sufficient.
+
+ -- Ilias Tsitsimpis <i.tsitsimpis at gmail.com>  Mon, 24 Oct 2016 19:48:26 +0300
+
 ghc (8.0.1-5) experimental; urgency=medium
 
   * Switch PIC default to on for all architectures.
diff --git a/p/ghc/debian/patches/no-pie b/p/ghc/debian/patches/no-pie
new file mode 100644
index 0000000..0530cdd
--- /dev/null
+++ b/p/ghc/debian/patches/no-pie
@@ -0,0 +1,26 @@
+Description: Pass -no-pie along with -Wl,-r
+ GHC uncoditionally passes `-Wl,-r' to gcc in `compiler/main/DriverPipeline.hs'.
+ This fails in cases where PIE is enabled by default with the following error:
+ .
+   /usr/bin/ld: -r and -pie may not be used together
+ .
+ Fix the above error by passing `-no-pie' along with `-Wl,-r' to the compiler.
+Author: Ilias Tsitsimpis <i.tsitsimpis at gmail.com>
+Bug: https://ghc.haskell.org/trac/ghc/ticket/11834
+Bug-Debian: https://bugs.debian.org/712228
+Forwarded: no
+
+Index: b/compiler/main/DriverPipeline.hs
+===================================================================
+--- a/compiler/main/DriverPipeline.hs
++++ b/compiler/main/DriverPipeline.hs
+@@ -2145,7 +2145,8 @@ joinObjectFiles dflags o_files output_fn
+       osInfo = platformOS (targetPlatform dflags)
+       ld_r args cc = SysTools.runLink dflags ([
+                        SysTools.Option "-nostdlib",
+-                       SysTools.Option "-Wl,-r"
++                       SysTools.Option "-Wl,-r",
++                       SysTools.Option "-no-pie"
+                      ]
+                      ++ (if any (cc ==) [Clang, AppleClang, AppleClang51]
+                           then []
diff --git a/p/ghc/debian/patches/series b/p/ghc/debian/patches/series
index b391048..0e9152a 100644
--- a/p/ghc/debian/patches/series
+++ b/p/ghc/debian/patches/series
@@ -7,3 +7,4 @@ reproducible-tmp-names
 do-not-use-SHELL
 add-missing-MO_WriteBarrier
 opt-pic
+no-pie
diff --git a/p/ghc/debian/rules b/p/ghc/debian/rules
index 6276b4a..5345397 100755
--- a/p/ghc/debian/rules
+++ b/p/ghc/debian/rules
@@ -34,11 +34,6 @@ ProjectVersion=$(shell cat VERSION)
 
 GHC=$(firstword $(shell bash -c "type -p ghc"))
 EXTRA_CONFIGURE_FLAGS=--with-ghc="$(GHC)"
-EXTRA_CONFIGURE_FLAGS += \
-	LDFLAGS=-no-pie CFLAGS=-fno-PIE \
-	CONF_CC_OPTS_STAGE2=-fno-PIE \
-	CONF_GCC_LINKER_OPTS_STAGE2=-no-pie \
-	CONF_LD_LINKER_OPTS_STAGE2=-no-pie
 
 BUILD_HADDOCK_DOCS=YES
 DEB_HOOGLE_TXT_DIR = /usr/lib/ghc-doc/hoogle/
@@ -61,9 +56,6 @@ endif
 ifeq (armel,$(DEB_HOST_ARCH))
 	patch -p1 < debian/patches/armel-revert-ghci-fixes.patch
 endif
-	echo "SRC_HC_OPTS += -optc-fno-PIE -optl-no-pie" >> mk/build.mk
-	echo "SRC_CC_OPTS += -fno-PIE" >> mk/build.mk
-	echo "SRC_LD_OPTS += -no-pie" >> mk/build.mk
 ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
 #	echo "GhcStage1HcOpts += -DDEBUG" >> mk/build.mk
 #	echo "GhcStage2HcOpts += -DDEBUG" >> mk/build.mk

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/DHG_packages.git



More information about the Pkg-haskell-commits mailing list