[commit: ghc] master: UNREG: don't prefix asm prefixes in via-C mode (4e3562c)

git at git.haskell.org git at git.haskell.org
Sat Oct 6 18:46:42 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/4e3562c041695198519a075340ceaf40ceec402a/ghc

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

commit 4e3562c041695198519a075340ceaf40ceec402a
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date:   Sat Oct 6 19:45:18 2018 +0100

    UNREG: don't prefix asm prefixes in via-C mode
    
    commit 64c54fff2d6534e1229359a8d357ec1dc6c21b73
    ("Mark system and internal symbols as private symbols in asm")
    
    Added `internalNamePrefix` helper. Unfortunately it
    generates invalid label in unregisterised mode:
    
    ```
    $ ./configure --enable-unregisterised
    /tmp/ghc19372_0/ghc_4.hc:2831:22: error:
         error: expected identifier or '(' before '.' token
         static const StgWord .Lcl3_info[]__attribute__((aligned(8)))= {
                              ^
    ```
    
    Here asm-style prefix is applied to C symbol.
    The fix is simple: apply asm-style labels only to assembly code.
    
    Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
    
    Reviewers: simonmar, last_g, bgamari
    
    Reviewed By: simonmar
    
    Subscribers: rwbarton, carter
    
    Differential Revision: https://phabricator.haskell.org/D5207


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

4e3562c041695198519a075340ceaf40ceec402a
 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 12c3357..f07abeb 100644
--- a/compiler/cmm/CLabel.hs
+++ b/compiler/cmm/CLabel.hs
@@ -1339,7 +1339,7 @@ instance Outputable ForeignLabelSource where
 
 internalNamePrefix :: Name -> SDoc
 internalNamePrefix name = getPprStyle $ \ sty ->
-  if codeStyle sty && isRandomGenerated then
+  if asmStyle sty && isRandomGenerated then
     sdocWithPlatform $ \platform ->
       ptext (asmTempLabelPrefix platform)
   else



More information about the ghc-commits mailing list