[Haskell-cafe] Start GHCI with a static library

Christopher Allen cma at bitemyapp.com
Wed May 13 00:30:11 UTC 2015


You need a GHC built for this, I think.

Using this setup:

https://ghc.haskell.org/trac/ghc/ticket/5371


[callen at atlantis ~/Work/exist]$ ghci -L. -lfoo testlink.hs
GHCi, version 7.10.1: http://www.haskell.org/ghc/  :? for help
ghc: panic! (the 'impossible' happened)
  (GHC version 7.10.1 for x86_64-unknown-linux):
Loading archives not supported


[callen at atlantis ~/Work/exist]$ /opt/ghc/7.6.3/bin/ghci -L. -lfoo
testlink.hs
GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading object (static archive) ./libfoo.a ... done
final link ... done
[1 of 1] Compiling TestLink         ( testlink.hs, interpreted )
Ok, modules loaded: TestLink.
Prelude>
Leaving GHCi.


[callen at atlantis ~/Work/exist]$ /opt/ghc/7.8.4/bin/ghci -L. -lfoo
testlink.hs
GHCi, version 7.8.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading object (static archive) ./libfoo.a ... ghc: panic! (the
'impossible' happened)
  (GHC version 7.8.4 for x86_64-unknown-linux):
Loading archives not supported

(ditto 7.8.3)

https://github.com/ghc/ghc/blob/master/compiler/ghci/Linker.hs#L444-L450

https://mail.haskell.org/pipermail/glasgow-haskell-users/2014-October/thread.html#25338

Respective versions of GHC are all from hvr's Ubuntu PPA.

These are the versions I have installed:

ghc-7.10.1 install
ghc-7.6.3 install
ghc-7.8.3 install
ghc-7.8.4 install


Afraid I don't know much about linkers or GHC dev so that's I all I can do
for you at this time.

Cheers,
Chris



On Tue, May 12, 2015 at 7:05 PM, aditya siram <aditya.siram at gmail.com>
wrote:

> Any ideas?
> -deech
>
> On Sat, May 2, 2015 at 10:24 AM, aditya siram <aditya.siram at gmail.com>
> wrote:
>
>> Hi all,
>> I have a Haskell library I'd like to load up in GHCI along with a
>> statically linked C library (libblah.a) . Is there any way to do this? My
>> Googling only turns up instructions on loading a shared library
>> (libblah.so).
>>
>> Thanks!
>> -deech
>>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150512/a18b207d/attachment.html>


More information about the Haskell-Cafe mailing list