libffi.so not found on Mac OS X (10.5.8)
building with dynamic libraries on Mac OS X dies with an error about libffi.so
To reproduce:
add a build.mk with "GhcLibWays = v dyn"
sh boot && ./configure --enable-shared && make
If I copy one of the libffi*dylib files that does appear to have been built correctly to libffi.so, the build proceeds but then loops in the build process.
partial trace:
(cd .libs && rm -f libffi.5.dylib && cp -p libffi.5.0.9.dylib libffi.5.dylib)
(cd .libs && rm -f libffi.dylib && cp -p libffi.5.0.9.dylib libffi.dylib)
ar cru .libs/libffi.a src/debug.o src/prep_cif.o src/types.o src/raw_api.o src/java_raw_api.o src/closures.o src/x86/ffi.o src/x86/darwin.o src/x86/ffi64.o src/x86/darwin64.o
"inplace/bin/mkdirhier" inplace/lib/
"cp" -p utils/hsc2hs/dist/build/tmp/hsc2hs inplace/lib/hsc2hs
ranlib: file: .libs/libffi.a(ffi64.o) has no symbols
ranlib: file: .libs/libffi.a(darwin64.o) has no symbolstouch inplace/lib/hsc2hs
ranlib .libs/libffi.a
ranlib: file: .libs/libffi.a(ffi64.o) has no symbols
ranlib: file: .libs/libffi.a(darwin64.o) has no symbols
creating libffi.la
(cd .libs && rm -f libffi.la && cp -p ../libffi.la libffi.la)
/bin/sh ./libtool --tag=CC --mode=link gcc -Wall -g -fexceptions -w -w -o libffi_convenience.la src/debug.lo src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo src/x86/ffi.lo src/x86/darwin.lo src/x86/ffi64.lo src/x86/darwin64.lo
ar cru .libs/libffi_convenience.a src/.libs/debug.o src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi.o src/x86/.libs/darwin.o src/x86/.libs/ffi64.o src/x86/.libs/darwin64.o
ranlib: file: .libs/libffi_convenience.a(ffi64.o) has no symbols
ranlib: file: .libs/libffi_convenience.a(darwin64.o) has no symbols
ranlib .libs/libffi_convenience.a
ranlib: file: .libs/libffi_convenience.a(ffi64.o) has no symbols
ranlib: file: .libs/libffi_convenience.a(darwin64.o) has no symbols
creating libffi_convenience.la
(cd .libs && rm -f libffi_convenience.la && cp -p ../libffi_convenience.la libffi_convenience.la)
make[4]: Leaving directory `/Users/mwotton/projects/ghc/libffi/build'
make[3]: Leaving directory `/Users/mwotton/projects/ghc/libffi/build'
cp .libs/libffi.5.0.9.dylib /Users/mwotton/projects/ghc/libffi/libffi.5.0.9.dylib
(cd /Users/mwotton/projects/ghc/libffi && { cp -p -f libffi.5.0.9.dylib libffi.5.dylib || { rm -f libffi.5.dylib && cp -p libffi.5.0.9.dylib libffi.5.dylib; }; })
(cd /Users/mwotton/projects/ghc/libffi && { cp -p -f libffi.5.0.9.dylib libffi.dylib || { rm -f libffi.dylib && cp -p libffi.5.0.9.dylib libffi.dylib; }; })
cp .libs/libffi.lai /Users/mwotton/projects/ghc/libffi/libffi.la
cp .libs/libffi.a /Users/mwotton/projects/ghc/libffi/libffi.a
chmod 644 /Users/mwotton/projects/ghc/libffi/libffi.a
ranlib /Users/mwotton/projects/ghc/libffi/libffi.a
ranlib: file: /Users/mwotton/projects/ghc/libffi/libffi.a(ffi64.o) has no symbols
ranlib: file: /Users/mwotton/projects/ghc/libffi/libffi.a(darwin64.o) has no symbols
libtool: install: warning: remember to run `libtool --finish /usr/local/lib'
touch libffi/stamp.ffi.build-shared
"cp" libffi/libffi.a libffi/libHSffi.a
"cp" libffi/libffi.so libffi/libHSffi-ghc6.11.20090913.dylib
"cp" libffi/libffi.a libffi/libHSffi_p.a
cp: libffi/libffi.so: No such file or directory
make[1]: *** [libffi/libHSffi-ghc6.11.20090913.dylib] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2
nice make -j 2 145.90s user 70.38s system 78% cpu 4:37.08 total
Edited by Ian Lynagh <igloo@earth.li>