diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-07-21 09:22:06 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2021-07-23 13:27:16 -0400 |
commit | 6ad34396220edaebf06427369a051ab7bc4d43da (patch) | |
tree | b73c400d8ef3c7acf63c7f45a84544c0d41967fa | |
parent | 1709111472f966f6e571227b035e749f953535a2 (diff) | |
download | haskell-6ad34396220edaebf06427369a051ab7bc4d43da.tar.gz |
rts: Don't declare libCffi as bundled when using system libffiwip/libffi-bundling
Previously the rts's cabal file would claim that it bundled libffi, even
if we are using the system's libffi. Fixes #19869.
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | rts/rts.cabal.in | 14 |
2 files changed, 13 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 38de5953b6..649eccdb65 100644 --- a/configure.ac +++ b/configure.ac @@ -1083,10 +1083,12 @@ AC_ARG_WITH([system-libffi], ]) AS_IF([test "x$with_system_libffi" = "xyes"], - [UseSystemLibFFI="YES"], [UseSystemLibFFI="NO"] + [UseSystemLibFFI="YES"; CabalUseSystemLibFFI="True"], + [UseSystemLibFFI="NO"; CabalUseSystemLibFFI="True"] ) AC_SUBST(UseSystemLibFFI) +AC_SUBST(CabalUseSystemLibFFI) AC_ARG_WITH([ffi-includes], [AS_HELP_STRING([--with-ffi-includes=ARG], diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in index 22846ecc61..3943971592 100644 --- a/rts/rts.cabal.in +++ b/rts/rts.cabal.in @@ -12,6 +12,8 @@ flag libdl default: @CabalHaveLibdl@ flag ffi default: @CabalHaveLibffi@ +flag use-system-libffi + default: @CabalUseSystemLibFFI@ flag need-pthread default: @CabalNeedLibpthread@ flag libbfd @@ -55,10 +57,14 @@ library -- expects the unit-id to be -- set without version ghc-options: -this-unit-id rts - if os(windows) - extra-bundled-libraries: Cffi-6 - else - extra-bundled-libraries: Cffi + + -- If we are using an in-tree libffi then we must declare it as a bundled + -- library to ensure that Cabal installs it. + if !flag(use-system-libffi) + if os(windows) + extra-bundled-libraries: Cffi-6 + else + extra-bundled-libraries: Cffi -- The make build system does something special in config.mk.in -- for generating profiled, debugged, etc builds of those |