Skip to content
Snippets Groups Projects
Commit 7bec8b65 authored by Ben Gamari's avatar Ben Gamari
Browse files

rts: Don't declare libCffi as bundled when using system libffi

Previously the rts's cabal file would claim that it bundled libffi, even
if we are using the system's libffi. Fixes #19869.

(cherry picked from commit 63184a71)
parent 4ebe312f
No related branches found
Tags ghc-8.8.2-rc1
No related merge requests found
......@@ -1081,10 +1081,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],
......
......@@ -245,6 +245,7 @@ rtsPackageArgs = package rts ? do
way <- getWay
path <- getBuildPath
top <- expr topDirectory
useSystemFfi <- expr $ flag UseSystemFfi
libffiName <- expr libffiLibraryName
ffiIncludeDir <- getSetting FfiIncludeDir
ffiLibraryDir <- getSetting FfiLibDir
......@@ -360,6 +361,7 @@ rtsPackageArgs = package rts ? do
, any (wayUnit Debug) rtsWays `cabalFlag` "debug"
, any (wayUnit Logging) rtsWays `cabalFlag` "logging"
, any (wayUnit Dynamic) rtsWays `cabalFlag` "dynamic"
, useSystemFfi `cabalFlag` "use-system-libffi"
, useLibffiForAdjustors `cabalFlag` "libffi-adjustors"
, Debug `wayUnit` way `cabalFlag` "find-ptr"
]
......
......@@ -12,6 +12,8 @@ flag libdl
default: @CabalHaveLibdl@
flag ffi
default: @CabalHaveLibffi@
flag use-system-libffi
default: @CabalUseSystemLibFFI@
flag libffi-adjustors
default: @CabalLibffiAdjustors@
flag need-pthread
......@@ -57,10 +59,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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment