Package names starting with a numeric character cause assembler errors
Hi,
When trying to compile a package named 9pH, I get the following error:
/usr/bin/ghc -O -package-name 9pH-0.1 --make -XOverloadedStrings -XPatternGuards -XTemplateHaskell Network.GpH.Protocol.Derive
[1 of 1] Compiling Network.GpH.Protocol.Derive ( Network/GpH/Protocol/Derive.hs, Network/GpH/Protocol/Derive.o )
/tmp/ghc4263_0/ghc4263_0.s: Assembler messages:
/tmp/ghc4263_0/ghc4263_0.s:18137:0:
Error: junk at end of line, first unrecognized character is `9'
/tmp/ghc4263_0/ghc4263_0.s:18165:0:
Error: junk at end of line, first unrecognized character is `9'
/tmp/ghc4263_0/ghc4263_0.s:18166:0:
Error: unrecognized symbol type "9"
/tmp/ghc4263_0/ghc4263_0.s:18166:0:
Error: junk at end of line, first unrecognized character is `p'
/tmp/ghc4263_0/ghc4263_0.s:18167:0:
Error: junk at end of line, first unrecognized character is `9'
/tmp/ghc4263_0/ghc4263_0.s:18168:0:
Error: junk at end of line, first unrecognized character is `p'
/tmp/ghc4263_0/ghc4263_0.s:18172:0:
Error: junk at end of line, first unrecognized character is `p'
/tmp/ghc4263_0/ghc4263_0.s:18245:0:
Error: junk at end of line, first unrecognized character is `p'
...
It turns out that if I remove '-package-name 9pH-0.1' from the command line, or change the package name, then the compilation completes without error.
It seems that either:
- Package names starting with numeric characters should be banned. In which case it should be
clearly documented in the user's guide and/or in the cabal manual and the compiler should
check this early on in the compilation.
- Package names starting with a numeric character should be allowed. In which case package
names should be mangled appropriately to avoid having the assembler complain.
In my view option 2 would be preferable.
Many thanks,
Mathieu
Trac metadata
| Trac field | Value |
|---|---|
| Version | 6.10.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |