ghci and ld scripts

Simon Peyton-Jones simonpj at microsoft.com
Fri May 21 14:20:11 EDT 2004


We've no idea what to do here.  In your case it'd be possible to just
ignore the script, but presumably not so in general.

If anyone who understands the problem properly would like to advise,
we'd be happy to hear from them. Parsing ld scripts seems beyond what
our linker is ever going to do!

Simon

| -----Original Message-----
| From: glasgow-haskell-users-bounces at haskell.org
[mailto:glasgow-haskell-users-
| bounces at haskell.org] On Behalf Of Duncan Coutts
| Sent: 16 May 2004 16:48
| To: GHC-users list
| Subject: ghci and ld scripts
| 
| So here's the problem:
| 
| We have a Haskell binding to a C library (one of the gtk extension
libs)
| which uses the pthread library. So we put "pthread" in the
| extra_libraries section of our ghc package conf file.
| 
| This works fine when building standalone programs, however when we try
| and use this package in ghci we get this error:
| 
| ...
| Loading package gtk2 ... linking ... done.
| Loading package sourceview ... ghc-6.2.1: can't load .so/.DLL for:
| pthread (/usr/lib/libpthread.so: invalid ELF header)
| 
| Inspecting /usr/lib/libpthread.so we find that indeed it is not a .so
| file but a gnu ld script:
| 
| /* GNU ld script
|    Use the shared library, but some functions are only in
|    the static library, so try that secondarily.  */
| OUTPUT_FORMAT(elf32-i386)
| GROUP ( /lib/libpthread.so.0 /usr/lib/libpthread_nonshared.a )
| 
| So we should get ghci to dynamically load /lib/libpthread.so.0,
however
| there is no way to specify this in the package.conf file.
| 
| It turns out that we don't need ghci to load this .so because it is a
| dep of another .so that we do load, however if I leave it out then
| building standalone progs would fail to link.
| 
| Has anyone come across this before? How do you deal with it?
| 
| Duncan
| 
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


More information about the Glasgow-haskell-users mailing list