[commit: ghc] ghc-8.2: Fix label type for __stginit_* labels: those are .data labels, not .text (119ca4c)

git at git.haskell.org git at git.haskell.org
Sat Jul 22 21:21:06 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/119ca4c97f7e7ab952420645d3f907008b8468ec/ghc

>---------------------------------------------------------------

commit 119ca4c97f7e7ab952420645d3f907008b8468ec
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date:   Sat Jul 22 10:49:12 2017 +0100

    Fix label type for __stginit_* labels: those are .data labels, not .text
    
    Noticed when was building --enable-unregisterised build for x86_64:
    
    ```
      /tmp/ghc22931_0/ghc_3.hc:5:9: error:
           error: '__stginit_ghczmprim_GHCziTypes' redeclared as different kind of symbol
           StgWord __stginit_ghczmprim_GHCziTypes[]__attribute__((aligned(8)))= {
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        |
      5 | StgWord __stginit_ghczmprim_GHCziTypes[]__attribute__((aligned(8)))= {
        |         ^
    
      In file included from /tmp/ghc22931_0/ghc_3.hc:3:0: error:
    
      /tmp/ghc22931_0/ghc_3.hc:4:5: error:
           note: previous declaration of '__stginit_ghczmprim_GHCziTypes' was here
           EF_(__stginit_ghczmprim_GHCziTypes);
               ^
    ```
    
    The error here is mismatch in symbol type: EF_ ("external function")
    It should be EC_ ("external closure").
    
    The same build failure does not happen in HEAD because the __stginit_*
    is not generated there anymore (see a92ff5d66182d992d02dfaad4c446ad074582368)
    
    Fixes #14009
    
    Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>


>---------------------------------------------------------------

119ca4c97f7e7ab952420645d3f907008b8468ec
 compiler/cmm/CLabel.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
index 5f13bed..89b5e9a 100644
--- a/compiler/cmm/CLabel.hs
+++ b/compiler/cmm/CLabel.hs
@@ -930,7 +930,7 @@ labelType (RtsLabel (RtsApInfoTable _ _))       = DataLabel
 labelType (RtsLabel (RtsApFast _))              = CodeLabel
 labelType (CaseLabel _ CaseReturnInfo)          = DataLabel
 labelType (CaseLabel _ _)                       = CodeLabel
-labelType (PlainModuleInitLabel _)              = CodeLabel
+labelType (PlainModuleInitLabel _)              = DataLabel
 labelType (SRTLabel _)                          = DataLabel
 labelType (LargeSRTLabel _)                     = DataLabel
 labelType (LargeBitmapLabel _)                  = DataLabel



More information about the ghc-commits mailing list