aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-12-17 13:21:38 -0800
committerGuy Harris <gharris@sonic.net>2020-12-17 21:45:14 +0000
commit1949b6a5eed9e2725df68b77616a6f0523058bb3 (patch)
tree52a87f7eae6f473127e8e4af36bde44f08e1cfcc /tools
parent01e64f996bfbe71a6e7dc1f891aade1b15cac489 (diff)
macos-setup: don't configure p11-kit to use libffi.
See comment for an explanation.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/macos-setup.sh19
1 files changed, 16 insertions, 3 deletions
diff --git a/tools/macos-setup.sh b/tools/macos-setup.sh
index b7d0b83634..12cfc0abc0 100755
--- a/tools/macos-setup.sh
+++ b/tools/macos-setup.sh
@@ -1175,9 +1175,22 @@ install_p11_kit() {
$no_build && echo "Skipping installation" && return
xzcat p11-kit-$P11KIT_VERSION.tar.xz | tar xf - || exit 1
cd p11-kit-$P11KIT_VERSION
- # Same hack for libffi missing pkg-config files as GLib
- includedir=`xcrun --show-sdk-path 2>/dev/null`/usr/include
- LIBFFI_CFLAGS="-I $includedir/ffi" LIBFFI_LIBS="-lffi" CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure --without-trust-paths || exit 1
+ #
+ # Prior to Catalina, the libffi that's supplied with macOS
+ # doesn't support ffi_closure_alloc() or ffi_prep_closure_loc(),
+ # both of which are required by p11-kit if built with libffi.
+ #
+ # According to
+ #
+ # https://p11-glue.github.io/p11-glue/p11-kit/manual/devel-building.html
+ #
+ # libffi is used "for sharing of PKCS#11 modules between
+ # multiple callers in the same process. It is highly recommended
+ # that this dependency be treated as a required dependency.",
+ # but it's not clear that this matters to us, so we just
+ # configure p11-kit not to use libffi.
+ #
+ CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure --without-libffi --without-trust-paths || exit 1
make $MAKE_BUILD_OPTS || exit 1
$DO_MAKE_INSTALL || exit 1
cd ..