Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1200750 > unrolled thread

Bug#1023649: ghc: FTBFS haskell-random powerpc (ghc Segmentation fault)

Started byJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
First post2024-06-13 09:50 +0200
Last post2024-06-14 10:40 +0200
Articles 6 — 3 participants

Back to article view | Back to linux.debian.bugs.dist

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Bug#1023649: ghc: FTBFS haskell-random powerpc (ghc Segmentation fault) John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> - 2024-06-13 09:50 +0200
    Bug#1023649: ghc: FTBFS haskell-random powerpc (ghc Segmentation fault) Jeffrey Walton <noloader@gmail.com> - 2024-06-13 10:00 +0200
      Bug#1023649: ghc: FTBFS haskell-random powerpc (ghc Segmentation fault) John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> - 2024-06-13 10:20 +0200
        Bug#1023649: ghc: FTBFS haskell-random powerpc (ghc Segmentation fault) Ilias Tsitsimpis <iliastsi@debian.org> - 2024-06-13 20:40 +0200
          Bug#1023649: ghc: FTBFS haskell-random powerpc (ghc Segmentation fault) John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> - 2024-06-13 21:00 +0200
            Bug#1023649: ghc: FTBFS haskell-random powerpc (ghc Segmentation fault) John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> - 2024-06-14 10:40 +0200

#1200750 — Bug#1023649: ghc: FTBFS haskell-random powerpc (ghc Segmentation fault)

FromJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date2024-06-13 09:50 +0200
SubjectBug#1023649: ghc: FTBFS haskell-random powerpc (ghc Segmentation fault)
Message-ID<IONnz-2Ap3-1@gated-at.bofh.it>
Hi,

I finally figured out what the problem is. 

After realizing that the two-stage build of GHC works without problems,
I realized it can be a configuration issue only and, indeed, it is.

Looking at /usr/lib/ghc/lib/settings, the default linker is set to gold:

	"C compiler link flags", "-fuse-ld=gold"

Since gold is broken on powerpc and shouldn't really be used anymore since
it's basically unmaintained upstream, we must use bfd on powerpc by default.

Editing the file and switching back to bfd fixes the problem for me.

Now we just need to figure out how to actually set the default linker back
to bfd as it was actually explicitly supposed to happen according to
debian/rules.

This will most likely also unbreak GHC on m68k.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

[toc] | [next] | [standalone]


#1200752

FromJeffrey Walton <noloader@gmail.com>
Date2024-06-13 10:00 +0200
Message-ID<IONxf-2AE2-5@gated-at.bofh.it>
In reply to#1200750
On Thu, Jun 13, 2024 at 3:41 AM John Paul Adrian Glaubitz
<glaubitz@physik.fu-berlin.de> wrote:
>
> I finally figured out what the problem is.
>
> After realizing that the two-stage build of GHC works without problems,
> I realized it can be a configuration issue only and, indeed, it is.
>
> Looking at /usr/lib/ghc/lib/settings, the default linker is set to gold:
>
>         "C compiler link flags", "-fuse-ld=gold"
>
> Since gold is broken on powerpc and shouldn't really be used anymore since
> it's basically unmaintained upstream, we must use bfd on powerpc by default.
>
> Editing the file and switching back to bfd fixes the problem for me.
>
> Now we just need to figure out how to actually set the default linker back
> to bfd as it was actually explicitly supposed to happen according to
> debian/rules.
>
> This will most likely also unbreak GHC on m68k.

Good job, Adrian. That's quite a bit of work to track down the issue.

Jeff

[toc] | [prev] | [next] | [standalone]


#1200756

FromJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date2024-06-13 10:20 +0200
Message-ID<IONGV-2B7V-3@gated-at.bofh.it>
In reply to#1200752
Hi Jeff,

On Thu, 2024-06-13 at 03:50 -0400, Jeffrey Walton wrote:
> > Now we just need to figure out how to actually set the default linker back
> > to bfd as it was actually explicitly supposed to happen according to
> > debian/rules.
> > 
> > This will most likely also unbreak GHC on m68k.
> 
> Good job, Adrian. That's quite a bit of work to track down the issue.

Thanks. In the meantime I filed a bug upstream for this [1].

I will actually open a second bug report since this bug report is about
the broken NGC on 32-bit PowerPC which is a different issue.

Adrian

> [1] https://gitlab.haskell.org/ghc/ghc/-/issues/24986

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

[toc] | [prev] | [next] | [standalone]


#1200812

FromIlias Tsitsimpis <iliastsi@debian.org>
Date2024-06-13 20:40 +0200
Message-ID<IOXwB-2Ihx-3@gated-at.bofh.it>
In reply to#1200756
Hey Adrian,

On Thu, Jun 13, 2024 at 10:09AM, John Paul Adrian Glaubitz wrote:
> Hi Jeff,
> 
> On Thu, 2024-06-13 at 03:50 -0400, Jeffrey Walton wrote:
> > > Now we just need to figure out how to actually set the default linker back
> > > to bfd as it was actually explicitly supposed to happen according to
> > > debian/rules.
> > > 
> > > This will most likely also unbreak GHC on m68k.

Great job!

I completely missed the fact this needs to be passes to the bindist's
configure script as well.

You need to edit debian/rules here
https://sources.debian.org/src/ghc/9.4.7-5/debian/rules/#L78
and add the following line as well:

+   EXTRA_INSTALL_CONFIGURE_FLAGS += --disable-ld-override

I will include that in the next upload. Do we still have to build an
unregisterised compiler for powerpc or can we switch back to NCG
(https://bugs.debian.org/1060196)?

-- 
Ilias

[toc] | [prev] | [next] | [standalone]


#1200814

FromJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date2024-06-13 21:00 +0200
Message-ID<IOXPX-2Ioi-3@gated-at.bofh.it>
In reply to#1200812
Hi Ilias,

On Thu, 2024-06-13 at 21:22 +0300, Ilias Tsitsimpis wrote:
> Great job!

Thanks!

> I completely missed the fact this needs to be passes to the bindist's
> configure script as well.

It took me forever to figure this out ;-).

> You need to edit debian/rules here
> https://sources.debian.org/src/ghc/9.4.7-5/debian/rules/#L78
> and add the following line as well:
> 
> +   EXTRA_INSTALL_CONFIGURE_FLAGS += --disable-ld-override

Yes, that's what I suggested, see my patch in [1].

> I will include that in the next upload.

Great, thank you. I uploaded a patched version to unreleased in the
mean time.

> Do we still have to build an unregisterised compiler for powerpc
> or can we switch back to NCG (https://bugs.debian.org/1060196)?

I have not verified that yet. Please let's stay unregisterised for now
and have me verify first whether the NGC has been fixed with 9.6.x or
newer.

Please let's keep this bug report open and use #1073159 [1] for adding
the flag --disable-ld-override to EXTRA_INSTALL_CONFIGURE_FLAGS.

Adrian

> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1073159

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

[toc] | [prev] | [next] | [standalone]


#1200858

FromJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date2024-06-14 10:40 +0200
Message-ID<IPaDv-2QAN-7@gated-at.bofh.it>
In reply to#1200814
Hi Ilias,

On Thu, 2024-06-13 at 20:50 +0200, John Paul Adrian Glaubitz wrote:
> > Do we still have to build an unregisterised compiler for powerpc
> > or can we switch back to NCG (https://bugs.debian.org/1060196)?
> 
> I have not verified that yet. Please let's stay unregisterised for now
> and have me verify first whether the NGC has been fixed with 9.6.x or
> newer.
> 
> Please let's keep this bug report open and use #1073159 [1] for adding
> the flag --disable-ld-override to EXTRA_INSTALL_CONFIGURE_FLAGS.

GHC 9.6.5 still fails on powerpc with the NGC enabled:

# rts/include/rts/prof/LDV.h
| Run Ghc CompileHs Stage1: rts/HeapStackCheck.cmm => _build/stage1/rts/build/cmm/HeapStackCheck.debug_o
| Run Ghc CompileHs Stage1: rts/PrimOps.cmm => _build/stage1/rts/build/cmm/PrimOps.p_o
| Run Ghc CompileHs Stage1: rts/Updates.cmm => _build/stage1/rts/build/cmm/Updates.thr_p_o
| Run Ghc CompileHs Stage1: rts/Compact.cmm => _build/stage1/rts/build/cmm/Compact.thr_p_o
| Run Ghc CompileHs Stage1: rts/Exception.cmm => _build/stage1/rts/build/cmm/Exception.o
| Run Ghc CompileHs Stage1: rts/PrimOps.cmm => _build/stage1/rts/build/cmm/PrimOps.debug_o
| Run Ghc CompileHs Stage1: rts/StgStartup.cmm => _build/stage1/rts/build/cmm/StgStartup.debug_p_o
| Run Ghc CompileHs Stage1: rts/HeapStackCheck.cmm => _build/stage1/rts/build/cmm/HeapStackCheck.p_o
| Run Ghc CompileHs Stage1: rts/StgStartup.cmm => _build/stage1/rts/build/cmm/StgStartup.thr_debug_p_o
| Run Ghc CompileHs Stage1: rts/StgMiscClosures.cmm => _build/stage1/rts/build/cmm/StgMiscClosures.debug_o
| Run Ghc CompileHs Stage1: rts/StgMiscClosures.cmm => _build/stage1/rts/build/cmm/StgMiscClosures.p_o
| Run Ghc CompileHs Stage1: rts/ContinuationOps.cmm => _build/stage1/rts/build/cmm/ContinuationOps.debug_p_o
| Run Ghc CompileHs Stage1: rts/Updates.cmm => _build/stage1/rts/build/cmm/Updates.debug_p_o
| Run Ghc CompileHs Stage1: rts/StgStartup.cmm => _build/stage1/rts/build/cmm/StgStartup.thr_p_o
| Run Ghc CompileHs Stage1: rts/Apply.cmm => _build/stage1/rts/build/cmm/Apply.o
| Run Ghc CompileHs Stage1: rts/Exception.cmm => _build/stage1/rts/build/cmm/Exception.debug_o
| Run Ghc CompileHs Stage1: rts/Apply.cmm => _build/stage1/rts/build/cmm/Apply.thr_dyn_o
Command line: _build/stage0/bin/ghc -Wall -Wcompat -hisuf debug_p_hi -osuf debug_p_o -hcsuf debug_p_hc -static -prof -DDEBUG -optc-DDEBUG -hide-all-packages -no-user-package-db '-package-env -' '-
package-db _build/stage1/inplace/package.conf.d' '-this-unit-id rts-1.0.2' -i -i/home/glaubitz/ghc-deb-9.6.5-new/ghc-9.6.5/_build/stage1/rts/build -i/home/glaubitz/ghc-deb-9.6.5-new/ghc-
9.6.5/_build/stage1/rts/build/autogen -i/home/glaubitz/ghc-deb-9.6.5-new/ghc-9.6.5/rts -Irts/include -I_build/stage1/rts/build -I_build/stage1/rts/build/include
-I_build/stage1/rts/build/@FFIIncludeDir@ -I_build/stage1/rts/build/@LibdwIncludeDir@ -Irts/include -Irts/@FFIIncludeDir@ -Irts/@LibdwIncludeDir@ -optP-include -
optP_build/stage1/rts/build/autogen/cabal_macros.h -ghcversion-file=rts/include/ghcversion.h -outputdir _build/stage1/rts/build -fdiagnostics-color=always -Wnoncanonical-monad-instances -optc-Wno-
error=inline -optP-Wno-nonportable-include-path -c rts/ContinuationOps.cmm -o _build/stage1/rts/build/cmm/ContinuationOps.debug_p_o -O2 -H32m -this-unit-id rts -XHaskell98 -no-global-package-db -
package-db=/home/glaubitz/ghc-deb-9.6.5-new/ghc-9.6.5/_build/stage1/inplace/package.conf.d -ghcversion-file=rts/include/ghcversion.h -ghcversion-file=rts/include/ghcversion.h -haddock -Irts -
I_build/stage1/rts/build '-DRtsWay="rts_debug_p"' -DFS_NAMESPACE=rts -DCOMPILING_RTS -DPROFILING -Wno-deprecated-flags -Wcpp-undef
===> Command failed with error code: 1
ghc: panic! (the 'impossible' happened)
  GHC version 9.6.5:
        PPC.Ppr.pprInstr: JMP to ForeignLabel
  CallStack (from HasCallStack):
    panic, called at compiler/GHC/CmmToAsm/PPC/Ppr.hs:591:30 in ghc:GHC.CmmToAsm.PPC.Ppr


Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

Error when running Shake build system:
  at want, called at src/Main.hs:124:44 in main:Main
* Depends on: binary-dist-dir
  at need, called at src/Rules/BinaryDist.hs:130:9 in main:Rules.BinaryDist
* Depends on: _build/stage1/lib/package.conf.d/rts-1.0.2.conf
  at need, called at src/Rules/Register.hs:134:5 in main:Rules.Register
* Depends on: _build/stage1/rts/build/stamp-rts-1.0.2_debug_p
  at need, called at src/Rules/Library.hs:144:3 in main:Rules.Library
* Depends on: _build/stage1/rts/build/libHSrts-1.0.2_debug_p.a
  at need, called at src/Rules/Library.hs:220:5 in main:Rules.Library
* Depends on: _build/stage1/rts/build/cmm/ContinuationOps.debug_p_o
  at cmd', called at src/Builder.hs:387:23 in main:Builder
  at cmdArgs, called at src/Builder.hs:540:8 in main:Builder
  at cmdArgs, called at src/Builder.hs:564:18 in main:Builder
  at cmdArgs, called at src/Builder.hs:564:18 in main:Builder
  at error, called at src/Builder.hs:609:13 in main:Builder
* Raised the exception:
Command failed

Build failed.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.bugs.dist


csiph-web