Hello,
I was compiling the Ports library with ghc-5.02.2 using the native code
generator (on Linux/i386), and the compiler declared itself buggy with
the following message:
--- command line:
/usr/bin/ghc -c Ports.hs -fasm -O -recomp -package concurrent -package lang -package
posix
--- message:
You've fallen across an unimplemented case in GHC's native code generation
machinery. You can work around this for the time being by compiling
this module via the C route, by giving the flag -fvia-C.
The panic below contains information, intended for the GHC implementors,
about the exact place where GHC gave up. Please send it to us
at [EMAIL PROTECTED], so as to encourage us to fix this.
ghc-5.02.2: panic! (the `impossible' happened, GHC version 5.02.2):
getRegister(x86,unary primop) (Prim makeStablePtrzh (Hp +I_ (-8)))
Please report it as a compiler bug to [EMAIL PROTECTED],
or http://sourceforge.net/projects/ghc/.
--- end of message
I was using the "-fasm" option in order to avoid a bug that happens when
using the C code generator with the "-O" option (I submitted a report
for this one on GHC's page on SourceForge). So I tried to compile the
library with "-fvia-C" and without "-O". Here compilation worked fine,
producing "libportsHS.a". As explained in the documentation, I turned
this into an object file loadable by GHCi with
ld -r --whole-archive libportsHS.a -o portsHS.o
When starting GHCi with this library, another "impossible" happened:
--- command line:
ghci -package-conf ports.conf -package ports
--- output:
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version 5.02.2, for Haskell 98.
/ /_\\/ __ / /___| | http://www.haskell.org/ghc/
\____/\/ /_/\____/|_| Type :? for help.
Loading package std ... linking ... done.
Loading package lang ... linking ... done.
Loading package posix ... linking ... done.
Loading package ports ... linking ... /usr/local/lib/ports-0.3.3/ghc5/portsHS.o:
unknown symbol `__stginit_Concurrent'
ghc-5.02.2: panic! (the `impossible' happened, GHC version 5.02.2):
can't load package `ports'
Please report it as a compiler bug to [EMAIL PROTECTED],
or http://sourceforge.net/projects/ghc/.
--- end of output
I made the "ports.conf" file myself, it simply declares the package
"ports" with appropriate paths and with hs_libraries=["portsHS"], with
no extra library or compiler options.
Here the crash is caused by a problem with symbol names, in that sense
it is similar to the other aforementioned bug (about using "-fvia-C" and
"-O"). This might actually be a problem with GCC (the version I use is
2.95.4, by the way). It did not try to find out about that (yet).
Regards,
--
Emmanuel Beffara
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs