Opened 4 years ago

Closed 3 years ago

#8877 closed bug (fixed)

"if this code is reached, the program will abort" in unregisterised build

Reported by: nomeata Owned by:
Priority: normal Milestone: 7.10.1
Component: Compiler Version: 7.8.1-rc2
Keywords: Cc: ptrommler@…, slyfox
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Runtime crash Test Case:
Blocked By: Blocking:
Related Tickets: #8857 Differential Rev(s):
Wiki Page:



sparc, when built with dynamic libraries, fails with a segmentation fault:

Possible cause indicated by

"inplace/bin/ghc-stage1" -static  -H32m -O -lffi -optl-pthread -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -package-name rts -optc-DNOSMP -dcmm-lint      -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen           -O2    -c rts/Apply.cmm -o rts/dist/build/Apply.o
/tmp/ghc14927_0/ghc14927_2.hc: In function 'stg_PAP_entry':

     warning: function called through a non-compatible type [enabled by default]

     note: if this code is reached, the program will abort

It works without shared libraries (see #8857)

Change History (2)

comment:1 Changed 4 years ago by trommler

Architecture: sparcUnknown/Multiple
Cc: ptrommler@… added
Summary: "if this code is reached, the program will abort" in sparc"if this code is reached, the program will abort" in unregisterised build

I see the same on powerpc64 with dynamic libraries enabled:

Changing architecture accordingly.

comment:2 Changed 3 years ago by thomie

Cc: slyfox added
Milestone: 7.10.1
Resolution: fixed
Status: newclosed

This should be fixed, thanks to the following commits:

In commit 78863edbb0751f5c9694ea10c6132a87cfd0ee10:

Author: Sergei Trofimovich <>
Date:   Wed Aug 27 22:20:33 2014 +0300

    Revert "disable shared libs on sparc (linux/solaris) (fixes #8857)"
    This reverts commit 623883f1ed0ee11cc925c4590fb09565403fd231.
    The commit a93ab43ab5f40cadbedea2f6342b93c245e91434
        driver: pass '-fPIC' option to assembler as well
    fixes shared libraries on sparc at least on linux.
    Properly fixes Issue #8857
    Signed-off-by: Sergei Trofimovich <>

In commit fa31e8f4a0f853848d96549a429083941877bf8d:

Author: Sergei Trofimovich <>
Date:   Sun Dec 14 14:30:12 2014 +0000

    powerpc: fix and enable shared libraries by default on linux
    And fix things all the way down to it. Namely:
        - remove 'r30' from free registers, it's an .LCTOC1 register
          for gcc. generated .plt stubs expect it to be initialised.
        - fix PicBase computation, which originally forgot to use 'tmp'
          reg in 'initializePicBase_ppc.fetchPC'
        - mark 'ForeighTarget's as implicitly using 'PicBase' register
          (see comment for details)
        - add 64-bit MO_Sub and test on alloclimit3/4 regtests
        - fix dynamic label offsets to match with .LCTOC1 offset
    Signed-off-by: Sergei Trofimovich <>
    Test Plan: validate passes equal amount of vanilla/dyn tests
    Reviewers: simonmar, erikd, austin
    Reviewed By: erikd, austin
    Subscribers: carter, thomie
    Differential Revision:
    GHC Trac Issues: #8024, #9831
Note: See TracTickets for help on using tickets.