Commit 4e3562c0 authored by Sergei Trofimovich's avatar Sergei Trofimovich

UNREG: don't prefix asm prefixes in via-C mode

commit 64c54fff
("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: default avatarSergei Trofimovich <slyfox@gentoo.org>

Reviewers: simonmar, last_g, bgamari

Reviewed By: simonmar

Subscribers: rwbarton, carter

Differential Revision: https://phabricator.haskell.org/D5207
parent 8be27c03
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment