Merge pull request #6067 from donn/force_static_ffi

wheels: force static libffi in build
This commit is contained in:
Miodrag Milanović 2026-07-27 13:11:49 +00:00 committed by GitHub
commit 2c28591b8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 7 deletions

View File

@ -93,14 +93,14 @@ jobs:
CIBW_BEFORE_ALL: bash ./.github/workflows/wheels/cibw_before_all.sh
CIBW_ENVIRONMENT: >
OPTFLAGS=-O3
PKG_CONFIG_PATH=./ffi/pfx/lib/pkgconfig
PATH="$PWD/bison/src:$PATH"
PKG_CONFIG_PATH={project}/ffi/pfx/lib/pkgconfig
PATH="{project}/bison/src:$PATH"
CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release"
CIBW_ENVIRONMENT_MACOS: >
OPTFLAGS=-O3
PKG_CONFIG_PATH=./ffi/pfx/lib/pkgconfig
PKG_CONFIG_PATH={project}/ffi/pfx/lib/pkgconfig
MACOSX_DEPLOYMENT_TARGET=11
PATH="$PWD/bison/src:$PATH"
PATH="{project}/bison/src:$PATH"
CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release"
CIBW_BEFORE_BUILD: bash ./.github/workflows/wheels/cibw_before_build.sh
CIBW_TEST_COMMAND: python3 {project}/tests/pyosys/run_tests.py

View File

@ -29,9 +29,7 @@ fi
set -e -x
cd ffi
## Ultimate libyosys.so will be shared, so we need fPIC for the static libraries
CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure --prefix=$PWD/pfx
LDFLAGS=-fPIC CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure --prefix=$PWD/pfx --enable-static --disable-shared
make clean
make install -j$(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu)
## Forces static library to be used in all situations
sed -i.bak 's@-L${toolexeclibdir} -lffi@${toolexeclibdir}/libffi.a@' ./pfx/lib/pkgconfig/libffi.pc
)