Debian Bug report logs - #807366
ghc: disable PIE on Ubuntu/s390x

version graph

Package: ghc; Maintainer for ghc is Debian Haskell Group <pkg-haskell-maintainers@lists.alioth.debian.org>; Source for ghc is src:ghc (PTS, buildd, popcon).

Reported by: Colin Watson <cjwatson@ubuntu.com>

Date: Mon, 7 Dec 2015 23:42:02 UTC

Severity: normal

Tags: patch

Found in version ghc/7.10.3-2

Fixed in version ghc/7.10.3-4

Done: Joachim Breitner <nomeata@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Haskell Group <pkg-haskell-maintainers@lists.alioth.debian.org>:
Bug#807366; Package ghc. (Mon, 07 Dec 2015 23:42:06 GMT) (full text, mbox, link).


Acknowledgement sent to Colin Watson <cjwatson@ubuntu.com>:
New Bug report received and forwarded. Copy sent to Debian Haskell Group <pkg-haskell-maintainers@lists.alioth.debian.org>. (Mon, 07 Dec 2015 23:42:06 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Colin Watson <cjwatson@ubuntu.com>
To: submit@bugs.debian.org
Subject: ghc: disable PIE on Ubuntu/s390x
Date: Mon, 7 Dec 2015 23:39:19 +0000
Package: ghc
Version: 7.10.3-2
Severity: normal
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch xenial

The newly-bootstrapped Ubuntu s390x architecture has its toolchain
configured to use PIE by default (I presume by customer request, though
I don't know the details).  Binaries built by GHC segfault immediately
if PIE is in use.  I think it would make sense to just disable PIE on
s390x; it's not enabled by default on Debian s390x, but -fno-PIE/-no-pie
should be harmless.

Disabling this both during the GHC build itself and for things that the
resulting /usr/bin/ghc compiles requires a couple of different pieces.
Here's a tested patch (which could be refactored later if more
architectures have this problem in future):

diff --git a/p/ghc/debian/rules b/p/ghc/debian/rules
index b285537..ca8d8f3 100755
--- a/p/ghc/debian/rules
+++ b/p/ghc/debian/rules
@@ -34,6 +34,12 @@ ProjectVersion=$(shell cat VERSION)
 
 GHC=$(firstword $(shell bash -c "type -p ghc"))
 EXTRA_CONFIGURE_FLAGS=--with-ghc="$(GHC)"
+ifeq (s390x,$(DEB_HOST_ARCH))
+  EXTRA_CONFIGURE_FLAGS += \
+	CONF_CC_OPTS_STAGE2=-fno-PIE \
+	CONF_GCC_LINKER_OPTS_STAGE2=-no-pie \
+	CONF_LD_LINKER_OPTS_STAGE2=-no-pie
+endif
 BUILD_HADDOCK_DOCS=YES
 DEB_HOOGLE_TXT_DIR = /usr/lib/ghc-doc/hoogle/
 
@@ -51,6 +57,10 @@ endif
 ifeq (armhf,$(DEB_HOST_ARCH))
 	echo "SRC_HC_OPTS += -D__ARM_PCS_VFP" >> mk/build.mk
 endif
+ifeq (s390x,$(DEB_HOST_ARCH))
+	echo "SRC_CC_OPTS += -fno-PIE" >> mk/build.mk
+	echo "SRC_LD_OPTS += -no-pie" >> mk/build.mk
+endif
 ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
 #	echo "GhcStage1HcOpts += -DDEBUG" >> mk/build.mk
 #	echo "GhcStage2HcOpts += -DDEBUG" >> mk/build.mk

Thanks,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]



Added tag(s) pending. Request was from Colin Watson <cjwatson@debian.org> to control@bugs.debian.org. (Tue, 08 Dec 2015 12:12:03 GMT) (full text, mbox, link).


Reply sent to Joachim Breitner <nomeata@debian.org>:
You have taken responsibility. (Mon, 14 Dec 2015 09:39:08 GMT) (full text, mbox, link).


Notification sent to Colin Watson <cjwatson@ubuntu.com>:
Bug acknowledged by developer. (Mon, 14 Dec 2015 09:39:08 GMT) (full text, mbox, link).


