Ask Your Question
0

Statically compiling Haskell program fails: ld cannot find -lffi. What is the correct package that supplies static ffi?

asked 2015-01-09 05:49:34 -0600

Anieuwland gravatar image

I'm running Fedora 20 trying to statically compile a very minimal Haskell program. The command I'm using is

ghc -O2 --make -static -optc-static -optl-static Test.hs

It exits with this error however:

Linking Test ...
/usr/bin/ld: cannot find -lffi
/usr/lib64/ghc-7.6.3/libHSrts.a(Linker.o): In function `addDLL':
(.text+0x1a19): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: error: ld returned exit status 1

/usr/bin/ld: cannot find -lffi seems to me to be the failure inducing error (the other message is a warning). Si I want to install the static version of the foreign function interface library, but I can't find it. I can only find ming232-libffi-static and mingw64-libffi-static. Also, libffi, libffi-devel, ghc-libffi, and ghc-libffi-devel are all installed, but are not the static versions that I need.

So my question is: does a statically compiled libffi package exist, if so what is its name, if not does anyone have advice what else to do? Thank you for your time!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-01-09 07:50:10 -0600

cobra gravatar image

updated 2015-01-09 07:56:11 -0600

Is it this one:

libffi-devel

I found these other candidates too:

compat-libffi

mingw32-libffi

mingw64-libffi

I'm not really an expert on Haskell, but installing some or all of these might help.

edit flag offensive delete link more

Comments

Hi, thanks for helping! I tried those and the output doesn't change unfortunately, but thanks.

Anieuwland gravatar imageAnieuwland ( 2015-01-09 09:52:22 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-01-09 05:49:34 -0600

Seen: 540 times

Last updated: Jan 09 '15