Fixes Trac #16022.
- rGHC Glasgow Haskell Compiler
No Unit Test Coverage
- Build Status
Buildable 25419 Build 64488: [GHC] Linux/amd64: Continuous Integration Build 64487: [GHC] OSX/amd64: Continuous Integration Build 64486: [GHC] Windows/amd64: Continuous Integration Build 64485: arc lint + arc unit
Im confused: setting the ffi flag *enables* linking with ffi. So if I understand correctly, this can only serve to *increase* the cases where we link with ffi. I'm trying to find the relevant logic in the make build system now.
There seems to be some logic using -l$$(LIBFFI_NAME) in rts/ghc.mk. configure.ac also seems to set the default value of the ffi flag by doing AC_SUBST([CabalHaveLibffi],[False]) or AC_SUBST([CabalHaveLibffi],[True]).
Looking at the make build system, the UseLibFFIForAdjustors variable is only used to toggle cLibFFI in Config.hs files, and also in compiler/ghc.mk to set the USE_LIBFFI_FOR_ADJUSTORS flag when compiling the rts:
ifeq "$(UseLibFFIForAdjustors)" "YES" rts_CC_OPTS += -DUSE_LIBFFI_FOR_ADJUSTORS endif
The above logic isn't implemented in Hadrian, which seems like a separate issue. I can't find any logic in the make system that toggles linking with ffi.