diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-01-09 15:06:07 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-02-23 14:04:31 +0100 |
commit | 7192f01212357201e264105c57708d6c8109dc38 (patch) | |
tree | 08b677ef7dadb26010160acfaf539d732008f845 /external/python3 | |
parent | python3: fix 32-bit x86 build (diff) | |
download | core-7192f01212357201e264105c57708d6c8109dc38.tar.gz core-7192f01212357201e264105c57708d6c8109dc38.zip |
python3: bundle libffi for GNU/Linux builds
CPython commit f40d4ddff3c800b3c956a5e8820aabe3aa87cddd "Closes #27979:
Remove bundled copy of libffi" causes a bit of a problem because it
turns out that libffi isn't all that stable; there's libffi.so.5 on
CentOS 6, libffi.so.6 on CentOS 7 and libffi.so.7 on
lo_daily_update_gandalf tinderbox.
So we have to bundle it in LO; it's only used on GNU/Linux currently.
CPython commit 32119e10b792ad7ee4e5f951a2d89ddbaf111cc5 "bpo-35947:
Update Windows to the current version of libffi (GH-11797)" also removes
the libffi for MSVC, so in a future python upgrade we will have to build
libffi for MSVC too.
The libffi fork for MacOSX is still in CPython git master.
(regression from b10be5d48433076f0b7238d818020f708553e114)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86493
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
(cherry picked from commit 79084665f0e351a3f83fdee88071919f05ec9cc3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86500
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 6b5ce621ff2a82d4fa77d7781d1dabd4b14a4c90)
Change-Id: Ibc20cf8cd3614cf9941b6970662bd930496776b2
Diffstat (limited to 'external/python3')
-rw-r--r-- | external/python3/ExternalProject_python3.mk | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/external/python3/ExternalProject_python3.mk b/external/python3/ExternalProject_python3.mk index f8596eb57601..075cc6f50d78 100644 --- a/external/python3/ExternalProject_python3.mk +++ b/external/python3/ExternalProject_python3.mk @@ -11,6 +11,7 @@ $(eval $(call gb_ExternalProject_ExternalProject,python3)) $(eval $(call gb_ExternalProject_use_externals,python3,\ expat \ + $(if $(filter LINUX,$(OS)),libffi) \ openssl \ zlib \ )) @@ -51,8 +52,12 @@ else # OPENSSL_INCLUDES OPENSSL_LDFLAGS OPENSSL_LIBS cannot be set via commandline! # use --with-openssl instead, which requires include/ and lib/ subdirs. -# TODO: libffi has different SONAME on CentOS 6 vs. 7, so we better use -# --without-system-ffi. However, that doesn't actually do anything on Linux :( +# libffi is not all that stable, with 3 different SONAMEs currently, so we +# have to bundle it; --without-system-ffi does not work any more on Linux. +# Unfortuantely (as of 3.7) pkg-config is used to locate libffi so we do some +# hacks to find the libffi.pc in workdir by overriding PKG_CONFIG_LIBDIR. +# Also, pkg-config is only used to find the headers, the libdir needs to be +# passed extra. # create a symlink "LO_lib" because the .so are in a directory with platform # specific name like build/lib.linux-x86_64-3.3 @@ -90,6 +95,9 @@ $(call gb_ExternalProject_get_state_target,python3,build) : $(if $(SYSTEM_OPENSSL)$(DISABLE_OPENSSL),,\ --with-openssl=$(call gb_UnpackedTarball_get_dir,openssl) \ ) \ + $(if $(filter LINUX,$(OS)), \ + PKG_CONFIG_LIBDIR="$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)$${PKG_CONFIG_LIBDIR:+:$$PKG_CONFIG_LIBDIR}" \ + ) \ CC="$(strip $(CC) \ $(if $(SYSTEM_EXPAT),,-I$(call gb_UnpackedTarball_get_dir,expat)/lib) \ $(if $(SYSBASE), -I$(SYSBASE)/usr/include) \ @@ -97,6 +105,7 @@ $(call gb_ExternalProject_get_state_target,python3,build) : $(if $(python3_cflags),CFLAGS='$(python3_cflags)') \ $(if $(filter -fsanitize=%,$(CC)),LINKCC="$(CXX) -pthread") \ LDFLAGS="$(strip $(LDFLAGS) \ + $(if $(filter LINUX,$(OS)),-L$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)/.libs) \ $(if $(SYSTEM_EXPAT),,-L$(gb_StaticLibrary_WORKDIR)) \ $(if $(SYSTEM_ZLIB),,-L$(gb_StaticLibrary_WORKDIR)) \ $(if $(SYSBASE), -L$(SYSBASE)/usr/lib) \ |