Message #12 received at 807366-close@bugs.debian.org (full text, mbox, reply):

From: Joachim Breitner <nomeata@debian.org>
To: 807366-close@bugs.debian.org
Subject: Bug#807366: fixed in ghc 7.10.3-4
Date: Mon, 14 Dec 2015 09:36:05 +0000
Source: ghc
Source-Version: 7.10.3-4

We believe that the bug you reported is fixed in the latest version of
ghc, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 807366@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Joachim Breitner <nomeata@debian.org> (supplier of updated ghc package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Mon, 14 Dec 2015 09:09:52 +0100
Source: ghc
Binary: ghc ghc-prof ghc-doc
Architecture: source
Version: 7.10.3-4
Distribution: unstable
Urgency: medium
Maintainer: Debian Haskell Group <pkg-haskell-maintainers@lists.alioth.debian.org>
Changed-By: Joachim Breitner <nomeata@debian.org>
Description:
 ghc        - The Glasgow Haskell Compilation system
 ghc-doc    - Documentation for the Glasgow Haskell Compilation system
 ghc-prof   - Profiling libraries for the Glasgow Haskell Compilation system
Closes: 807366 807777
Changes:
 ghc (7.10.3-4) unstable; urgency=medium
 .
   [ Colin Watson ]
   * Disable PIE on s390x, since Ubuntu's toolchain defaults to enabling it
     there (closes: #807366).
 .
   [ Joachim Breitner ]
   * Add patch for Sparc64. Again thanks to John Paul Adrian Glaubitz for the
     patch (Closes: #807777).
Checksums-Sha1:
 38ec90011f6aabad64644cc39c4034a6c8e36d10 2291 ghc_7.10.3-4.dsc
 748498d863f0cea0ac7e44f5ae700b3f5e6d992b 45888 ghc_7.10.3-4.debian.tar.xz
Checksums-Sha256:
 adb64ff6325a0684362830df1b49696baf6cda0d7f80d1a7bacebb78f79eb4d5 2291 ghc_7.10.3-4.dsc
 763bf7314e53498463502f438fe3bb5285f605dfd9c11d8fb8cc83a3c285fff0 45888 ghc_7.10.3-4.debian.tar.xz
Files:
 3427b087306b19617607a580d98b4457 2291 haskell extra ghc_7.10.3-4.dsc
 4f3a28b49fc7218b1c3eaf95285597e2 45888 haskell extra ghc_7.10.3-4.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJWbnnUAAoJED2QirPw+/UfJ4gP/3u0e1ySLIsHvGUq7KxVN8D+
rhFPnPiSyPStUnTX8pEqpbXfd2zmSwfCDcUGwbJ4ZKcHkaI6g1YdrA64vBtoA/+R
NVhxEJmUVTe/pn1vQamqNiMQyxyT+4HnP5K9Gd15f7kcioSl2oiSyON9AVC1vHtm
KpNvGvYr+ciEjewqWmpsKr10njFQM1BeOGTrt3ZuRcc3MbKPadOxOczRxVpKe0O0
gJ9Wofu0rOv/NMMrMGxMrZirTZ60868qT3rqzQOxlgxf3n02TNvIkR77InePfWTC
OFl29lIUierE4OT2lJw69Gr8Zu8I9qP9/bDI3I+W4Zv0X8P4e5Thu/hb1xcXbixM
+RnmlvIDCF/HpeTtE5fmR3pME/aPup6v6MCayHSFHEoQlBK86bwDLCN/PMW7fi55
/z53JEnRW2ug95bi0abwrAb+/LXtc9OVPB6g3pWSGxQbq3dPY53z6teyfEOc4KeM
hIcIvf/+q8I34MyyVPwVEAckbc43tlKaUCwk/Ij3Pefjwfpbref92ub9jLqHz/+o
JrlAOvxq4PABxN1cO/oncQOJ96F21H+ZK3kzBvw1JIpqPeONPDSrJ2CnGwkHLHzN
SKUAJWQ+4d6V9KbEwCmAZQlIA8k99yGDKgNUdPfSp83AaDeeUaaTYXhXtItE+agQ
WNc1KlNSPe76P4myBNi7
=/8MZ
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 18 Jan 2016 07:55:01 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Jan 4 23:01:29 2018; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.