#2997: Package names starting with a numeric character cause assembler errors
-----------------------------+----------------------------------------------
Reporter:  mboes             |          Owner:                  
    Type:  bug               |         Status:  new             
Priority:  normal            |      Component:  Compiler        
 Version:  6.10.1            |       Severity:  normal          
Keywords:                    |       Testcase:                  
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
-----------------------------+----------------------------------------------
 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:
  1. 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.
  2. 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

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2997>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to