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

Re: Bug#843791: ghc: builds fail on hurd-i386: /usr/bin/ld: -r and -pie may not be used together



Hi!

On Thu, 2016-11-10 at 01:21:11 +0100, Samuel Thibault wrote:
> Clint Adams, on Wed 09 Nov 2016 17:08:23 +0000, wrote:
> > On Wed, Nov 09, 2016 at 05:47:13PM +0100, Samuel Thibault wrote:
> > > It seems the latest ghc has troubles building packages on hurd-i386:
> > > 
> > > [ 1 of 18] Compiling Data.Streaming.Zlib.Lowlevel ( Data/Streaming/Zlib/Lowlevel.hs, dist-ghc/build/Data/Streaming/Zlib/Lowlevel.o )
> > > ...
> > > [18 of 18] Compiling Data.Streaming.Text ( Data/Streaming/Text.hs, dist-ghc/build/Data/Streaming/Text.o )
> > > [ 1 of 18] Compiling Data.Streaming.Zlib.Lowlevel ( Data/Streaming/Zlib/Lowlevel.hs, dist-ghc/build/Data/Streaming/Zlib/Lowlevel.p_o )
> > > /usr/bin/ld: -r and -pie may not be used together
> > 
> > That's confusing.
> 
> This seems to be triggered by the newer dpkg, which apparently emits
> -pie itself on hurd-i386: on my not-so-up-to-date box I hadn't the
> issue, and after upgrading dpkg&dpkg-dev I got the issue on my box too.
> 
> dpkg maintainers: ghc does emi -no-pie, but it seems dpkg's -pie
> overrides it.

Ok, could you try the following patch for the specs files? That's be
appreciated. I've tested those standalone on the Hurd with a synthetic
test file, but not as part of GHC build or similar.

> I'm however surprised that dpkg adds -pie on hurd-i386 too: AIUI hurd's
> gcc does have pie enabled by default too.

Very unfortunately nope, supposedly only architectures for which
porters requested it to be enabled, which means we have a mess of
arches that do PIE by default and others that do not. :(

  <https://sources.debian.net/src/gcc-6/6.2.0-13/debian/rules.defs/#L1261>

If you request it to be enabled on Hurd (which I think would be way
ideal), please let me know and I'll mark it as such in dpkg-dev. :)

Thanks,
Guillem
diff --git i/data/no-pie-compile.specs w/data/no-pie-compile.specs
index f85b394..2277b97 100644
--- i/data/no-pie-compile.specs
+++ w/data/no-pie-compile.specs
@@ -1,2 +1,2 @@
-*cc1_options:
+*self_spec:
 + %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fno-PIE}}}}}}
diff --git i/data/no-pie-link.specs w/data/no-pie-link.specs
index 15243a0..54db649 100644
--- i/data/no-pie-link.specs
+++ w/data/no-pie-link.specs
@@ -1,2 +1,2 @@
 *self_spec:
-+ %{!shared:%{!r:-fno-PIE -no-pie}}
++ %{!shared:%{!r:%{!fPIE:%{!pie:-fno-PIE -no-pie}}}}
diff --git i/data/pie-compile.specs w/data/pie-compile.specs
index fc54bcb..74d8215 100644
--- i/data/pie-compile.specs
+++ w/data/pie-compile.specs
@@ -1,2 +1,2 @@
-*cc1_options:
-+ %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}}
+*self_spec:
++ %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:%{!fno-PIE:%{!no-pie:-fPIE}}}}}}}}
diff --git i/data/pie-link.specs w/data/pie-link.specs
index a5e0fe4..35d26e1 100644
--- i/data/pie-link.specs
+++ w/data/pie-link.specs
@@ -1,2 +1,2 @@
 *self_spec:
-+ %{!shared:%{!r:-fPIE -pie}}
++ %{!shared:%{!r:%{!fno-PIE:%{!no-pie:-fPIE -pie}}}}

Reply to: