ghc does not want to link statically

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ghc does not want to link statically

Joel Reymont
Folks,

I'm trying to compile the Haskell Objective-C Binding (HOC) and it  
needs /usr/lib/libSystemStubs.a to find the missing _fprintf$LDBLStub  
symbol.

I tried the following in the make file

FOUNDATION_LIBS=-static -lSystemStubs -l dynamic -framework Foundation

but ghc still tries to link libSystemStubs.a dynamically. How do I  
fix this?

ghc --make HOC.hs       \
         -odir build/objects -hidir build/imports        \
         -fglasgow-exts -package-name HOC \
         ../HOC_cbits/HOC_cbits.o        \
         -I../HOC_cbits  \
         -I../libffi-src/build/include   \
          \
         -static -lSystemStubs -dynamic -framework Foundation      \
...
Loading package base-1.0 ... linking ... done.
Loading object (static) ../HOC_cbits/HOC_cbits.o ... done
Loading object (dynamic) SystemStubs ... failed.
Dynamic linker error message was:
    dlopen(libSystemStubs.dylib, 10): image not found
Whilst trying to load:  (dynamic) SystemStubs
Directories to search are:
    /opt/local/lib
ghc-6.4.2: user specified .o/.so/.DLL could not be loaded.
make[1]: *** [ghcmake.build-stamp] Error 1

        Thanks, Joel

--
http://wagerlabs.com/





_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: ghc does not want to link statically

Joel Reymont
Please disregard the question. There's an opportunity to statically  
link the library at an earlier build step. There seems to be no way  
to link in static libraries when using ghc --make as the dynamic  
linker (ghci) is being used.

On Jul 1, 2006, at 3:08 PM, Joel Reymont wrote:

> Folks,
>
> I'm trying to compile the Haskell Objective-C Binding (HOC) and it  
> needs /usr/lib/libSystemStubs.a to find the missing _fprintf
> $LDBLStub symbol.
>
> I tried the following in the make file
>
> FOUNDATION_LIBS=-static -lSystemStubs -l dynamic -framework Foundation
>
> but ghc still tries to link libSystemStubs.a dynamically. How do I  
> fix this?

--
http://wagerlabs.com/





_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe