diff options
Diffstat (limited to 'external')
67 files changed, 2413 insertions, 1970 deletions
diff --git a/external/Module_external.mk b/external/Module_external.mk index c1a5011d46a3..0459e3945fef 100644 --- a/external/Module_external.mk +++ b/external/Module_external.mk @@ -56,6 +56,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,LIBATOMIC_OPS,libatomic_ops) \ $(call gb_Helper_optional,LIBEOT,libeot) \ $(call gb_Helper_optional,LIBEXTTEXTCAT,libexttextcat) \ + $(call gb_Helper_optional,LIBFFI,libffi) \ $(call gb_Helper_optional,LIBGPGERROR,libgpg-error) \ $(call gb_Helper_optional,LIBLANGTAG,liblangtag) \ $(call gb_Helper_optional,LIBNUMBERTEXT,libnumbertext) \ diff --git a/external/curl/ExternalProject_curl.mk b/external/curl/ExternalProject_curl.mk index 2bf98e2b2e3e..5ef2cd66ac5d 100644 --- a/external/curl/ExternalProject_curl.mk +++ b/external/curl/ExternalProject_curl.mk @@ -43,7 +43,7 @@ $(call gb_ExternalProject_get_state_target,curl,build): $(if $(filter IOS MACOSX,$(OS)),\ --with-secure-transport,\ $(if $(ENABLE_NSS),--with-nss$(if $(SYSTEM_NSS),,="$(call gb_UnpackedTarball_get_dir,nss)/dist/out") --with-nss-deprecated,--without-nss)) \ - --without-ssl --without-gnutls --without-polarssl --without-cyassl --without-axtls --without-mbedtls \ + --without-openssl --without-gnutls --without-polarssl --without-cyassl --without-axtls --without-mbedtls \ --enable-ftp --enable-http --enable-ipv6 \ --without-libidn2 --without-libpsl --without-librtmp \ --without-libssh2 --without-metalink --without-nghttp2 \ diff --git a/external/curl/clang-cl.patch.0 b/external/curl/clang-cl.patch.0 index 2fbb10c2a9aa..5dfb19d5ba59 100644 --- a/external/curl/clang-cl.patch.0 +++ b/external/curl/clang-cl.patch.0 @@ -1,6 +1,6 @@ --- winbuild/MakefileBuild.vc +++ winbuild/MakefileBuild.vc -@@ -60,7 +60,7 @@ +@@ -52,7 +52,7 @@ !ELSE CC_NODEBUG = $(CC) /O2 /DNDEBUG CC_DEBUG = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd diff --git a/external/curl/curl-7.26.0_win-proxy.patch b/external/curl/curl-7.26.0_win-proxy.patch index c5498c3fdebb..f58736f2b46f 100644 --- a/external/curl/curl-7.26.0_win-proxy.patch +++ b/external/curl/curl-7.26.0_win-proxy.patch @@ -12,18 +12,18 @@ --- curl-7.26.0/lib/url.c +++ misc/build/curl-7.26.0/lib/url.c @@ -78,6 +78,10 @@ - bool curl_win32_idn_to_ascii(const char *in, char **out); + bool Curl_win32_idn_to_ascii(const char *in, char **out); #endif /* USE_LIBIDN2 */ +#ifdef _WIN32 +#include <WinHttp.h> +#endif + + #include "doh.h" #include "urldata.h" #include "netrc.h" - @@ -4586,6 +4590,21 @@ - } + #ifndef CURL_DISABLE_PROXY #ifndef CURL_DISABLE_HTTP +#ifdef _WIN32 @@ -72,7 +72,7 @@ + } + } + -+ if(!check_noproxy(conn->host.name, no_proxy)) { ++ if(!Curl_check_noproxy(conn->host.name, no_proxy)) { + /* Look for the http proxy setting */ + char *tok; + char *saveptr; diff --git a/external/curl/curl-msvc-disable-protocols.patch.1 b/external/curl/curl-msvc-disable-protocols.patch.1 index a6d06c69b004..89c4ff576f85 100644 --- a/external/curl/curl-msvc-disable-protocols.patch.1 +++ b/external/curl/curl-msvc-disable-protocols.patch.1 @@ -2,7 +2,7 @@ disable protocols nobody needs in MSVC build --- curl/lib/config-win32.h.orig 2017-08-09 16:43:29.464000000 +0200 +++ curl/lib/config-win32.h 2017-08-09 16:47:38.549200000 +0200 -@@ -733,4 +733,20 @@ +@@ -616,4 +616,20 @@ # define ENABLE_IPV6 1 #endif @@ -25,7 +25,7 @@ disable protocols nobody needs in MSVC build #endif /* HEADER_CURL_CONFIG_WIN32_H */ --- curl/winbuild/MakefileBuild.vc.orig 2017-10-23 23:41:21.393200000 +0200 +++ curl/winbuild/MakefileBuild.vc 2017-10-23 23:34:16.028000000 +0200 -@@ -431,7 +431,7 @@ +@@ -562,7 +562,7 @@ EXE_OBJS = $(CURL_OBJS) $(CURL_DIROBJ)\curl.res diff --git a/external/curl/curl-msvc.patch.1 b/external/curl/curl-msvc.patch.1 index a5b79a8e9c49..54ad026ec8c7 100644 --- a/external/curl/curl-msvc.patch.1 +++ b/external/curl/curl-msvc.patch.1 @@ -2,7 +2,7 @@ MSVC: using SOLARINC --- curl/winbuild/MakefileBuild.vc.orig 2017-10-23 16:36:07.713550851 +0200 +++ curl/winbuild/MakefileBuild.vc 2017-10-23 16:38:19.301547594 +0200 -@@ -60,7 +60,7 @@ +@@ -52,7 +52,7 @@ !ELSE CC_NODEBUG = $(CC) /O2 /DNDEBUG CC_DEBUG = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd @@ -11,7 +11,7 @@ MSVC: using SOLARINC !ENDIF LFLAGS = /nologo /machine:$(MACHINE) -@@ -300,11 +300,11 @@ +@@ -426,11 +426,11 @@ # CURL_XX macros are for the curl.exe command !IF "$(DEBUG)"=="yes" diff --git a/external/curl/curl-nss.patch.1 b/external/curl/curl-nss.patch.1 index d4dad7eba77e..5ef25748d7eb 100644 --- a/external/curl/curl-nss.patch.1 +++ b/external/curl/curl-nss.patch.1 @@ -1,12 +1,17 @@ diff -ur curl.org/configure curl/configure --- curl.org/configure 2016-03-13 15:14:07.177000076 +0100 +++ curl/configure 2016-03-13 15:16:44.132000076 +0100 -@@ -28216,7 +28216,7 @@ +@@ -27985,7 +27985,12 @@ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Using hard-wired libraries and compilation flags for NSS." >&5 printf "%s\n" "$as_me: WARNING: Using hard-wired libraries and compilation flags for NSS." >&2;} addld="-L$OPT_NSS/lib" - addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4" + addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lnssutil3" ++ case $host_os in ++ *android*) ++ addlib="${addlib} -llog" ++ ;; ++ esac addcflags="-I$OPT_NSS/include" version="unknown" nssprefix=$OPT_NSS diff --git a/external/curl/zlib.patch.0 b/external/curl/zlib.patch.0 index e0f579f8675a..b8e242a3aaea 100644 --- a/external/curl/zlib.patch.0 +++ b/external/curl/zlib.patch.0 @@ -1,6 +1,6 @@ --- configure +++ configure -@@ -22699,7 +22699,6 @@ +@@ -22808,7 +22808,6 @@ clean_CPPFLAGS=$CPPFLAGS clean_LDFLAGS=$LDFLAGS clean_LIBS=$LIBS @@ -8,7 +8,7 @@ # Check whether --with-zlib was given. if test ${with_zlib+y} -@@ -22709,6 +22708,7 @@ +@@ -22818,6 +22818,7 @@ if test "$OPT_ZLIB" = "no" ; then @@ -16,7 +16,7 @@ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: zlib disabled" >&5 printf "%s\n" "$as_me: WARNING: zlib disabled" >&2;} else -@@ -22716,6 +22716,21 @@ +@@ -22825,6 +825,21 @@ OPT_ZLIB="" fi @@ -38,7 +38,7 @@ if test -z "$OPT_ZLIB" ; then if test -n "$PKG_CONFIG"; then -@@ -23011,6 +23026,7 @@ +@@ -23120,6 +23120,7 @@ printf "%s\n" "$as_me: found both libz and libz.h header" >&6;} curl_zlib_msg="enabled" fi @@ -48,7 +48,7 @@ if test x"$AMFIXLIB" = x1; then --- configure.ac +++ configure.ac -@@ -880,19 +880,30 @@ +@@ -1222,19 +1222,30 @@ clean_CPPFLAGS=$CPPFLAGS clean_LDFLAGS=$LDFLAGS clean_LIBS=$LIBS @@ -80,7 +80,7 @@ if test -z "$OPT_ZLIB" ; then CURL_CHECK_PKGCONFIG(zlib) -@@ -975,6 +986,7 @@ +@@ -1316,6 +1316,7 @@ AC_MSG_NOTICE([found both libz and libz.h header]) curl_zlib_msg="enabled" fi diff --git a/external/expat/expat-winapi.patch b/external/expat/expat-winapi.patch index 7eae7d5d6139..fed65644a732 100644 --- a/external/expat/expat-winapi.patch +++ b/external/expat/expat-winapi.patch @@ -1,6 +1,6 @@ ---- misc/expat-2.1.0/lib/expat_external.h 2009-11-16 08:53:17.375000000 +0000 -+++ misc/build/expat-2.1.0/lib/expat_external.h 2009-11-16 08:53:34.703125000 +0000 -@@ -81,10 +81,6 @@ +--- misc/expat-2.5.0/lib/expat_external.h 2022-10-25 01:32:54.000000000 +0900 ++++ misc/build/expat-2.5.0/lib/expat_external.h 2022-10-30 23:09:47.339459134 +0900 +@@ -88,10 +88,6 @@ # ifndef XML_BUILDING_EXPAT /* using Expat from an application */ @@ -11,12 +11,13 @@ # endif #endif /* not defined XML_STATIC */ ---- misc/expat-2.1.0/lib/xmlparse.c 2021-05-23 16:56:25.000000000 +0100 -+++ misc/build/expat-2.1.0/lib/xmlparse.c 2021-05-25 12:42:11.997173600 +0100 -@@ -64,6 +64,8 @@ +--- misc/expat-2.5.0/lib/xmlparse.c 2022-10-26 00:09:08.000000000 +0900 ++++ misc/build/expat-2.5.0/lib/xmlparse.c 2022-10-30 23:09:01.843006341 +0900 +@@ -67,6 +67,9 @@ #endif #ifdef _WIN32 ++# undef HAVE_ARC4RANDOM_BUF +# undef HAVE_GETRANDOM +# undef HAVE_SYSCALL_GETRANDOM /* force stdlib to define rand_s() */ diff --git a/external/hsqldb/UnpackedTarball_hsqldb.mk b/external/hsqldb/UnpackedTarball_hsqldb.mk index cbba770f19a0..ed262cccf4ca 100644 --- a/external/hsqldb/UnpackedTarball_hsqldb.mk +++ b/external/hsqldb/UnpackedTarball_hsqldb.mk @@ -29,6 +29,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hsqldb,\ external/hsqldb/patches/jdbc-4.1.patch \ external/hsqldb/patches/multipleResultSets.patch \ ) \ + external/hsqldb/patches/disable-dump-script.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/hsqldb/patches/disable-dump-script.patch b/external/hsqldb/patches/disable-dump-script.patch new file mode 100644 index 000000000000..401dd38abc9a --- /dev/null +++ b/external/hsqldb/patches/disable-dump-script.patch @@ -0,0 +1,14 @@ +--- a/hsqldb/src/org/hsqldb/DatabaseCommandInterpreter.java 2023-02-13 11:08:11.297243034 +0000 ++++ b/hsqldb/src/org/hsqldb/DatabaseCommandInterpreter.java 2023-02-13 13:49:17.973089433 +0000 +@@ -403,6 +403,11 @@ + throw Trace.error(Trace.INVALID_IDENTIFIER); + } + ++ // added condition to avoid execution of spurious command in .script or .log file ++ if (session.isProcessingScript() || session.isProcessingLog()) { ++ return new Result(ResultConstants.UPDATECOUNT); ++ } ++ + dsw = new ScriptWriterText(database, token, true, true, true); + + dsw.writeAll(); diff --git a/external/libffi/ExternalPackage_libffi.mk b/external/libffi/ExternalPackage_libffi.mk new file mode 100644 index 000000000000..61b0a1ca460c --- /dev/null +++ b/external/libffi/ExternalPackage_libffi.mk @@ -0,0 +1,20 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,libffi,libffi)) + +$(eval $(call gb_ExternalPackage_use_external_project,libffi,libffi)) + +ifeq ($(COM),MSC) +$(eval $(call gb_ExternalPackage_add_files,libffi,$(LIBO_LIB_FOLDER)/python-core-$(PYTHON_VERSION)/lib, \ + $(HOST_PLATFORM)/.libs/libffi-7.dll \ +)) +endif + +# vim: set noet sw=4 ts=4: diff --git a/external/libffi/ExternalProject_libffi.mk b/external/libffi/ExternalProject_libffi.mk new file mode 100644 index 000000000000..0ff625ea3e20 --- /dev/null +++ b/external/libffi/ExternalProject_libffi.mk @@ -0,0 +1,50 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalProject_ExternalProject,libffi)) + +$(eval $(call gb_ExternalProject_register_targets,libffi,\ + build \ +)) + +# set prefix so that it ends up in libffi.pc so that pkg-config in python3 works +# For a static Windows build, change CPPFLAGS to include -D_LIB and --disable-static +# Also remove the ExternalPackage in that case + +libffi_WIN_PLATFORM := $(strip \ + $(if $(filter INTEL,$(CPUNAME)),32) \ + $(if $(filter X86_64,$(CPUNAME)),64) \ + $(if $(filter ARM64,$(CPUNAME)),arm64) \ + ) + +$(call gb_ExternalProject_get_state_target,libffi,build): + $(call gb_ExternalProject_run,build,\ + export LIB="$(ILIB)" && \ + ./configure \ + --enable-option-checking=fatal \ + --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ + $(if $(filter LINUX,$(OS)), \ + --disable-shared \ + CC="$(CC) -fvisibility=hidden" \ + --with-pic \ + --enable-portable-binary) \ + $(if $(filter WNT,$(OS)), \ + --disable-static \ + CC="$(call gb_UnpackedTarball_get_dir,libffi)/msvcc.sh -m$(libffi_WIN_PLATFORM)" \ + CXX="$(call gb_UnpackedTarball_get_dir,libffi)/msvcc.sh -m$(libffi_WIN_PLATFORM)" \ + LD='link' \ + CPP='cl -nologo -EP' \ + CXXCPP='cl -nologo -EP' \ + CPPFLAGS="-DFFI_BUILDING_DLL $(SOLARINC)") \ + --prefix=$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM) \ + --disable-docs \ + && $(MAKE) \ + ) + +# vim: set noet sw=4 ts=4: diff --git a/external/libffi/Makefile b/external/libffi/Makefile new file mode 100644 index 000000000000..e4968cf85fb6 --- /dev/null +++ b/external/libffi/Makefile @@ -0,0 +1,7 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/external/libffi/Module_libffi.mk b/external/libffi/Module_libffi.mk new file mode 100644 index 000000000000..ace75480abe3 --- /dev/null +++ b/external/libffi/Module_libffi.mk @@ -0,0 +1,18 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Module_Module,libffi)) + +$(eval $(call gb_Module_add_targets,libffi,\ + UnpackedTarball_libffi \ + ExternalProject_libffi \ + ExternalPackage_libffi \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/libffi/README b/external/libffi/README new file mode 100644 index 000000000000..cdf7fa937bc8 --- /dev/null +++ b/external/libffi/README @@ -0,0 +1,3 @@ +libffi is required to build CPython's ctypes module + +https://sourceware.org/libffi/ diff --git a/external/libffi/UnpackedTarball_libffi.mk b/external/libffi/UnpackedTarball_libffi.mk new file mode 100644 index 000000000000..5d0582329ac5 --- /dev/null +++ b/external/libffi/UnpackedTarball_libffi.mk @@ -0,0 +1,14 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,libffi)) + +$(eval $(call gb_UnpackedTarball_set_tarball,libffi,$(LIBFFI_TARBALL))) + +# vim: set noet sw=4 ts=4: diff --git a/external/libnumbertext/EmptyString.patch1 b/external/libnumbertext/EmptyString.patch1 new file mode 100644 index 000000000000..d6570117da09 --- /dev/null +++ b/external/libnumbertext/EmptyString.patch1 @@ -0,0 +1,13 @@ +--- a/src/Soros.cxx 2022-06-27 09:36:46.486075920 +0100 ++++ b/src/Soros.cxx 2022-06-27 09:37:52.594072196 +0100 +@@ -98,8 +98,8 @@ + s = regex_replace(s, quoteEnd, L""); + s = translate(s, c.substr(1), m.substr(1), L""); + replace(s, slash, L"\\\\"); // -> \\, ", ;, # +- begins.push_back(s[0] == L'^'); +- ends.push_back(s[s.length()-1] == L'$'); ++ begins.push_back(!s.empty() && s[0] == L'^'); ++ ends.push_back(!s.empty() && s[s.length()-1] == L'$'); + s = L"^" + regex_replace(s, wregex(L"^\\^"), L""); + s = regex_replace(s, wregex(L"\\$$"), L"") + L"$"; + try diff --git a/external/libnumbertext/UnpackedTarball_libnumbertext.mk b/external/libnumbertext/UnpackedTarball_libnumbertext.mk index ac2a14133205..00f43151326c 100644 --- a/external/libnumbertext/UnpackedTarball_libnumbertext.mk +++ b/external/libnumbertext/UnpackedTarball_libnumbertext.mk @@ -13,4 +13,10 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libnumbertext,$(LIBNUMBERTEXT_TARBA $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libnumbertext)) +$(eval $(call gb_UnpackedTarball_set_patchlevel,libnumbertext,1)) + +$(eval $(call gb_UnpackedTarball_add_patches,libnumbertext, \ + external/libnumbertext/EmptyString.patch1 \ +)) + # vim: set noet sw=4 ts=4: diff --git a/external/libxml2/ExternalPackage_libxml2.mk b/external/libxml2/ExternalPackage_libxml2.mk index d38eb68df0cb..6338fb20b9df 100644 --- a/external/libxml2/ExternalPackage_libxml2.mk +++ b/external/libxml2/ExternalPackage_libxml2.mk @@ -21,7 +21,7 @@ else # COM=MSC $(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.dll,win32/bin.msvc/libxml2.dll)) endif else # OS!=WNT -$(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.so.2,.libs/libxml2.so.2.9.$(LIBXML_VERSION_MICRO))) +$(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.so.2,.libs/libxml2.so.2.10.$(LIBXML_VERSION_MICRO))) endif endif # DISABLE_DYNLOADING diff --git a/external/libxml2/UnpackedTarball_libxml2.mk b/external/libxml2/UnpackedTarball_libxml2.mk index 00398f16af56..4ec3fa074dea 100644 --- a/external/libxml2/UnpackedTarball_libxml2.mk +++ b/external/libxml2/UnpackedTarball_libxml2.mk @@ -14,11 +14,12 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libxml2,$(LIBXML_TARBALL),,libxml2) $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libxml2)) $(eval $(call gb_UnpackedTarball_add_patches,libxml2,\ - external/libxml2/libxml2-config.patch.1 \ external/libxml2/libxml2-global-symbols.patch \ external/libxml2/libxml2-vc10.patch \ $(if $(filter ANDROID,$(OS)),external/libxml2/libxml2-android.patch) \ external/libxml2/libxml2-icu.patch.0 \ )) +$(eval $(call gb_UnpackedTarball_add_file,libxml2,xml2-config.in,external/libxml2/xml2-config.in)) + # vim: set noet sw=4 ts=4: diff --git a/external/libxml2/libxml2-android.patch b/external/libxml2/libxml2-android.patch index 42af83274026..acf9b17e02db 100644 --- a/external/libxml2/libxml2-android.patch +++ b/external/libxml2/libxml2-android.patch @@ -2,9 +2,9 @@ +++ misc/build/libxml2-2.7.6/Makefile.in @@ -1635,7 +1635,7 @@ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) - check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-recursive --all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(MANS) $(DATA) \ + $(MAKE) $(AM_MAKEFLAGS) check-local + check: check-recursive +-all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(DATA) \ +all-am: Makefile $(LTLIBRARIES) \ config.h install-binPROGRAMS: install-libLTLIBRARIES diff --git a/external/libxml2/libxml2-config.patch.1 b/external/libxml2/libxml2-config.patch.1 deleted file mode 100644 index 5a2ef1485e92..000000000000 --- a/external/libxml2/libxml2-config.patch.1 +++ /dev/null @@ -1,43 +0,0 @@ -Hack the xml2-config to return paths into WORKDIR. - ---- a/xml2-config.in 2009-12-17 11:45:20.000000000 +0000 -+++ b/xml2-config.in 2009-12-17 11:45:36.000000000 +0000 -@@ -1,9 +1,14 @@ - #! /bin/sh - --prefix=@prefix@ --exec_prefix=@exec_prefix@ --includedir=@includedir@ --libdir=@libdir@ -+#prefix=@prefix@ -+#exec_prefix=@exec_prefix@ -+#includedir=@includedir@ -+#libdir=@libdir@ -+ -+prefix=${WORKDIR}/UnpackedTarball/libxml2 -+exec_prefix=${WORKDIR}/UnpackedTarball/libxml2 -+includedir=${WORKDIR}/UnpackedTarball/libxml2/include -+libdir=${WORKDIR}/UnpackedTarball/libxml2/.libs - cflags= - libs= - -@@ -67,7 +72,8 @@ - ;; - - --cflags) -- cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@" -+ #cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@" -+ cflags="-I${includedir}" - ;; - - --libtool-libs) -@@ -91,7 +96,8 @@ - libs="@XML_LIBDIR@ $libs" - fi - -- libs="$libs @WIN32_EXTRA_LIBADD@" -+ #libs="$libs @WIN32_EXTRA_LIBADD@" -+ libs="-L${libdir} -lxml2 -lm" - ;; - - *) diff --git a/external/libxml2/xml2-config.in b/external/libxml2/xml2-config.in new file mode 100644 index 000000000000..164508e47e67 --- /dev/null +++ b/external/libxml2/xml2-config.in @@ -0,0 +1,28 @@ +#! /bin/sh + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case "$1" in + --version) + echo @VERSION@ + exit 0 + ;; + --cflags) + cflags="$LIBXML_CFLAGS" + ;; + --libs) + libs="$LIBXML_LIBS" + ;; + esac + shift +done + +if test -n "$cflags$libs"; then + echo $cflags $libs +fi + +exit 0 diff --git a/external/openssl/ExternalPackage_openssl.mk b/external/openssl/ExternalPackage_openssl.mk index 695c7b7119b6..d0c0dbaab975 100644 --- a/external/openssl/ExternalPackage_openssl.mk +++ b/external/openssl/ExternalPackage_openssl.mk @@ -13,9 +13,17 @@ $(eval $(call gb_ExternalPackage_use_external_project,openssl,openssl)) ifeq ($(COM),MSC) $(eval $(call gb_ExternalPackage_add_files,openssl,$(LIBO_LIB_FOLDER),\ - out32dll/ssleay32.dll \ - out32dll/libeay32.dll \ + libcrypto-1_1.dll \ + libssl-1_1.dll \ )) +ifneq ($(DISABLE_PYTHON),TRUE) +ifneq ($(SYSTEM_PYTHON),TRUE) +$(eval $(call gb_ExternalPackage_add_files,openssl,$(LIBO_LIB_FOLDER)/python-core-$(PYTHON_VERSION)/lib, \ + libcrypto-1_1.dll \ + libssl-1_1.dll \ +)) +endif +endif endif # vim: set noet sw=4 ts=4: diff --git a/external/openssl/ExternalProject_openssl.mk b/external/openssl/ExternalProject_openssl.mk index 211de4ab06fd..4bcd87b3ccd2 100644 --- a/external/openssl/ExternalProject_openssl.mk +++ b/external/openssl/ExternalProject_openssl.mk @@ -42,7 +42,9 @@ OPENSSL_PLATFORM := \ ios-armv7\ ,\ $(if $(filter WNT,$(OS)),\ - $(if $(filter INTEL,$(CPUNAME)),VC-WIN32,VC-WIN64A)\ + $(if $(filter INTEL,$(CPUNAME)),VC-WIN32)\ + $(if $(filter X86_64,$(CPUNAME)),VC-WIN64A)\ + $(if $(filter ARM64,$(CPUNAME)),VC-WIN64-ARM)\ ,\ $(if $(filter MACOSX,$(OS)),\ $(if $(filter POWERPC,$(CPUNAME)),darwin-ppc-cc)\ @@ -59,11 +61,9 @@ $(eval $(call gb_ExternalProject_use_nmake,openssl,build)) $(call gb_ExternalProject_get_state_target,openssl,build): $(call gb_ExternalProject_run,build,\ - export PERL="$(shell cygpath -w $(PERL))" \ - && $(PERL) Configure $(OPENSSL_PLATFORM) no-idea \ - && cmd /c "ms\do_ms.bat $(PERL) $(OPENSSL_PLATFORM)" \ - && nmake -f "ms\ntdll.mak" \ - && mv inc32/* include/ \ + CONFIGURE_INSIST=1 $(PERL) Configure $(OPENSSL_PLATFORM) no-tests no-multilib \ + && export PERL="$(shell cygpath -w $(PERL))" \ + && nmake -f makefile \ ) else @@ -75,15 +75,17 @@ $(call gb_ExternalProject_get_state_target,openssl,build): $(if $(filter WNT,$(OS)), \ $(PERL) Configure, \ ./config)) \ - $(OPENSSL_PLATFORM) no-dso no-shared \ - $(if $(filter-out WNT,$(OS)),no-idea) \ + $(OPENSSL_PLATFORM) no-dso no-shared no-tests no-multilib threads \ $(if $(filter-out ANDROID IOS WNT,$(OS)), \ $(if $(SYSBASE),-I$(SYSBASE)/usr/include -L$(SYSBASE)/usr/lib)) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ && $(MAKE) build_libs \ CC="$(CC) -fPIC \ + $(if $(filter TRUE, $(ENABLE_DBGUTIL)), -DPURIFY,) \ $(if $(filter-out WNT MACOSX,$(OS)),-fvisibility=hidden)" \ + && ln -s . lib \ ) +# symlink lib dir for python3 endif # vim: set noet sw=4 ts=4: diff --git a/external/openssl/UnpackedTarball_openssl.mk b/external/openssl/UnpackedTarball_openssl.mk index e7fca1116545..6f00cf7f7e44 100644 --- a/external/openssl/UnpackedTarball_openssl.mk +++ b/external/openssl/UnpackedTarball_openssl.mk @@ -12,17 +12,7 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,openssl)) $(eval $(call gb_UnpackedTarball_set_tarball,openssl,$(OPENSSL_TARBALL),,openssl)) $(eval $(call gb_UnpackedTarball_add_patches,openssl,\ - external/openssl/openssllnx.patch \ - external/openssl/opensslwnt.patch \ - $(if $(filter INTEL,$(CPUNAME)),external/openssl/opensslwnt_safeseh.patch) \ - external/openssl/openssl-1.0.1h-win64.patch.1 \ - external/openssl/opensslsol.patch \ - external/openssl/opensslios.patch \ - external/openssl/opensslosxppc.patch \ - external/openssl/openssl-3650-masm.patch.1 \ - external/openssl/openssl-fixbuild.patch.1 \ - external/openssl/openssl-1.0.2k-cve-2020-1971.patch.1 \ - external/openssl/ccb0a11145ee72b042d10593a64eaf9e8a55ec12.patch.1 \ + external/openssl/openssl-no-multilib.patch.0 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/openssl/ccb0a11145ee72b042d10593a64eaf9e8a55ec12.patch.1 b/external/openssl/ccb0a11145ee72b042d10593a64eaf9e8a55ec12.patch.1 deleted file mode 100644 index cf809750ecfb..000000000000 --- a/external/openssl/ccb0a11145ee72b042d10593a64eaf9e8a55ec12.patch.1 +++ /dev/null @@ -1,56 +0,0 @@ -From ccb0a11145ee72b042d10593a64eaf9e8a55ec12 Mon Sep 17 00:00:00 2001 -From: Matt Caswell <matt@openssl.org> -Date: Tue, 17 Aug 2021 14:41:48 +0100 -Subject: [PATCH] Fix a read buffer overrun in X509_CERT_AUX_print() - -This is a backport of commit c5dc9ab965f to 1.0.2. That commit fixed -the same bug but in master/1.1.1 it is in the function X509_aux_print(). -The original commit had the following description: - -Fix a read buffer overrun in X509_aux_print(). - -The ASN1_STRING_get0_data(3) manual explitely cautions the reader -that the data is not necessarily NUL-terminated, and the function -X509_alias_set1(3) does not sanitize the data passed into it in any -way either, so we must assume the return value from X509_alias_get0(3) -is merely a byte array and not necessarily a string in the sense -of the C language. - -I found this bug while writing manual pages for X509_print_ex(3) -and related functions. Theo Buehler <tb@openbsd.org> checked my -patch to fix the same bug in LibreSSL, see - -http://cvsweb.openbsd.org/src/lib/libcrypto/asn1/t_x509a.c#rev1.9 - -As an aside, note that the function still produces incomplete and -misleading results when the data contains a NUL byte in the middle -and that error handling is consistently absent throughout, even -though the function provides an "int" return value obviously intended -to be 1 for success and 0 for failure, and even though this function -is called by another function that also wants to return 1 for success -and 0 for failure and even does so in many of its code paths, though -not in others. But let's stay focussed. Many things would be nice -to have in the wide wild world, but a buffer overflow must not be -allowed to remain in our backyard. - -CVE-2021-3712 - -Reviewed-by: Paul Dale <pauli@openssl.org> ---- - crypto/asn1/t_x509a.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/crypto/asn1/t_x509a.c b/crypto/asn1/t_x509a.c -index d1b897a469fd..b1bc9d0cd28b 100644 ---- a/crypto/asn1/t_x509a.c -+++ b/crypto/asn1/t_x509a.c -@@ -104,7 +104,8 @@ int X509_CERT_AUX_print(BIO *out, X509_CERT_AUX *aux, int indent) - } else - BIO_printf(out, "%*sNo Rejected Uses.\n", indent, ""); - if (aux->alias) -- BIO_printf(out, "%*sAlias: %s\n", indent, "", aux->alias->data); -+ BIO_printf(out, "%*sAlias: %.*s\n", indent, "", aux->alias->length, -+ aux->alias->data); - if (aux->keyid) { - BIO_printf(out, "%*sKey Id: ", indent, ""); - for (i = 0; i < aux->keyid->length; i++) diff --git a/external/openssl/openssl-1.0.1h-win64.patch.1 b/external/openssl/openssl-1.0.1h-win64.patch.1 deleted file mode 100644 index aea914633ebb..000000000000 --- a/external/openssl/openssl-1.0.1h-win64.patch.1 +++ /dev/null @@ -1,47 +0,0 @@ -diff --git a/ms/do_win64a.bat b/ms/do_win64a.bat -index 8768dc6..6772390 100755 ---- a/ms/do_win64a.bat -+++ b/ms/do_win64a.bat -@@ -1,19 +1,19 @@ --perl util\mkfiles.pl >MINFO -+perl util/mkfiles.pl >MINFO - - cmd /c "nasm -f win64 -v" >NUL 2>&1 - if %errorlevel% neq 0 goto ml64 - --perl ms\uplink-x86_64.pl nasm > ms\uptable.asm --nasm -f win64 -o ms\uptable.obj ms\uptable.asm -+perl ms/uplink-x86_64.pl nasm > ms/uptable.asm -+nasm -f win64 -o ms/uptable.obj ms/uptable.asm - goto proceed - - :ml64 --perl ms\uplink-x86_64.pl masm > ms\uptable.asm --ml64 -c -Foms\uptable.obj ms\uptable.asm -+perl ms/uplink-x86_64.pl masm > ms/uptable.asm -+ml64 -c -Foms/uptable.obj ms/uptable.asm - - :proceed --perl util\mk1mf.pl VC-WIN64A >ms\nt.mak --perl util\mk1mf.pl dll VC-WIN64A >ms\ntdll.mak -+perl util/mk1mf.pl VC-WIN64A >ms/nt.mak -+perl util/mk1mf.pl dll VC-WIN64A >ms/ntdll.mak - --perl util\mkdef.pl 32 libeay > ms\libeay32.def --perl util\mkdef.pl 32 ssleay > ms\ssleay32.def -+perl util/mkdef.pl 32 libeay > ms/libeay32.def -+perl util/mkdef.pl 32 ssleay > ms/ssleay32.def -diff --git a/util/mk1mf.pl b/util/mk1mf.pl -index 72fa089..d98def1 100755 ---- a/util/mk1mf.pl -+++ b/util/mk1mf.pl -@@ -233,6 +233,9 @@ else - $cflags.=' -DTERMIO'; - } - -+# force unix style path separator -+${o} = "/"; -+ - $fipsdir =~ s/\//${o}/g; - - $out_dir=(defined($VARS{'OUT'}))?$VARS{'OUT'}:$out_def.($debug?".dbg":""); diff --git a/external/openssl/openssl-1.0.2k-cve-2020-1971.patch.1 b/external/openssl/openssl-1.0.2k-cve-2020-1971.patch.1 deleted file mode 100644 index 313f9cd870d7..000000000000 --- a/external/openssl/openssl-1.0.2k-cve-2020-1971.patch.1 +++ /dev/null @@ -1,578 +0,0 @@ -diff -up openssl-1.0.2k/crypto/asn1/asn1_err.c.null-dereference openssl-1.0.2k/crypto/asn1/asn1_err.c ---- openssl-1.0.2k/crypto/asn1/asn1_err.c.null-dereference 2020-12-04 10:08:08.506247597 +0100 -+++ openssl-1.0.2k/crypto/asn1/asn1_err.c 2020-12-04 10:12:31.901956486 +0100 -@@ -1,6 +1,6 @@ - /* crypto/asn1/asn1_err.c */ - /* ==================================================================== -- * Copyright (c) 1999-2018 The OpenSSL Project. All rights reserved. -+ * Copyright (c) 1999-2020 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions -@@ -103,6 +103,7 @@ static ERR_STRING_DATA ASN1_str_functs[] - {ERR_FUNC(ASN1_F_ASN1_ITEM_DUP), "ASN1_item_dup"}, - {ERR_FUNC(ASN1_F_ASN1_ITEM_EX_COMBINE_NEW), "ASN1_ITEM_EX_COMBINE_NEW"}, - {ERR_FUNC(ASN1_F_ASN1_ITEM_EX_D2I), "ASN1_ITEM_EX_D2I"}, -+ {ERR_PACK(ERR_LIB_ASN1, ASN1_F_ASN1_ITEM_EX_I2D, 0), "ASN1_item_ex_i2d"}, - {ERR_FUNC(ASN1_F_ASN1_ITEM_I2D_BIO), "ASN1_item_i2d_bio"}, - {ERR_FUNC(ASN1_F_ASN1_ITEM_I2D_FP), "ASN1_item_i2d_fp"}, - {ERR_FUNC(ASN1_F_ASN1_ITEM_PACK), "ASN1_item_pack"}, -@@ -202,6 +203,7 @@ static ERR_STRING_DATA ASN1_str_reasons[ - {ERR_REASON(ASN1_R_AUX_ERROR), "aux error"}, - {ERR_REASON(ASN1_R_BAD_CLASS), "bad class"}, - {ERR_REASON(ASN1_R_BAD_OBJECT_HEADER), "bad object header"}, -+ {ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_BAD_TEMPLATE), "bad template"}, - {ERR_REASON(ASN1_R_BAD_PASSWORD_READ), "bad password read"}, - {ERR_REASON(ASN1_R_BAD_TAG), "bad tag"}, - {ERR_REASON(ASN1_R_BMPSTRING_IS_WRONG_LENGTH), -diff -up openssl-1.0.2k/crypto/asn1/asn1.h.null-dereference openssl-1.0.2k/crypto/asn1/asn1.h ---- openssl-1.0.2k/crypto/asn1/asn1.h.null-dereference 2020-12-04 11:00:06.896637900 +0100 -+++ openssl-1.0.2k/crypto/asn1/asn1.h 2020-12-04 11:04:47.079562987 +0100 -@@ -1202,6 +1202,7 @@ void ERR_load_ASN1_strings(void); - # define ASN1_F_ASN1_ITEM_DUP 191 - # define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW 121 - # define ASN1_F_ASN1_ITEM_EX_D2I 120 -+# define ASN1_F_ASN1_ITEM_EX_I2D 231 - # define ASN1_F_ASN1_ITEM_I2D_BIO 192 - # define ASN1_F_ASN1_ITEM_I2D_FP 193 - # define ASN1_F_ASN1_ITEM_PACK 198 -@@ -1298,6 +1299,7 @@ void ERR_load_ASN1_strings(void); - # define ASN1_R_AUX_ERROR 100 - # define ASN1_R_BAD_CLASS 101 - # define ASN1_R_BAD_OBJECT_HEADER 102 -+# define ASN1_R_BAD_TEMPLATE 230 - # define ASN1_R_BAD_PASSWORD_READ 103 - # define ASN1_R_BAD_TAG 104 - # define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 214 -diff -up openssl-1.0.2k/crypto/asn1/tasn_dec.c.null-dereference openssl-1.0.2k/crypto/asn1/tasn_dec.c ---- openssl-1.0.2k/crypto/asn1/tasn_dec.c.null-dereference 2020-12-04 10:12:42.036057323 +0100 -+++ openssl-1.0.2k/crypto/asn1/tasn_dec.c 2020-12-04 10:17:45.685035333 +0100 -@@ -223,6 +223,15 @@ static int asn1_item_ex_d2i(ASN1_VALUE * - break; - - case ASN1_ITYPE_MSTRING: -+ /* -+ * It never makes sense for multi-strings to have implicit tagging, so -+ * if tag != -1, then this looks like an error in the template. -+ */ -+ if (tag != -1) { -+ ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_BAD_TEMPLATE); -+ goto err; -+ } -+ - p = *in; - /* Just read in tag and class */ - ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL, -@@ -240,6 +249,7 @@ static int asn1_item_ex_d2i(ASN1_VALUE * - ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_MSTRING_NOT_UNIVERSAL); - goto err; - } -+ - /* Check tag matches bit map */ - if (!(ASN1_tag2bit(otag) & it->utype)) { - /* If OPTIONAL, assume this is OK */ -@@ -316,6 +326,15 @@ static int asn1_item_ex_d2i(ASN1_VALUE * - goto err; - - case ASN1_ITYPE_CHOICE: -+ /* -+ * It never makes sense for CHOICE types to have implicit tagging, so -+ * if tag != -1, then this looks like an error in the template. -+ */ -+ if (tag != -1) { -+ ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_BAD_TEMPLATE); -+ goto err; -+ } -+ - if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL)) - goto auxerr; - if (*pval) { -diff -up openssl-1.0.2k/crypto/asn1/tasn_enc.c.null-dereference openssl-1.0.2k/crypto/asn1/tasn_enc.c ---- openssl-1.0.2k/crypto/asn1/tasn_enc.c.null-dereference 2020-12-04 10:18:30.261472002 +0100 -+++ openssl-1.0.2k/crypto/asn1/tasn_enc.c 2020-12-04 10:21:14.310078987 +0100 -@@ -151,9 +151,25 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, - break; - - case ASN1_ITYPE_MSTRING: -+ /* -+ * It never makes sense for multi-strings to have implicit tagging, so -+ * if tag != -1, then this looks like an error in the template. -+ */ -+ if (tag != -1) { -+ ASN1err(ASN1_F_ASN1_ITEM_EX_I2D, ASN1_R_BAD_TEMPLATE); -+ return -1; -+ } - return asn1_i2d_ex_primitive(pval, out, it, -1, aclass); - - case ASN1_ITYPE_CHOICE: -+ /* -+ * It never makes sense for CHOICE types to have implicit tagging, so -+ * if tag != -1, then this looks like an error in the template. -+ */ -+ if (tag != -1) { -+ ASN1err(ASN1_F_ASN1_ITEM_EX_I2D, ASN1_R_BAD_TEMPLATE); -+ return -1; -+ } - if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL)) - return 0; - i = asn1_get_choice_selector(pval, it); -diff -up openssl-1.0.2k/crypto/x509v3/v3_genn.c.null-dereference openssl-1.0.2k/crypto/x509v3/v3_genn.c ---- openssl-1.0.2k/crypto/x509v3/v3_genn.c.null-dereference 2020-12-04 10:28:02.374237945 +0100 -+++ openssl-1.0.2k/crypto/x509v3/v3_genn.c 2020-12-04 10:36:51.156138263 +0100 -@@ -72,8 +72,9 @@ ASN1_SEQUENCE(OTHERNAME) = { - IMPLEMENT_ASN1_FUNCTIONS(OTHERNAME) - - ASN1_SEQUENCE(EDIPARTYNAME) = { -- ASN1_IMP_OPT(EDIPARTYNAME, nameAssigner, DIRECTORYSTRING, 0), -- ASN1_IMP_OPT(EDIPARTYNAME, partyName, DIRECTORYSTRING, 1) -+ /* DirectoryString is a CHOICE type so use explicit tagging */ -+ ASN1_EXP_OPT(EDIPARTYNAME, nameAssigner, DIRECTORYSTRING, 0), -+ ASN1_EXP(EDIPARTYNAME, partyName, DIRECTORYSTRING, 1) - } ASN1_SEQUENCE_END(EDIPARTYNAME) - - IMPLEMENT_ASN1_FUNCTIONS(EDIPARTYNAME) -@@ -107,6 +108,37 @@ GENERAL_NAME *GENERAL_NAME_dup(GENERAL_N - (char *)a); - } - -+static int edipartyname_cmp(const EDIPARTYNAME *a, const EDIPARTYNAME *b) -+{ -+ int res; -+ -+ if (a == NULL || b == NULL) { -+ /* -+ * Shouldn't be possible in a valid GENERAL_NAME, but we handle it -+ * anyway. OTHERNAME_cmp treats NULL != NULL so we do the same here -+ */ -+ return -1; -+ } -+ if (a->nameAssigner == NULL && b->nameAssigner != NULL) -+ return -1; -+ if (a->nameAssigner != NULL && b->nameAssigner == NULL) -+ return 1; -+ /* If we get here then both have nameAssigner set, or both unset */ -+ if (a->nameAssigner != NULL) { -+ res = ASN1_STRING_cmp(a->nameAssigner, b->nameAssigner); -+ if (res != 0) -+ return res; -+ } -+ /* -+ * partyName is required, so these should never be NULL. We treat it in -+ * the same way as the a == NULL || b == NULL case above -+ */ -+ if (a->partyName == NULL || b->partyName == NULL) -+ return -1; -+ -+ return ASN1_STRING_cmp(a->partyName, b->partyName); -+} -+ - /* Returns 0 if they are equal, != 0 otherwise. */ - int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b) - { -@@ -116,8 +148,11 @@ int GENERAL_NAME_cmp(GENERAL_NAME *a, GE - return -1; - switch (a->type) { - case GEN_X400: -+ result = ASN1_TYPE_cmp(a->d.x400Address, b->d.x400Address); -+ break; -+ - case GEN_EDIPARTY: -- result = ASN1_TYPE_cmp(a->d.other, b->d.other); -+ result = edipartyname_cmp(a->d.ediPartyName, b->d.ediPartyName); - break; - - case GEN_OTHERNAME: -@@ -164,8 +199,11 @@ void GENERAL_NAME_set0_value(GENERAL_NAM - { - switch (type) { - case GEN_X400: -+ a->d.x400Address = value; -+ break; -+ - case GEN_EDIPARTY: -- a->d.other = value; -+ a->d.ediPartyName = value; - break; - - case GEN_OTHERNAME: -@@ -199,8 +237,10 @@ void *GENERAL_NAME_get0_value(GENERAL_NA - *ptype = a->type; - switch (a->type) { - case GEN_X400: -+ return a->d.x400Address; -+ - case GEN_EDIPARTY: -- return a->d.other; -+ return a->d.ediPartyName; - - case GEN_OTHERNAME: - return a->d.otherName; -diff -up openssl-1.0.2k/crypto/x509v3/v3nametest.c.null-dereference openssl-1.0.2k/crypto/x509v3/v3nametest.c ---- openssl-1.0.2k/crypto/x509v3/v3nametest.c.null-dereference 2020-12-04 10:28:02.374237945 +0100 -+++ openssl-1.0.2k/crypto/x509v3/v3nametest.c 2020-12-04 10:36:51.156138263 +0100 -@@ -321,6 +321,356 @@ static void run_cert(X509 *crt, const ch - } - } - -+struct gennamedata { -+ const unsigned char der[22]; -+ size_t derlen; -+} gennames[] = { -+ { -+ /* -+ * [0] { -+ * OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2.1 } -+ * [0] { -+ * SEQUENCE {} -+ * } -+ * } -+ */ -+ { -+ 0xa0, 0x13, 0x06, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04, -+ 0x01, 0x84, 0xb7, 0x09, 0x02, 0x01, 0xa0, 0x02, 0x30, 0x00 -+ }, -+ 21 -+ }, { -+ /* -+ * [0] { -+ * OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2.1 } -+ * [0] { -+ * [APPLICATION 0] {} -+ * } -+ * } -+ */ -+ { -+ 0xa0, 0x13, 0x06, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04, -+ 0x01, 0x84, 0xb7, 0x09, 0x02, 0x01, 0xa0, 0x02, 0x60, 0x00 -+ }, -+ 21 -+ }, { -+ /* -+ * [0] { -+ * OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2.1 } -+ * [0] { -+ * UTF8String { "a" } -+ * } -+ * } -+ */ -+ { -+ 0xa0, 0x14, 0x06, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04, -+ 0x01, 0x84, 0xb7, 0x09, 0x02, 0x01, 0xa0, 0x03, 0x0c, 0x01, 0x61 -+ }, -+ 22 -+ }, { -+ /* -+ * [0] { -+ * OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2.2 } -+ * [0] { -+ * UTF8String { "a" } -+ * } -+ * } -+ */ -+ { -+ 0xa0, 0x14, 0x06, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04, -+ 0x01, 0x84, 0xb7, 0x09, 0x02, 0x02, 0xa0, 0x03, 0x0c, 0x01, 0x61 -+ }, -+ 22 -+ }, { -+ /* -+ * [0] { -+ * OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2.1 } -+ * [0] { -+ * UTF8String { "b" } -+ * } -+ * } -+ */ -+ { -+ 0xa0, 0x14, 0x06, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04, -+ 0x01, 0x84, 0xb7, 0x09, 0x02, 0x01, 0xa0, 0x03, 0x0c, 0x01, 0x62 -+ }, -+ 22 -+ }, { -+ /* -+ * [0] { -+ * OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2.1 } -+ * [0] { -+ * BOOLEAN { TRUE } -+ * } -+ * } -+ */ -+ { -+ 0xa0, 0x14, 0x06, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04, -+ 0x01, 0x84, 0xb7, 0x09, 0x02, 0x01, 0xa0, 0x03, 0x01, 0x01, 0xff -+ }, -+ 22 -+ }, { -+ /* -+ * [0] { -+ * OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2.1 } -+ * [0] { -+ * BOOLEAN { FALSE } -+ * } -+ * } -+ */ -+ { -+ 0xa0, 0x14, 0x06, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04, -+ 0x01, 0x84, 0xb7, 0x09, 0x02, 0x01, 0xa0, 0x03, 0x01, 0x01, 0x00 -+ }, -+ 22 -+ }, { -+ /* [1 PRIMITIVE] { "a" } */ -+ { -+ 0x81, 0x01, 0x61 -+ }, -+ 3 -+ }, { -+ /* [1 PRIMITIVE] { "b" } */ -+ { -+ 0x81, 0x01, 0x62 -+ }, -+ 3 -+ }, { -+ /* [2 PRIMITIVE] { "a" } */ -+ { -+ 0x82, 0x01, 0x61 -+ }, -+ 3 -+ }, { -+ /* [2 PRIMITIVE] { "b" } */ -+ { -+ 0x82, 0x01, 0x62 -+ }, -+ 3 -+ }, { -+ /* -+ * [4] { -+ * SEQUENCE { -+ * SET { -+ * SEQUENCE { -+ * # commonName -+ * OBJECT_IDENTIFIER { 2.5.4.3 } -+ * UTF8String { "a" } -+ * } -+ * } -+ * } -+ * } -+ */ -+ { -+ 0xa4, 0x0e, 0x30, 0x0c, 0x31, 0x0a, 0x30, 0x08, 0x06, 0x03, 0x55, -+ 0x04, 0x03, 0x0c, 0x01, 0x61 -+ }, -+ 16 -+ }, { -+ /* -+ * [4] { -+ * SEQUENCE { -+ * SET { -+ * SEQUENCE { -+ * # commonName -+ * OBJECT_IDENTIFIER { 2.5.4.3 } -+ * UTF8String { "b" } -+ * } -+ * } -+ * } -+ * } -+ */ -+ { -+ 0xa4, 0x0e, 0x30, 0x0c, 0x31, 0x0a, 0x30, 0x08, 0x06, 0x03, 0x55, -+ 0x04, 0x03, 0x0c, 0x01, 0x62 -+ }, -+ 16 -+ }, { -+ /* -+ * [5] { -+ * [1] { -+ * UTF8String { "a" } -+ * } -+ * } -+ */ -+ { -+ 0xa5, 0x05, 0xa1, 0x03, 0x0c, 0x01, 0x61 -+ }, -+ 7 -+ }, { -+ /* -+ * [5] { -+ * [1] { -+ * UTF8String { "b" } -+ * } -+ * } -+ */ -+ { -+ 0xa5, 0x05, 0xa1, 0x03, 0x0c, 0x01, 0x62 -+ }, -+ 7 -+ }, { -+ /* -+ * [5] { -+ * [0] { -+ * UTF8String {} -+ * } -+ * [1] { -+ * UTF8String { "a" } -+ * } -+ * } -+ */ -+ { -+ 0xa5, 0x09, 0xa0, 0x02, 0x0c, 0x00, 0xa1, 0x03, 0x0c, 0x01, 0x61 -+ }, -+ 11 -+ }, { -+ /* -+ * [5] { -+ * [0] { -+ * UTF8String { "a" } -+ * } -+ * [1] { -+ * UTF8String { "a" } -+ * } -+ * } -+ */ -+ { -+ 0xa5, 0x0a, 0xa0, 0x03, 0x0c, 0x01, 0x61, 0xa1, 0x03, 0x0c, 0x01, -+ 0x61 -+ }, -+ 12 -+ }, { -+ /* -+ * [5] { -+ * [0] { -+ * UTF8String { "b" } -+ * } -+ * [1] { -+ * UTF8String { "a" } -+ * } -+ * } -+ */ -+ { -+ 0xa5, 0x0a, 0xa0, 0x03, 0x0c, 0x01, 0x62, 0xa1, 0x03, 0x0c, 0x01, -+ 0x61 -+ }, -+ 12 -+ }, { -+ /* [6 PRIMITIVE] { "a" } */ -+ { -+ 0x86, 0x01, 0x61 -+ }, -+ 3 -+ }, { -+ /* [6 PRIMITIVE] { "b" } */ -+ { -+ 0x86, 0x01, 0x62 -+ }, -+ 3 -+ }, { -+ /* [7 PRIMITIVE] { `11111111` } */ -+ { -+ 0x87, 0x04, 0x11, 0x11, 0x11, 0x11 -+ }, -+ 6 -+ }, { -+ /* [7 PRIMITIVE] { `22222222`} */ -+ { -+ 0x87, 0x04, 0x22, 0x22, 0x22, 0x22 -+ }, -+ 6 -+ }, { -+ /* [7 PRIMITIVE] { `11111111111111111111111111111111` } */ -+ { -+ 0x87, 0x10, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, -+ 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 -+ }, -+ 18 -+ }, { -+ /* [7 PRIMITIVE] { `22222222222222222222222222222222` } */ -+ { -+ 0x87, 0x10, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, -+ 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 -+ }, -+ 18 -+ }, { -+ /* [8 PRIMITIVE] { 1.2.840.113554.4.1.72585.2.1 } */ -+ { -+ 0x88, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04, 0x01, 0x84, -+ 0xb7, 0x09, 0x02, 0x01 -+ }, -+ 15 -+ }, { -+ /* [8 PRIMITIVE] { 1.2.840.113554.4.1.72585.2.2 } */ -+ { -+ 0x88, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04, 0x01, 0x84, -+ 0xb7, 0x09, 0x02, 0x02 -+ }, -+ 15 -+ } -+}; -+ -+#define OSSL_NELEM(x) (sizeof(x)/sizeof((x)[0])) -+ -+static int test_GENERAL_NAME_cmp(void) -+{ -+ size_t i, j; -+ GENERAL_NAME **namesa = OPENSSL_malloc(sizeof(*namesa) -+ * OSSL_NELEM(gennames)); -+ GENERAL_NAME **namesb = OPENSSL_malloc(sizeof(*namesb) -+ * OSSL_NELEM(gennames)); -+ int testresult = 0; -+ -+ if (namesa == NULL || namesb == NULL) -+ goto end; -+ -+ for (i = 0; i < OSSL_NELEM(gennames); i++) { -+ const unsigned char *derp = gennames[i].der; -+ -+ /* -+ * We create two versions of each GENERAL_NAME so that we ensure when -+ * we compare them they are always different pointers. -+ */ -+ namesa[i] = d2i_GENERAL_NAME(NULL, &derp, gennames[i].derlen); -+ derp = gennames[i].der; -+ namesb[i] = d2i_GENERAL_NAME(NULL, &derp, gennames[i].derlen); -+ if (namesa[i] == NULL || namesb[i] == NULL) -+ goto end; -+ } -+ -+ /* Every name should be equal to itself and not equal to any others. */ -+ for (i = 0; i < OSSL_NELEM(gennames); i++) { -+ for (j = 0; j < OSSL_NELEM(gennames); j++) { -+ if (i == j) { -+ if (GENERAL_NAME_cmp(namesa[i], namesb[j]) != 0) -+ goto end; -+ } else { -+ if (GENERAL_NAME_cmp(namesa[i], namesb[j]) == 0) -+ goto end; -+ } -+ } -+ } -+ testresult = 1; -+ -+ end: -+ for (i = 0; i < OSSL_NELEM(gennames); i++) { -+ if (namesa != NULL) -+ GENERAL_NAME_free(namesa[i]); -+ if (namesb != NULL) -+ GENERAL_NAME_free(namesb[i]); -+ } -+ OPENSSL_free(namesa); -+ OPENSSL_free(namesb); -+ -+ if (!testresult) -+ fprintf(stderr, "test of GENERAL_NAME_cmp failed\n"); -+ -+ return testresult; -+} -+ -+ -+ - int main(void) - { - const struct set_name_fn *pfn = name_fns; -@@ -342,5 +692,8 @@ int main(void) - } - ++pfn; - } -+ -+ errors += !test_GENERAL_NAME_cmp(); -+ - return errors > 0 ? 1 : 0; - } diff --git a/external/openssl/openssl-3650-masm.patch.1 b/external/openssl/openssl-3650-masm.patch.1 deleted file mode 100644 index 97f1eb6446c3..000000000000 --- a/external/openssl/openssl-3650-masm.patch.1 +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/crypto/perlasm/x86masm.pl b/crypto/perlasm/x86masm.pl -index 1741342..917d0f8 100644 ---- a/crypto/perlasm/x86masm.pl -+++ b/crypto/perlasm/x86masm.pl -@@ -18,10 +18,10 @@ sub ::generic - - if ($opcode =~ /lea/ && @arg[1] =~ s/.*PTR\s+(\(.*\))$/OFFSET $1/) # no [] - { $opcode="mov"; } -- elsif ($opcode !~ /movq/) -+ elsif ($opcode !~ /mov[dq]$/) - { # fix xmm references -- $arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[1]=~/\bxmm[0-7]\b/i); -- $arg[1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[0]=~/\bxmm[0-7]\b/i); -+ $arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[-1]=~/\bxmm[0-7]\b/i); -+ $arg[-1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[0]=~/\bxmm[0-7]\b/i); - } - - &::emit($opcode,@arg); -@@ -160,13 +160,13 @@ sub ::public_label - { push(@out,"PUBLIC\t".&::LABEL($_[0],$nmdecor.$_[0])."\n"); } - - sub ::data_byte --{ push(@out,("DB\t").join(',',@_)."\n"); } -+{ push(@out,("DB\t").join(',',splice(@_,0,16))."\n") while(@_); } - - sub ::data_short --{ push(@out,("DW\t").join(',',@_)."\n"); } -+{ push(@out,("DW\t").join(',',splice(@_,0,8))."\n") while(@_); } - - sub ::data_word --{ push(@out,("DD\t").join(',',@_)."\n"); } -+{ push(@out,("DD\t").join(',',splice(@_,0,4))."\n") while(@_); } - - sub ::align - { push(@out,"ALIGN\t$_[0]\n"); } diff --git a/external/openssl/openssl-fixbuild.patch.1 b/external/openssl/openssl-fixbuild.patch.1 deleted file mode 100644 index 5a986e87214b..000000000000 --- a/external/openssl/openssl-fixbuild.patch.1 +++ /dev/null @@ -1,23 +0,0 @@ ---- a/crypto/evp/Makefile -+++ b/crypto/evp/Makefile -@@ -289,7 +289,7 @@ - e_idea.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h - e_idea.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h - e_idea.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h --e_idea.o: ../../include/openssl/evp.h ../../include/openssl/idea.h -+e_idea.o: ../../include/openssl/evp.h ../idea/idea.h - e_idea.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h - e_idea.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h - e_idea.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ---- a/util/mklink.pl -+++ b/util/mklink.pl -@@ -50,8 +50,7 @@ - my $to = join('/', @to_path); - - my $file; --$symlink_exists=eval {symlink("",""); 1}; --if ($^O eq "msys") { $symlink_exists=0 }; -+$symlink_exists=0; - foreach $file (@files) { - my $err = ""; - if ($symlink_exists) { diff --git a/external/openssl/openssl-no-multilib.patch.0 b/external/openssl/openssl-no-multilib.patch.0 new file mode 100644 index 000000000000..07c45318ac25 --- /dev/null +++ b/external/openssl/openssl-no-multilib.patch.0 @@ -0,0 +1,38 @@ +--- Configure.orig 2020-04-21 14:22:39.000000000 +0200 ++++ Configure 2020-07-07 17:25:19.256297500 +0200 +@@ -24,7 +24,7 @@ + my $orig_death_handler = $SIG{__DIE__}; + $SIG{__DIE__} = \&death_handler; + +-my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]\n"; ++my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [no-multilib] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]\n"; + + # Options: + # +@@ -59,6 +59,7 @@ + # If disabled, it also disables shared and dynamic-engine. + # no-asm do not use assembler + # no-egd do not compile support for the entropy-gathering daemon APIs ++# no-multilib exclude multilib identifier from library name + # [no-]zlib [don't] compile support for zlib compression. + # zlib-dynamic Like "zlib", but the zlib library is expected to be a shared + # library and will be loaded in run-time by the OpenSSL library. +@@ -383,6 +384,7 @@ + "mdc2", + "msan", + "multiblock", ++ "multilib", + "nextprotoneg", + "pinshared", + "ocb", +@@ -1754,6 +1756,10 @@ + if (-f catfile($srcdir, "test", $_, "build.info")); + } + ++ if ($disabled{"multilib"}) { ++ $target{"multilib"} = ""; ++ } ++ + $config{build_infos} = [ ]; + + my %ordinals = (); diff --git a/external/openssl/openssllnx.patch b/external/openssl/openssllnx.patch deleted file mode 100644 index 224df8f87b2e..000000000000 --- a/external/openssl/openssllnx.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- build/openssl-0.9.8v/Configure-old 2010-04-17 13:51:42.000000000 +0200 -+++ build/openssl-0.9.8v/Configure 2010-04-17 13:52:03.000000000 +0200 -@@ -388,6 +388,9 @@ - - "bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - -+"debian-kfreebsd-amd64","gcc:-m64 -DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -+"debian-kfreebsd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -+ - "nextstep", "cc:-O -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", - "nextstep3.3", "cc:-O3 -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", - ---- build/openssl-0.9.8v/Makefile.org 2010-01-27 17:06:36.000000000 +0100 -+++ build/openssl-0.9.8v/Makefile.org 2010-09-20 09:24:00.000000000 +0100 -@@ -206,7 +206,7 @@ - # same language for uniform treatment. - BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\ - CC='$(CC)' CFLAG='$(CFLAG)' \ -- AS='$(CC)' ASFLAG='$(CFLAG) -c' \ -+ AS='$(CC)' ASFLAG='$(CFLAG) -c -Wa,--noexecstack' \ - AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ - RC='$(RC)' \ - CROSS_COMPILE='$(CROSS_COMPILE)' \ diff --git a/external/openssl/opensslsol.patch b/external/openssl/opensslsol.patch deleted file mode 100644 index 6122b67c930e..000000000000 --- a/external/openssl/opensslsol.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- misc/openssl-0.9.8v/Makefile.shared Wed Sep 17 17:56:40 2008 -+++ build/openssl-0.9.8v/Makefile.shared Fri Mar 26 16:04:41 2010 -@@ -95,7 +95,7 @@ - LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \ - LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \ - LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \ -- LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \ -+ LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \ - $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} ) - - LINK_SO= \ -@@ -105,7 +105,7 @@ - SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \ - LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \ - LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \ -- LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \ -+ LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \ - $${SHAREDCMD} $${SHAREDFLAGS} \ - -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \ - $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \ diff --git a/external/openssl/opensslwnt.patch b/external/openssl/opensslwnt.patch deleted file mode 100644 index e22bea6f077b..000000000000 --- a/external/openssl/opensslwnt.patch +++ /dev/null @@ -1,167 +0,0 @@ -diff -ru openssl.orig/crypto/x509v3/v3_pci.c openssl/crypto/x509v3/v3_pci.c ---- a/openssl.orig/crypto/x509v3/v3_pci.c 2016-03-01 14:35:05.000000000 +0100 -+++ b/openssl/crypto/x509v3/v3_pci.c 2016-03-03 20:27:42.195914432 +0100 -@@ -3,7 +3,7 @@ - * Contributed to the OpenSSL Project 2004 by Richard Levitte - * (richard@levitte.org) - */ --/* Copyright (c) 2004 Kungliga Tekniska Högskolan -+/* Copyright (c) 2004 Kungliga Tekniska Hoegskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. - * -diff -ru openssl.orig/crypto/x509v3/v3_pcia.c openssl/crypto/x509v3/v3_pcia.c ---- a/openssl.orig/crypto/x509v3/v3_pcia.c 2016-03-01 14:35:05.000000000 +0100 -+++ b/openssl/crypto/x509v3/v3_pcia.c 2016-03-03 20:27:56.495913984 +0100 -@@ -3,7 +3,7 @@ - * Contributed to the OpenSSL Project 2004 by Richard Levitte - * (richard@levitte.org) - */ --/* Copyright (c) 2004 Kungliga Tekniska Högskolan -+/* Copyright (c) 2004 Kungliga Tekniska Hoegskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. - * -diff -ru openssl.orig/ms/do_ms.bat openssl/ms/do_ms.bat ---- a/openssl.orig/ms/do_ms.bat 2015-01-15 15:43:14.000000000 +0100 -+++ b/openssl/ms/do_ms.bat 2016-03-03 20:31:09.355907935 +0100 -@@ -1,11 +1,11 @@ - --perl util\mkfiles.pl >MINFO --perl util\mk1mf.pl no-asm VC-WIN32 >ms\nt.mak --perl util\mk1mf.pl dll no-asm VC-WIN32 >ms\ntdll.mak --if x%OSVERSION% == x goto skipce --perl util\mk1mf.pl no-asm VC-CE >ms\ce.mak --perl util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak --:skipce -+%1 util\mkfiles.pl >MINFO -+if %2 == VC-WIN32 goto not64a -+perl ms\uplink.pl win64a > ms\uptable.asm -+ml64 -c -Foms\uptable.obj ms\uptable.asm -+:not64a -+%1 util\mk1mf.pl no-asm %2 >ms\nt.mak -+%1 util\mk1mf.pl dll no-asm %2 >ms\ntdll.mak - --perl util\mkdef.pl 32 libeay > ms\libeay32.def --perl util\mkdef.pl 32 ssleay > ms\ssleay32.def -+%1 util\mkdef.pl 32 libeay > ms\libeay32.def -+%1 util\mkdef.pl 32 ssleay > ms\ssleay32.def -diff -ru openssl.orig/util/mk1mf.pl openssl/util/mk1mf.pl ---- a/openssl.orig/util/mk1mf.pl 2016-03-03 20:22:21.043924505 +0100 -+++ b/openssl/util/mk1mf.pl 2016-03-03 20:34:45.015901171 +0100 -@@ -163,7 +163,7 @@ - $inc_def="outinc"; - $tmp_def="tmp"; - --$perl="perl" unless defined $perl; -+$perl="$ENV{PERL}" unless defined $perl; - $mkdir="-mkdir" unless defined $mkdir; - - ($ssl,$crypto)=("ssl","crypto"); -@@ -347,6 +347,11 @@ - s/\s*$//; # was chop, didn't work in mixture of perls for Windows... - - ($key,$val)=/^([^=]+)=(.*)/; -+ -+ # On some Windows machines, $val has linefeeds at the end, which confuses -+ # subsequent code in this file. So we strip all whitespace at the end. -+ $val =~ s/\s+$//; -+ - if ($key eq "RELATIVE_DIRECTORY") - { - if ($lib ne "") -@@ -473,7 +478,7 @@ - # Set your compiler options - PLATFORM=$platform - CC=$bin_dir${cc} --CFLAG=$cflags -+CFLAG=$cflags \$(SOLARINC) - APP_CFLAG=$app_cflag - LIB_CFLAG=$lib_cflag - SHLIB_CFLAG=$shl_cflag -@@ -488,7 +493,7 @@ - - LINK_CMD=$link - LFLAGS=$lflags --RSC=$rsc -+RSC=$rsc \$(SOLARINC) - - # The output directory for everything interesting - OUT_D=$out_dir -@@ -669,7 +674,7 @@ - printf OUT <<EOF; - #ifdef $platform_cpp_symbol - /* auto-generated/updated by util/mk1mf.pl for crypto/cversion.c */ -- #define CFLAGS "compiler: $cc $cflags" -+ #define CFLAGS "compiler: $cflags" - #define PLATFORM "$platform" - EOF - printf OUT " #define DATE \"%s\"\n", scalar gmtime(); -diff -ru openssl.orig/util/pl/VC-32.pl openssl/util/pl/VC-32.pl ---- a/openssl.orig/util/pl/VC-32.pl 2016-03-01 14:35:53.000000000 +0100 -+++ b/openssl/util/pl/VC-32.pl 2016-03-03 21:15:14.083824986 +0100 -@@ -30,7 +30,7 @@ - my $ff = ""; - - # C compiler stuff --$cc='cl'; -+$cc=$ENV{'CC'}; - if ($FLAVOR =~ /WIN64/) - { - # Note that we currently don't have /WX on Win64! There is a lot of -@@ -114,7 +114,7 @@ - } - - $cc=($ENV{CC} or "cl"); -- $base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT'; -+ $base_cflags=' -W3 -GF -Gy -nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT'; - $base_cflags.=" $wcecdefs"; - $base_cflags.=' -I$(WCECOMPAT)/include' if (defined($ENV{'WCECOMPAT'})); - $base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'})); -@@ -123,20 +123,21 @@ - } else { - $base_cflags.=' /MC'; - } -- $opt_cflags=' /O1i'; # optimize for space, but with intrinsics... -- $dbg_cflags=' /Od -DDEBUG -D_DEBUG'; -+ $opt_cflags=' -O1i'; # optimize for space, but with intrinsics... -+ $dbg_cflags=' -Od -DDEBUG -D_DEBUG'; -+ - $lflags="/nologo /opt:ref $wcelflag"; - } - else # Win32 - { - $base_cflags= " $mf_cflag"; -- my $f = $shlib || $fips ?' /MD':' /MT'; -+ my $f = $shlib || $fips ? (($ENV{MSVC_USE_DEBUG_RUNTIME} eq "TRUE") ? ' -MDd' : ' -MD' ):' -MT'; - $ff = "/fixed"; -- $opt_cflags=$f.' /Ox /O2 /Ob2'; -- $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; -+ $opt_cflags=$f.' -Ox -O2 -Ob2'; -+ $dbg_cflags=$f.'d -Od -DDEBUG -D_DEBUG'; - $lflags="/nologo /subsystem:console /opt:ref"; - } --$lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib -+$lib_cflag='-Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib - $mlflags=''; - - $out_def ="out32"; $out_def.="dll" if ($shlib); -@@ -161,7 +162,7 @@ - - $obj='.obj'; - $asm_suffix='.asm'; --$ofile="/Fo"; -+$ofile="-Fo.\\"; - - # EXE linking stuff - $link="link"; -diff -ru openssl.orig/ms/uplink.c openssl/ms/uplink.c ---- a/openssl.orig/ms/uplink.c 2015-03-19 15:02:02.000000000 +0100 -+++ b/openssl/ms/uplink.c 2016-03-03 20:39:19.403892565 +0100 -@@ -1,5 +1,6 @@ - #if (defined(_WIN64) || defined(_WIN32_WCE)) && !defined(UNICODE) - # define UNICODE -+# define _CRT_NON_CONFORMING_SWPRINTFS - #endif - #if defined(UNICODE) && !defined(_UNICODE) - # define _UNICODE diff --git a/external/openssl/opensslwnt_safeseh.patch b/external/openssl/opensslwnt_safeseh.patch deleted file mode 100644 index f2eafab5b9ed..000000000000 --- a/external/openssl/opensslwnt_safeseh.patch +++ /dev/null @@ -1,23 +0,0 @@ -use /safeseh in 32-bit MSVC builds; this is not required for 64-bit - -diff -ru openssl.orig/util/mk1mf.pl openssl/util/mk1mf.pl ---- a/openssl.orig/util/mk1mf.pl 2016-03-03 20:22:21.043924505 +0100 -+++ b/openssl/util/mk1mf.pl 2016-03-03 20:34:45.015901171 +0100 -@@ -488,7 +493,7 @@ - SRC_D=$src_dir - - LINK_CMD=$link --LFLAGS=$lflags -+LFLAGS=$lflags /SAFESEH - RSC=$rsc \$(SOLARINC) - - # The output directory for everything interesting -@@ -511,7 +516,7 @@ - MKDIR=$mkdir - MKLIB=$bin_dir$mklib - MLFLAGS=$mlflags --ASM=$bin_dir$asm -+ASM=$bin_dir$asm /safeseh - - # FIPS validated module and support file locations - diff --git a/external/poppler/StaticLibrary_poppler.mk b/external/poppler/StaticLibrary_poppler.mk index aab71eac9a6a..cc43e873c4f2 100644 --- a/external/poppler/StaticLibrary_poppler.mk +++ b/external/poppler/StaticLibrary_poppler.mk @@ -11,7 +11,10 @@ $(eval $(call gb_StaticLibrary_StaticLibrary,poppler)) $(eval $(call gb_StaticLibrary_use_unpacked,poppler,poppler)) -$(eval $(call gb_StaticLibrary_use_external,poppler,libjpeg)) +$(eval $(call gb_StaticLibrary_use_externals,poppler,\ + libjpeg \ + boost_headers \ +)) $(eval $(call gb_StaticLibrary_set_warnings_not_errors,poppler)) @@ -100,6 +103,8 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\ UnpackedTarball/poppler/poppler/Decrypt \ UnpackedTarball/poppler/poppler/Dict \ UnpackedTarball/poppler/poppler/Error \ + UnpackedTarball/poppler/poppler/FDPDFDocBuilder \ + UnpackedTarball/poppler/poppler/FILECacheLoader \ UnpackedTarball/poppler/poppler/FileSpec \ UnpackedTarball/poppler/poppler/FontEncodingTables \ UnpackedTarball/poppler/poppler/Form \ @@ -110,6 +115,7 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\ UnpackedTarball/poppler/poppler/GfxState \ UnpackedTarball/poppler/poppler/GlobalParams \ UnpackedTarball/poppler/poppler/Hints \ + UnpackedTarball/poppler/poppler/ImageEmbeddingUtils \ UnpackedTarball/poppler/poppler/JArithmeticDecoder \ UnpackedTarball/poppler/poppler/JBIG2Stream \ UnpackedTarball/poppler/poppler/JSInfo \ @@ -146,8 +152,6 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\ UnpackedTarball/poppler/poppler/TextOutputDev \ UnpackedTarball/poppler/poppler/PageLabelInfo \ UnpackedTarball/poppler/poppler/SecurityHandler \ - UnpackedTarball/poppler/poppler/StdinCachedFile \ - UnpackedTarball/poppler/poppler/StdinPDFDocBuilder \ UnpackedTarball/poppler/poppler/Sound \ UnpackedTarball/poppler/poppler/ViewerPreferences \ UnpackedTarball/poppler/poppler/Movie \ diff --git a/external/poppler/UnpackedTarball_poppler.mk b/external/poppler/UnpackedTarball_poppler.mk index 0f29d38e097c..cc3e30651871 100644 --- a/external/poppler/UnpackedTarball_poppler.mk +++ b/external/poppler/UnpackedTarball_poppler.mk @@ -16,6 +16,13 @@ $(eval $(call gb_UnpackedTarball_add_patches,poppler,\ external/poppler/poppler-c++11.patch.1 \ external/poppler/0001-Partially-revert-814fbda28cc8a37fed3134c2db8da28f86f.patch.1 \ external/poppler/0001-Revert-Make-the-mul-tables-be-calculated-at-compile-.patch.1 \ + external/poppler/disable-freetype.patch.1 \ + external/poppler/gcc7-EntityInfo.patch.1 \ +)) + +# patch is required for MSVC but changes the API used by sdext so apply always +$(eval $(call gb_UnpackedTarball_add_patches,poppler,\ + external/poppler/poppler-vs2015-buildfix.patch.1 \ )) # std::make_unique is only available in C++14 diff --git a/external/poppler/disable-freetype.patch.1 b/external/poppler/disable-freetype.patch.1 new file mode 100644 index 000000000000..d59006eba979 --- /dev/null +++ b/external/poppler/disable-freetype.patch.1 @@ -0,0 +1,41 @@ +disable freetype dependent code + +--- poppler/poppler/Form.cc.orig 2022-09-14 15:46:48.588316681 +0200 ++++ poppler/poppler/Form.cc 2022-09-14 15:48:01.468274551 +0200 +@@ -46,7 +46,7 @@ + #include <cstdlib> + #include <cstring> + #include <cctype> +-#include "goo/ft_utils.h" ++//#include "goo/ft_utils.h" + #include "goo/gmem.h" + #include "goo/gfile.h" + #include "goo/GooString.h" +@@ -77,8 +77,8 @@ + #include "fofi/FoFiTrueType.h" + #include "fofi/FoFiIdentifier.h" + +-#include <ft2build.h> +-#include FT_FREETYPE_H ++//#include <ft2build.h> ++//#include FT_FREETYPE_H + + // return a newly allocated char* containing an UTF16BE string of size length + char *pdfDocEncodingToUTF16(const std::string &orig, int *length) +@@ -2730,6 +2730,8 @@ + + Form::AddFontResult Form::addFontToDefaultResources(const std::string &filepath, int faceIndex, const std::string &fontFamily, const std::string &fontStyle) + { ++ return {}; ++#if 0 + if (!GooString::endsWith(filepath, ".ttf") && !GooString::endsWith(filepath, ".ttc") && !GooString::endsWith(filepath, ".otf")) { + error(errIO, -1, "We only support embedding ttf/ttc/otf fonts for now. The font file for {0:s} {1:s} was {2:s}", fontFamily.c_str(), fontStyle.c_str(), filepath.c_str()); + return {}; +@@ -2939,6 +2941,7 @@ + } + + return { dictFontName, fontDictRef }; ++#endif + } + + std::string Form::getFallbackFontForChar(Unicode uChar, const GfxFont &fontToEmulate) const diff --git a/external/poppler/gcc7-EntityInfo.patch.1 b/external/poppler/gcc7-EntityInfo.patch.1 new file mode 100644 index 000000000000..b450bff93af9 --- /dev/null +++ b/external/poppler/gcc7-EntityInfo.patch.1 @@ -0,0 +1,48 @@ +gcc 7.3.1 says: + +workdir/UnpackedTarball/poppler/poppler/CertificateInfo.cc:42:34: error: function ‘X509CertificateInfo::EntityInfo& X509CertificateInfo::EntityInfo::operator=(X509CertificateInfo::EntityInfo&&)’ defaulted on its redeclaration with an exception-specification that differs from the implicit exception-specification ‘’ + +--- poppler/poppler/CertificateInfo.h.orig 2022-09-14 19:32:12.426351385 +0200 ++++ poppler/poppler/CertificateInfo.h 2022-09-14 19:32:18.947347812 +0200 +@@ -70,7 +70,7 @@ + ~EntityInfo(); + + EntityInfo(EntityInfo &&) noexcept; +- EntityInfo &operator=(EntityInfo &&) noexcept; ++ EntityInfo &operator=(EntityInfo &&) /*noexcept*/; + + EntityInfo(const EntityInfo &) = delete; + EntityInfo &operator=(const EntityInfo &) = delete; +--- poppler/poppler/CertificateInfo.cc.orig 2022-09-14 19:31:10.225385467 +0200 ++++ poppler/poppler/CertificateInfo.cc 2022-09-14 19:31:12.572384182 +0200 +@@ -39,7 +39,7 @@ + + X509CertificateInfo::EntityInfo::EntityInfo(X509CertificateInfo::EntityInfo &&other) noexcept = default; + +-X509CertificateInfo::EntityInfo &X509CertificateInfo::EntityInfo::operator=(X509CertificateInfo::EntityInfo &&other) noexcept = default; ++X509CertificateInfo::EntityInfo &X509CertificateInfo::EntityInfo::operator=(X509CertificateInfo::EntityInfo &&other) /*noexcept*/ = default; + + X509CertificateInfo::X509CertificateInfo() : ku_extensions(KU_NONE), cert_version(-1), is_self_signed(false) { } + +--- poppler/poppler/GfxFont.cc.orig 2022-09-14 20:24:32.569607333 +0200 ++++ poppler/poppler/GfxFont.cc 2022-09-14 20:24:52.323596186 +0200 +@@ -180,7 +180,7 @@ + + GfxFontLoc::GfxFontLoc(GfxFontLoc &&other) noexcept = default; + +-GfxFontLoc &GfxFontLoc::operator=(GfxFontLoc &&other) noexcept = default; ++GfxFontLoc &GfxFontLoc::operator=(GfxFontLoc &&other) /*noexcept*/ = default; + + void GfxFontLoc::setPath(GooString *pathA) + { +--- poppler/poppler/GfxFont.h.orig 2022-09-14 20:24:30.784608340 +0200 ++++ poppler/poppler/GfxFont.h 2022-09-14 20:25:08.850586861 +0200 +@@ -124,7 +124,7 @@ + GfxFontLoc(const GfxFontLoc &) = delete; + GfxFontLoc(GfxFontLoc &&) noexcept; + GfxFontLoc &operator=(const GfxFontLoc &) = delete; +- GfxFontLoc &operator=(GfxFontLoc &&other) noexcept; ++ GfxFontLoc &operator=(GfxFontLoc &&other) /*noexcept*/; + + // Set the 'path' string from a GooString on the heap. + // Ownership of the object is taken. diff --git a/external/poppler/poppler-c++11.patch.1 b/external/poppler/poppler-c++11.patch.1 index 9e607b381de0..05b47bc91299 100644 --- a/external/poppler/poppler-c++11.patch.1 +++ b/external/poppler/poppler-c++11.patch.1 @@ -18,7 +18,7 @@ remove usage of newfangled C++ that baseline toolchains don't support - const std::string modeStr = mode + "e"s; + const std::string modeStr = mode + std::string("e"); FILE *file = fopen(path, modeStr.c_str()); - if (file != nullptr) + if (file != nullptr) { return file; --- poppler/goo/gmem.h.orig 2019-01-16 11:25:28.161920038 +0100 +++ poppler/goo/gmem.h 2019-01-16 11:25:53.756882295 +0100 @@ -29,3 +29,14 @@ remove usage of newfangled C++ that baseline toolchains don't support +#include <o3tl/make_unique.hxx> + #endif // GMEM_H +--- poppler/goo/gfile.cc.orig2 2022-09-15 12:33:24.163562177 +0200 ++++ poppler/goo/gfile.cc 2022-09-15 12:33:49.501547336 +0200 +@@ -50,6 +50,8 @@ + #include "gfile.h" + #include "gdir.h" + ++#include <o3tl/make_unique.hxx> ++ + // Some systems don't define this, so just make it something reasonably + // large. + #ifndef PATH_MAX diff --git a/external/poppler/poppler-config.patch.1 b/external/poppler/poppler-config.patch.1 index 2a24d4510197..455a88e2afc4 100644 --- a/external/poppler/poppler-config.patch.1 +++ b/external/poppler/poppler-config.patch.1 @@ -16,7 +16,7 @@ new file mode 100644 index 0fbd336a..451213f8 100644 --- /dev/null +++ b/config.h -@@ -0,0 +1,223 @@ +@@ -0,0 +1,220 @@ +/* config.h. Generated from config.h.cmake by cmake. */ + +/* Build against libcurl. */ @@ -105,9 +105,6 @@ index 0fbd336a..451213f8 100644 +#define HAVE_TIMEGM 1 +#endif + -+/* Define if you have the iconv() function and it works. */ -+/* #undef HAVE_ICONV */ -+ +/* Define to 1 if you have the `z' library (-lz). */ +/* #undef HAVE_LIBZ */ + @@ -176,7 +173,7 @@ index 0fbd336a..451213f8 100644 +#define PACKAGE_NAME "poppler" + +/* Define to the full name and version of this package. */ -+#define PACKAGE_STRING "poppler 21.11.0" ++#define PACKAGE_STRING "poppler 22.09.0" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "poppler" @@ -185,7 +182,7 @@ index 0fbd336a..451213f8 100644 +#define PACKAGE_URL "" + +/* Define to the version of this package. */ -+#define PACKAGE_VERSION "21.11.0" ++#define PACKAGE_VERSION "22.09.0" + +/* Poppler data dir */ +#define POPPLER_DATADIR "/usr/local/share/poppler" @@ -203,7 +200,7 @@ index 0fbd336a..451213f8 100644 +/* #undef USE_FLOAT */ + +/* Version number of package */ -+#define VERSION "21.11.0" ++#define VERSION "22.09.0" + +#if defined(__APPLE__) +#elif defined (_WIN32) @@ -229,7 +226,7 @@ index 0fbd336a..451213f8 100644 +#define popen _popen +#define pclose _pclose +#define strncasecmp _strnicmp -+// error C4005: "strcasecmp": macro redefinition #define strcasecmp _stricmp ++#define strcasecmp _stricmp +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ @@ -250,7 +247,7 @@ index 0fbd336a..451213f8 100644 +// +// poppler-config.h +// -+// Copyright 1996-2011 Glyph & Cog, LLC ++// Copyright 1996-2011, 2022 Glyph & Cog, LLC +// +//======================================================================== + @@ -284,7 +281,7 @@ index 0fbd336a..451213f8 100644 + +/* Defines the poppler version. */ +#ifndef POPPLER_VERSION -+#define POPPLER_VERSION "21.11.0" ++#define POPPLER_VERSION "22.09.0" +#endif + +/* Use single precision arithmetic in the Splash backend */ @@ -376,8 +373,8 @@ index 0fbd336a..451213f8 100644 +//------------------------------------------------------------------------ + +// copyright notice -+#define popplerCopyright "Copyright 2005-2021 The Poppler Developers - http://poppler.freedesktop.org" -+#define xpdfCopyright "Copyright 1996-2011 Glyph & Cog, LLC" ++#define popplerCopyright "Copyright 2005-2022 The Poppler Developers - http://poppler.freedesktop.org" ++#define xpdfCopyright "Copyright 1996-2011, 2022 Glyph & Cog, LLC" + +//------------------------------------------------------------------------ +// Win32 stuff @@ -436,9 +433,9 @@ index 0fbd336a..451213f8 100644 + +#include "poppler-global.h" + -+#define POPPLER_VERSION "21.11.0" -+#define POPPLER_VERSION_MAJOR 21 -+#define POPPLER_VERSION_MINOR 11 ++#define POPPLER_VERSION "22.09.0" ++#define POPPLER_VERSION_MAJOR 22 ++#define POPPLER_VERSION_MINOR 9 +#define POPPLER_VERSION_MICRO 0 + +namespace poppler diff --git a/external/poppler/poppler-vs2015-buildfix.patch.1 b/external/poppler/poppler-vs2015-buildfix.patch.1 new file mode 100644 index 000000000000..573eae32f7b1 --- /dev/null +++ b/external/poppler/poppler-vs2015-buildfix.patch.1 @@ -0,0 +1,1707 @@ +Remove a few c++11-isms to fix build on VS201 + +diff -ur workdir/UnpackedTrball/poppler/glib/poppler-document.cc poppler/glib/poppler-document.cc +--- poppler/glib/poppler-document.cc 2022-09-16 21:58:38.029530600 +0300 ++++ poppler/glib/poppler-document.cc 2022-09-16 16:27:33.387683800 +0300 +@@ -159,7 +159,7 @@ + return document; + } + +-static std::optional<GooString> poppler_password_to_latin1(const gchar *password) ++static boost::optional<GooString> poppler_password_to_latin1(const gchar *password) + { + gchar *password_latin; + +@@ -168,7 +168,7 @@ + } + + password_latin = g_convert(password, -1, "ISO-8859-1", "UTF-8", nullptr, nullptr, nullptr); +- std::optional<GooString> password_g = GooString(password_latin); ++ boost::optional<GooString> password_g = GooString(password_latin); + g_free(password_latin); + + return password_g; +@@ -198,7 +198,7 @@ + return nullptr; + } + +- const std::optional<GooString> password_g = poppler_password_to_latin1(password); ++ const boost::optional<GooString> password_g = poppler_password_to_latin1(password); + + #ifdef G_OS_WIN32 + wchar_t *filenameW; +@@ -262,7 +262,7 @@ + // create stream + str = new MemStream(data, 0, length, Object(objNull)); + +- const std::optional<GooString> password_g = poppler_password_to_latin1(password); ++ const boost::optional<GooString> password_g = poppler_password_to_latin1(password); + newDoc = new PDFDoc(str, password_g, password_g); + if (!newDoc->isOk() && newDoc->getErrorCode() == errEncrypted && password) { + /* Try again with original password (which comes from GTK in UTF8) Issue #824 */ +@@ -327,7 +327,7 @@ + // create stream + str = new BytesStream(bytes, Object(objNull)); + +- const std::optional<GooString> password_g = poppler_password_to_latin1(password); ++ const boost::optional<GooString> password_g = poppler_password_to_latin1(password); + newDoc = new PDFDoc(str, password_g, password_g); + if (!newDoc->isOk() && newDoc->getErrorCode() == errEncrypted && password) { + /* Try again with original password (which comes from GTK in UTF8) Issue #824 */ +@@ -391,7 +391,7 @@ + str = new CachedFileStream(cachedFile, 0, false, cachedFile->getLength(), Object(objNull)); + } + +- const std::optional<GooString> password_g = poppler_password_to_latin1(password); ++ const boost::optional<GooString> password_g = poppler_password_to_latin1(password); + newDoc = new PDFDoc(str, password_g, password_g); + if (!newDoc->isOk() && newDoc->getErrorCode() == errEncrypted && password) { + /* Try again with original password (which comes from GTK in UTF8) Issue #824 */ +@@ -515,7 +515,7 @@ + stream = new OwningFileStream(GooFile::open(fd), Object(objNull)); + } + +- const std::optional<GooString> password_g = poppler_password_to_latin1(password); ++ const boost::optional<GooString> password_g = poppler_password_to_latin1(password); + newDoc = new PDFDoc(stream, password_g, password_g); + if (!newDoc->isOk() && newDoc->getErrorCode() == errEncrypted && password) { + /* Try again with original password (which comes from GTK in UTF8) Issue #824 */ +@@ -2839,7 +2839,7 @@ + + info = iter->items[iter->index]; + +- const std::optional<std::string> &name = info->getName(); ++ const boost::optional<std::string> &name = info->getName(); + if (name) { + return name->c_str(); + } else { +@@ -2893,7 +2893,7 @@ + + info = iter->items[iter->index]; + +- const std::optional<std::string> &name = info->getSubstituteName(); ++ const boost::optional<std::string> &name = info->getSubstituteName(); + if (name) { + return name->c_str(); + } else { +@@ -2916,7 +2916,7 @@ + + info = iter->items[iter->index]; + +- const std::optional<std::string> &file = info->getFile(); ++ const boost::optional<std::string> &file = info->getFile(); + if (file) { + return file->c_str(); + } else { +diff -ur poppler/goo/GooString.h poppler/goo/GooString.h +--- poppler/goo/GooString.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/goo/GooString.h 2022-09-16 16:27:39.202358800 +0300 +@@ -246,8 +246,8 @@ + // Return true if string ends with suffix + POPPLER_PRIVATE_EXPORT bool endsWith(const char *suffix) const; + +- static bool startsWith(std::string_view str, std::string_view prefix) { return str.size() >= prefix.size() && 0 == str.compare(0, prefix.size(), prefix); } +- static bool endsWith(std::string_view str, std::string_view suffix) { return str.size() >= suffix.size() && 0 == str.compare(str.size() - suffix.size(), suffix.size(), suffix); } ++ static bool startsWith(const std::string &str, const std::string &prefix) { return str.size() >= prefix.size() && 0 == str.compare(0, prefix.size(), prefix); } ++ static bool endsWith(const std::string &str, const std::string &suffix) { return str.size() >= suffix.size() && 0 == str.compare(str.size() - suffix.size(), suffix.size(), suffix); } + + bool hasUnicodeMarker() const { return hasUnicodeMarker(*this); } + static bool hasUnicodeMarker(const std::string &s) { return s.size() >= 2 && s[0] == '\xfe' && s[1] == '\xff'; } +diff -ur poppler/poppler/Annot.cc poppler/poppler/Annot.cc +--- poppler/poppler/Annot.cc 2022-09-16 21:58:39.610103800 +0300 ++++ poppler/poppler/Annot.cc 2022-09-16 16:32:09.879243000 +0300 +@@ -1258,7 +1258,7 @@ + // Annot + //------------------------------------------------------------------------ + +-#define annotLocker() const std::scoped_lock locker(mutex) ++#define annotLocker() std::unique_lock<std::recursive_mutex> locker(mutex) + + Annot::Annot(PDFDoc *docA, PDFRectangle *rectA) + { +@@ -3020,7 +3020,7 @@ + public: + HorizontalTextLayouter() = default; + +- HorizontalTextLayouter(const GooString *text, const Form *form, const GfxFont *font, std::optional<double> availableWidth, const bool noReencode) ++ HorizontalTextLayouter(const GooString *text, const Form *form, const GfxFont *font, boost::optional<double> availableWidth, const bool noReencode) + { + int i = 0; + double blockWidth; +diff -ur poppler/poppler/Array.cc poppler/poppler/Array.cc +--- poppler/poppler/Array.cc 2022-09-16 21:58:39.678843800 +0300 ++++ poppler/poppler/Array.cc 2022-09-16 16:32:14.266553700 +0300 +@@ -36,7 +36,7 @@ + // Array + //------------------------------------------------------------------------ + +-#define arrayLocker() const std::scoped_lock locker(mutex) ++#define arrayLocker() std::unique_lock<std::recursive_mutex> locker(mutex) + + Array::Array(XRef *xrefA) + { +diff -ur poppler/poppler/CairoFontEngine.cc poppler/poppler/CairoFontEngine.cc +--- poppler/poppler/CairoFontEngine.cc 2022-09-16 21:58:39.910021100 +0300 ++++ poppler/poppler/CairoFontEngine.cc 2022-09-16 16:32:26.488191000 +0300 +@@ -163,7 +163,7 @@ + CairoFreeTypeFont::~CairoFreeTypeFont() { } + + // Create a cairo_font_face_t for the given font filename OR font data. +-static std::optional<FreeTypeFontFace> createFreeTypeFontFace(FT_Library lib, const std::string &filename, std::vector<unsigned char> &&font_data) ++static boost::optional<FreeTypeFontFace> createFreeTypeFontFace(FT_Library lib, const std::string &filename, std::vector<unsigned char> &&font_data) + { + FreeTypeFontResource *resource = new FreeTypeFontResource; + FreeTypeFontFace font_face; +@@ -196,7 +196,7 @@ + + // Create a cairo_font_face_t for the given font filename OR font data. First checks if external font + // is in the cache. +-std::optional<FreeTypeFontFace> CairoFreeTypeFont::getFreeTypeFontFace(CairoFontEngine *fontEngine, FT_Library lib, const std::string &filename, std::vector<unsigned char> &&font_data) ++boost::optional<FreeTypeFontFace> CairoFreeTypeFont::getFreeTypeFontFace(CairoFontEngine *fontEngine, FT_Library lib, const std::string &filename, std::vector<unsigned char> &&font_data) + { + if (font_data.empty()) { + return fontEngine->getExternalFontFace(lib, filename); +@@ -210,11 +210,11 @@ + std::string fileName; + std::vector<unsigned char> font_data; + int i, n; +- std::optional<GfxFontLoc> fontLoc; ++ boost::optional<GfxFontLoc> fontLoc; + char **enc; + const char *name; + FoFiType1C *ff1c; +- std::optional<FreeTypeFontFace> font_face; ++ boost::optional<FreeTypeFontFace> font_face; + std::vector<int> codeToGID; + bool substitute = false; + +@@ -604,7 +604,7 @@ + + std::shared_ptr<CairoFont> CairoFontEngine::getFont(const std::shared_ptr<GfxFont> &gfxFont, PDFDoc *doc, bool printing, XRef *xref) + { +- std::scoped_lock lock(mutex); ++ std::unique_lock<std::recursive_mutex> locker(mutex); + Ref ref = *gfxFont->getID(); + std::shared_ptr<CairoFont> font; + +@@ -638,9 +638,9 @@ + return font; + } + +-std::optional<FreeTypeFontFace> CairoFontEngine::getExternalFontFace(FT_Library ftlib, const std::string &filename) ++boost::optional<FreeTypeFontFace> CairoFontEngine::getExternalFontFace(FT_Library ftlib, const std::string &filename) + { +- std::scoped_lock lock(fontFileCacheMutex); ++ std::unique_lock<std::recursive_mutex> locker(mutex); + + auto it = fontFileCache.find(filename); + if (it != fontFileCache.end()) { +@@ -649,7 +649,7 @@ + return font; + } + +- std::optional<FreeTypeFontFace> font_face = createFreeTypeFontFace(ftlib, filename, {}); ++ boost::optional<FreeTypeFontFace> font_face = createFreeTypeFontFace(ftlib, filename, {}); + if (font_face) { + cairo_font_face_reference(font_face->cairo_font_face); + fontFileCache[filename] = *font_face; +diff -ur poppler/poppler/CairoFontEngine.h poppler/poppler/CairoFontEngine.h +--- poppler/poppler/CairoFontEngine.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/poppler/CairoFontEngine.h 2022-09-16 16:27:41.762004500 +0300 +@@ -86,7 +86,7 @@ + private: + CairoFreeTypeFont(Ref ref, cairo_font_face_t *cairo_font_face, std::vector<int> &&codeToGID, bool substitute); + +- static std::optional<FreeTypeFontFace> getFreeTypeFontFace(CairoFontEngine *fontEngine, FT_Library lib, const std::string &filename, std::vector<unsigned char> &&data); ++ static boost::optional<FreeTypeFontFace> getFreeTypeFontFace(CairoFontEngine *fontEngine, FT_Library lib, const std::string &filename, std::vector<unsigned char> &&data); + }; + + //------------------------------------------------------------------------ +@@ -120,7 +120,7 @@ + + std::shared_ptr<CairoFont> getFont(const std::shared_ptr<GfxFont> &gfxFont, PDFDoc *doc, bool printing, XRef *xref); + +- static std::optional<FreeTypeFontFace> getExternalFontFace(FT_Library ftlib, const std::string &filename); ++ static boost::optional<FreeTypeFontFace> getExternalFontFace(FT_Library ftlib, const std::string &filename); + + private: + FT_Library lib; +diff -ur poppler/poppler/CairoOutputDev.h poppler/poppler/CairoOutputDev.h +--- poppler/poppler/CairoOutputDev.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/poppler/CairoOutputDev.h 2022-09-16 16:27:41.877862600 +0300 +@@ -300,7 +300,7 @@ + bool setMimeDataForCCITTParams(Stream *str, cairo_surface_t *image, int height); + #endif + +- std::optional<GfxRGB> fill_color, stroke_color; ++ boost::optional<GfxRGB> fill_color, stroke_color; + cairo_pattern_t *fill_pattern, *stroke_pattern; + double fill_opacity; + double stroke_opacity; +diff -ur poppler/poppler/Catalog.cc poppler/poppler/Catalog.cc +--- poppler/poppler/Catalog.cc 2022-09-16 21:58:40.110102500 +0300 ++++ poppler/poppler/Catalog.cc 2022-09-16 16:32:32.360067100 +0300 +@@ -71,7 +71,7 @@ + // Catalog + //------------------------------------------------------------------------ + +-#define catalogLocker() const std::scoped_lock locker(mutex) ++#define catalogLocker() std::unique_lock<std::recursive_mutex> locker(mutex) + + Catalog::Catalog(PDFDoc *docA) + { +diff -ur poppler/poppler/Catalog.h poppler/poppler/Catalog.h +--- poppler/poppler/Catalog.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/poppler/Catalog.h 2022-09-16 16:29:19.213406500 +0300 +@@ -47,7 +47,7 @@ + #include "Link.h" + + #include <memory> +-#include <optional> ++#include <boost/optional.hpp> + #include <vector> + + class PDFDoc; +@@ -133,7 +133,7 @@ + Ref *getPageRef(int i); + + // Return base URI, or NULL if none. +- const std::optional<std::string> &getBaseURI() const { return baseURI; } ++ const boost::optional<std::string> &getBaseURI() const { return baseURI; } + + // Return the contents of the metadata stream, or NULL if there is + // no metadata. +@@ -289,7 +289,7 @@ + NameTree *destNameTree; // named destination name-tree + NameTree *embeddedFileNameTree; // embedded file name-tree + NameTree *jsNameTree; // Java Script name-tree +- std::optional<std::string> baseURI; // base URI for URI-type links ++ boost::optional<std::string> baseURI; // base URI for URI-type links + Object metadata; // metadata stream + StructTreeRoot *structTreeRoot; // structure tree root + unsigned int markInfo; // Flags from MarkInfo dictionary +diff -ur poppler/poppler/CharCodeToUnicode.cc poppler/poppler/CharCodeToUnicode.cc +--- poppler/poppler/CharCodeToUnicode.cc 2022-09-16 21:58:40.210089400 +0300 ++++ poppler/poppler/CharCodeToUnicode.cc 2022-09-16 16:27:42.231876900 +0300 +@@ -263,7 +263,7 @@ + { + CharCodeToUnicode *ctu; + +- ctu = new CharCodeToUnicode(std::optional<std::string>()); ++ ctu = new CharCodeToUnicode(boost::optional<std::string>()); + const char *p = buf->c_str(); + if (!ctu->parseCMap1(&getCharFromString, &p, nBits)) { + delete ctu; +@@ -277,7 +277,7 @@ + CharCodeToUnicode *ctu; + FILE *f; + +- ctu = new CharCodeToUnicode(std::optional<std::string>()); ++ ctu = new CharCodeToUnicode(boost::optional<std::string>()); + if ((f = globalParams->findToUnicodeFile(fileName))) { + if (!ctu->parseCMap1(&getCharFromFile, f, nBits)) { + delete ctu; +@@ -567,7 +567,7 @@ + isIdentity = false; + } + +-CharCodeToUnicode::CharCodeToUnicode(const std::optional<std::string> &tagA) : tag(tagA) ++CharCodeToUnicode::CharCodeToUnicode(const boost::optional<std::string> &tagA) : tag(tagA) + { + CharCode i; + +@@ -582,7 +582,7 @@ + isIdentity = false; + } + +-CharCodeToUnicode::CharCodeToUnicode(const std::optional<std::string> &tagA, Unicode *mapA, CharCode mapLenA, bool copyMap, CharCodeToUnicodeString *sMapA, int sMapLenA, int sMapSizeA) : tag(tagA) ++CharCodeToUnicode::CharCodeToUnicode(const boost::optional<std::string> &tagA, Unicode *mapA, CharCode mapLenA, bool copyMap, CharCodeToUnicodeString *sMapA, int sMapLenA, int sMapSizeA) : tag(tagA) + { + mapLen = mapLenA; + if (copyMap) { +diff -ur poppler/poppler/CharCodeToUnicode.h poppler/poppler/CharCodeToUnicode.h +--- poppler/poppler/CharCodeToUnicode.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/poppler/CharCodeToUnicode.h 2022-09-16 16:29:25.010173300 +0300 +@@ -32,7 +32,7 @@ + #define CHARCODETOUNICODE_H + + #include <atomic> +-#include <optional> ++#include <boost/optional.hpp> + + #include "poppler-config.h" + #include "CharTypes.h" +@@ -104,10 +104,10 @@ + void addMapping(CharCode code, char *uStr, int n, int offset); + void addMappingInt(CharCode code, Unicode u); + CharCodeToUnicode(); +- explicit CharCodeToUnicode(const std::optional<std::string> &tagA); +- CharCodeToUnicode(const std::optional<std::string> &tagA, Unicode *mapA, CharCode mapLenA, bool copyMap, CharCodeToUnicodeString *sMapA, int sMapLenA, int sMapSizeA); ++ explicit CharCodeToUnicode(const boost::optional<std::string> &tagA); ++ CharCodeToUnicode(const boost::optional<std::string> &tagA, Unicode *mapA, CharCode mapLenA, bool copyMap, CharCodeToUnicodeString *sMapA, int sMapLenA, int sMapSizeA); + +- const std::optional<std::string> tag; ++ const boost::optional<std::string> tag; + Unicode *map; + CharCode mapLen; + CharCodeToUnicodeString *sMap; +diff -ur poppler/poppler/CurlPDFDocBuilder.cc poppler/poppler/CurlPDFDocBuilder.cc +--- poppler/poppler/CurlPDFDocBuilder.cc 2022-09-16 21:58:40.396392700 +0300 ++++ poppler/poppler/CurlPDFDocBuilder.cc 2022-09-16 16:27:43.096494100 +0300 +@@ -22,7 +22,7 @@ + // CurlPDFDocBuilder + //------------------------------------------------------------------------ + +-std::unique_ptr<PDFDoc> CurlPDFDocBuilder::buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, void *guiDataA) ++std::unique_ptr<PDFDoc> CurlPDFDocBuilder::buildPDFDoc(const GooString &uri, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword, void *guiDataA) + { + CachedFile *cachedFile = new CachedFile(new CurlCachedFileLoader(uri.toStr())); + +diff -ur poppler/poppler/CurlPDFDocBuilder.h poppler/poppler/CurlPDFDocBuilder.h +--- poppler/poppler/CurlPDFDocBuilder.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/poppler/CurlPDFDocBuilder.h 2022-09-16 16:27:43.181172700 +0300 +@@ -25,7 +25,7 @@ + { + + public: +- std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr) override; ++ std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const boost::optional<GooString> &ownerPassword = {}, const boost::optional<GooString> &userPassword = {}, void *guiDataA = nullptr) override; + bool supports(const GooString &uri) override; + }; + +diff -ur poppler/poppler/Dict.cc poppler/poppler/Dict.cc +--- poppler/poppler/Dict.cc 2022-09-16 21:58:40.594972000 +0300 ++++ poppler/poppler/Dict.cc 2022-09-16 16:32:36.347348700 +0300 +@@ -40,7 +40,7 @@ + // Dict + //------------------------------------------------------------------------ + +-#define dictLocker() const std::scoped_lock locker(mutex) ++#define dictLocker() std::unique_lock<std::recursive_mutex> locker(mutex) + + constexpr int SORT_LENGTH_LOWER_LIMIT = 32; + +diff -ur poppler/poppler/FDPDFDocBuilder.cc poppler/poppler/FDPDFDocBuilder.cc +--- poppler/poppler/FDPDFDocBuilder.cc 2022-09-16 21:58:40.665573300 +0300 ++++ poppler/poppler/FDPDFDocBuilder.cc 2022-09-16 16:27:43.914144400 +0300 +@@ -34,7 +34,7 @@ + return fd; + } + +-std::unique_ptr<PDFDoc> FileDescriptorPDFDocBuilder::buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, void *guiDataA) ++std::unique_ptr<PDFDoc> FileDescriptorPDFDocBuilder::buildPDFDoc(const GooString &uri, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword, void *guiDataA) + { + const auto fd = parseFdFromUri(uri); + if (fd == -1) { +diff -ur poppler/poppler/FDPDFDocBuilder.h poppler/poppler/FDPDFDocBuilder.h +--- poppler/poppler/FDPDFDocBuilder.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/poppler/FDPDFDocBuilder.h 2022-09-16 16:27:43.951956600 +0300 +@@ -26,7 +26,7 @@ + { + + public: +- std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr) override; ++ std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const boost::optional<GooString> &ownerPassword = {}, const boost::optional<GooString> &userPassword = {}, void *guiDataA = nullptr) override; + bool supports(const GooString &uri) override; + + private: +diff -ur poppler/poppler/FontInfo.cc poppler/poppler/FontInfo.cc +--- poppler/poppler/FontInfo.cc 2022-09-16 21:58:40.995479200 +0300 ++++ poppler/poppler/FontInfo.cc 2022-09-16 16:27:44.484360100 +0300 +@@ -165,7 +165,7 @@ + fontRef = *font->getID(); + + // font name +- const std::optional<std::string> &origName = font->getName(); ++ const boost::optional<std::string> &origName = font->getName(); + if (origName) { + name = *font->getName(); + } +diff -ur poppler/poppler/FontInfo.h poppler/poppler/FontInfo.h +--- poppler/poppler/FontInfo.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/poppler/FontInfo.h 2022-09-16 16:29:28.697082100 +0300 +@@ -30,7 +30,7 @@ + #include "Object.h" + #include "poppler_private_export.h" + +-#include <optional> ++#include <boost/optional.hpp> + #include <string> + #include <unordered_set> + +@@ -63,9 +63,9 @@ + + FontInfo &operator=(const FontInfo &) = delete; + +- const std::optional<std::string> &getName() const { return name; }; +- const std::optional<std::string> &getSubstituteName() const { return substituteName; }; +- const std::optional<std::string> &getFile() const { return file; }; ++ const boost::optional<std::string> &getName() const { return name; }; ++ const boost::optional<std::string> &getSubstituteName() const { return substituteName; }; ++ const boost::optional<std::string> &getFile() const { return file; }; + const std::string &getEncoding() const { return encoding; }; + Type getType() const { return type; }; + bool getEmbedded() const { return emb; }; +@@ -75,9 +75,9 @@ + Ref getEmbRef() const { return embRef; }; + + private: +- std::optional<std::string> name; +- std::optional<std::string> substituteName; +- std::optional<std::string> file; ++ boost::optional<std::string> name; ++ boost::optional<std::string> substituteName; ++ boost::optional<std::string> file; + std::string encoding; + Type type; + bool emb; +diff -ur poppler/poppler/Form.cc poppler/poppler/Form.cc +--- poppler/poppler/Form.cc 2022-09-16 21:58:41.064544700 +0300 ++++ poppler/poppler/Form.cc 2022-09-16 16:27:44.615842800 +0300 +@@ -601,8 +601,8 @@ + } + #endif + +-bool FormWidgetSignature::signDocument(const char *saveFilename, const char *certNickname, const char *digestName, const char *password, const GooString *reason, const GooString *location, const std::optional<GooString> &ownerPassword, +- const std::optional<GooString> &userPassword) ++bool FormWidgetSignature::signDocument(const char *saveFilename, const char *certNickname, const char *digestName, const char *password, const GooString *reason, const GooString *location, const boost::optional<GooString> &ownerPassword, ++ const boost::optional<GooString> &userPassword) + { + #ifdef ENABLE_NSS3 + if (!certNickname) { +@@ -689,7 +689,7 @@ + } + + bool FormWidgetSignature::signDocumentWithAppearance(const char *saveFilename, const char *certNickname, const char *digestName, const char *password, const GooString *reason, const GooString *location, +- const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, const GooString &signatureText, const GooString &signatureTextLeft, double fontSize, ++ const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword, const GooString &signatureText, const GooString &signatureTextLeft, double fontSize, + double leftFontSize, std::unique_ptr<AnnotColor> &&fontColor, double borderWidth, std::unique_ptr<AnnotColor> &&borderColor, std::unique_ptr<AnnotColor> &&backgroundColor) + { + // Set the appearance +@@ -742,7 +742,7 @@ + } + + // Get start and end file position of objNum in the PDF named filename. +-bool FormWidgetSignature::getObjectStartEnd(const GooString &filename, int objNum, Goffset *objStart, Goffset *objEnd, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) ++bool FormWidgetSignature::getObjectStartEnd(const GooString &filename, int objNum, Goffset *objStart, Goffset *objEnd, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword) + { + PDFDoc newDoc(std::unique_ptr<GooString>(filename.copy()), ownerPassword, userPassword); + if (!newDoc.isOk()) { +@@ -905,7 +905,7 @@ + return static_cast<FormFieldSignature *>(field)->getSignedRangeBounds(); + } + +-std::optional<GooString> FormWidgetSignature::getCheckedSignature(Goffset *checkedFileSize) ++boost::optional<GooString> FormWidgetSignature::getCheckedSignature(Goffset *checkedFileSize) + { + return static_cast<FormFieldSignature *>(field)->getCheckedSignature(checkedFileSize); + } +@@ -2426,7 +2426,7 @@ + return range_vec; + } + +-std::optional<GooString> FormFieldSignature::getCheckedSignature(Goffset *checkedFileSize) ++boost::optional<GooString> FormFieldSignature::getCheckedSignature(Goffset *checkedFileSize) + { + Goffset start = 0; + Goffset end = 0; +diff -ur poppler/poppler/Form.h poppler/poppler/Form.h +--- poppler/poppler/Form.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/poppler/Form.h 2022-09-16 16:29:32.981221400 +0300 +@@ -40,7 +40,7 @@ + + #include <ctime> + +-#include <optional> ++#include <boost/optional.hpp> + #include <set> + #include <vector> + +@@ -307,24 +307,24 @@ + // field "ByteRange" in the dictionary "V". + // Arguments reason and location are UTF-16 big endian strings with BOM. An empty string and nullptr are acceptable too. + // Returns success. +- bool signDocument(const char *filename, const char *certNickname, const char *digestName, const char *password, const GooString *reason = nullptr, const GooString *location = nullptr, const std::optional<GooString> &ownerPassword = {}, +- const std::optional<GooString> &userPassword = {}); ++ bool signDocument(const char *filename, const char *certNickname, const char *digestName, const char *password, const GooString *reason = nullptr, const GooString *location = nullptr, const boost::optional<GooString> &ownerPassword = {}, ++ const boost::optional<GooString> &userPassword = {}); + + // Same as above but adds text, font color, etc. + bool signDocumentWithAppearance(const char *filename, const char *certNickname, const char *digestName, const char *password, const GooString *reason = nullptr, const GooString *location = nullptr, +- const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, const GooString &signatureText = {}, const GooString &signatureTextLeft = {}, double fontSize = {}, ++ const boost::optional<GooString> &ownerPassword = {}, const boost::optional<GooString> &userPassword = {}, const GooString &signatureText = {}, const GooString &signatureTextLeft = {}, double fontSize = {}, + double leftFontSize = {}, std::unique_ptr<AnnotColor> &&fontColor = {}, double borderWidth = {}, std::unique_ptr<AnnotColor> &&borderColor = {}, std::unique_ptr<AnnotColor> &&backgroundColor = {}); + + // checks the length encoding of the signature and returns the hex encoded signature + // if the check passed (and the checked file size as output parameter in checkedFileSize) + // otherwise a nullptr is returned +- std::optional<GooString> getCheckedSignature(Goffset *checkedFileSize); ++ boost::optional<GooString> getCheckedSignature(Goffset *checkedFileSize); + + const GooString *getSignature() const; + + private: + bool createSignature(Object &vObj, Ref vRef, const GooString &name, const GooString *signature, const GooString *reason = nullptr, const GooString *location = nullptr); +- bool getObjectStartEnd(const GooString &filename, int objNum, Goffset *objStart, Goffset *objEnd, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword); ++ bool getObjectStartEnd(const GooString &filename, int objNum, Goffset *objStart, Goffset *objEnd, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword); + bool updateOffsets(FILE *f, Goffset objStart, Goffset objEnd, Goffset *sigStart, Goffset *sigEnd, Goffset *fileSize); + + bool updateSignature(FILE *f, Goffset sigStart, Goffset sigEnd, const GooString *signature); +@@ -611,7 +611,7 @@ + // checks the length encoding of the signature and returns the hex encoded signature + // if the check passed (and the checked file size as output parameter in checkedFileSize) + // otherwise a nullptr is returned +- std::optional<GooString> getCheckedSignature(Goffset *checkedFileSize); ++ boost::optional<GooString> getCheckedSignature(Goffset *checkedFileSize); + + ~FormFieldSignature() override; + Object *getByteRange() { return &byte_range; } +diff -ur poppler/poppler/GfxFont.cc poppler/poppler/GfxFont.cc +--- poppler/poppler/GfxFont.cc 2022-09-16 21:58:41.211684900 +0300 ++++ poppler/poppler/GfxFont.cc 2022-09-16 16:27:45.016943600 +0300 +@@ -199,7 +199,7 @@ + + std::unique_ptr<GfxFont> GfxFont::makeFont(XRef *xref, const char *tagA, Ref idA, Dict *fontDict) + { +- std::optional<std::string> name; ++ boost::optional<std::string> name; + Ref embFontIDA; + GfxFontType typeA; + +@@ -223,7 +223,7 @@ + return std::unique_ptr<GfxFont>(font); + } + +-GfxFont::GfxFont(const char *tagA, Ref idA, std::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA) : tag(tagA), id(idA), name(std::move(nameA)), type(typeA) ++GfxFont::GfxFont(const char *tagA, Ref idA, boost::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA) : tag(tagA), id(idA), name(std::move(nameA)), type(typeA) + { + ok = false; + embFontID = embFontIDA; +@@ -608,7 +608,7 @@ + return ctu; + } + +-std::optional<GfxFontLoc> GfxFont::locateFont(XRef *xref, PSOutputDev *ps) ++boost::optional<GfxFontLoc> GfxFont::locateFont(XRef *xref, PSOutputDev *ps) + { + SysFontType sysFontType; + GooString *path, *base14Name; +@@ -616,7 +616,7 @@ + bool embed; + + if (type == fontType3) { +- return std::nullopt; ++ return boost::none; + } + + //----- embedded font +@@ -682,7 +682,7 @@ + + //----- external font file (fontFile, fontDir) + if (name && (path = globalParams->findFontFile(*name))) { +- if (std::optional<GfxFontLoc> fontLoc = getExternalFont(path, isCIDFont())) { ++ if (boost::optional<GfxFontLoc> fontLoc = getExternalFont(path, isCIDFont())) { + return fontLoc; + } + } +@@ -691,7 +691,7 @@ + if (!ps && !isCIDFont() && ((Gfx8BitFont *)this)->base14) { + base14Name = new GooString(((Gfx8BitFont *)this)->base14->base14Name); + if ((path = globalParams->findBase14FontFile(base14Name, this))) { +- if (std::optional<GfxFontLoc> fontLoc = getExternalFont(path, false)) { ++ if (boost::optional<GfxFontLoc> fontLoc = getExternalFont(path, false)) { + delete base14Name; + return fontLoc; + } +@@ -753,7 +753,7 @@ + } else { + path = globalParams->findFontFile(substName); + if (path) { +- if (std::optional<GfxFontLoc> fontLoc = getExternalFont(path, false)) { ++ if (boost::optional<GfxFontLoc> fontLoc = getExternalFont(path, false)) { + error(errSyntaxWarning, -1, "Substituting font '{0:s}' for '{1:s}'", base14SubstFonts[substIdx], name ? name->c_str() : ""); + name = base14SubstFonts[substIdx]; + fontLoc->substIdx = substIdx; +@@ -763,14 +763,14 @@ + } + + // failed to find a substitute font +- return std::nullopt; ++ return boost::none; + } + + // failed to find a substitute font +- return std::nullopt; ++ return boost::none; + } + +-std::optional<GfxFontLoc> GfxFont::getExternalFont(GooString *path, bool cid) ++boost::optional<GfxFontLoc> GfxFont::getExternalFont(GooString *path, bool cid) + { + FoFiIdentifierType fft; + GfxFontType fontType; +@@ -805,7 +805,7 @@ + } + if (fontType == fontUnknownType || (cid ? (fontType < fontCIDType0) : (fontType >= fontCIDType0))) { + delete path; +- return std::nullopt; ++ return boost::none; + } + GfxFontLoc fontLoc; + fontLoc.locType = gfxFontLocExternal; +@@ -814,7 +814,7 @@ + return std::move(fontLoc); // std::move only required to please g++-7 + } + +-std::optional<std::vector<unsigned char>> GfxFont::readEmbFontFile(XRef *xref) ++boost::optional<std::vector<unsigned char>> GfxFont::readEmbFontFile(XRef *xref) + { + Stream *str; + +@@ -942,7 +942,7 @@ + return numeric; + } + +-Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, std::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA, Dict *fontDict) : GfxFont(tagA, idA, std::move(nameA), typeA, embFontIDA) ++Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, boost::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA, Dict *fontDict) : GfxFont(tagA, idA, std::move(nameA), typeA, embFontIDA) + { + const BuiltinFont *builtinFont; + const char **baseEnc; +@@ -1117,7 +1117,7 @@ + ffT1 = nullptr; + ffT1C = nullptr; + if (type == fontType1 && embFontID != Ref::INVALID()) { +- const std::optional<std::vector<unsigned char>> buf = readEmbFontFile(xref); ++ const boost::optional<std::vector<unsigned char>> buf = readEmbFontFile(xref); + if (buf) { + if ((ffT1 = FoFiType1::make(buf->data(), buf->size()))) { + if (ffT1->getName()) { +@@ -1133,7 +1133,7 @@ + } + } + } else if (type == fontType1C && embFontID != Ref::INVALID()) { +- const std::optional<std::vector<unsigned char>> buf = readEmbFontFile(xref); ++ const boost::optional<std::vector<unsigned char>> buf = readEmbFontFile(xref); + if (buf) { + if ((ffT1C = FoFiType1C::make(buf->data(), buf->size()))) { + if (ffT1C->getName()) { +@@ -1707,7 +1707,7 @@ + bool operator()(const GfxFontCIDWidthExcepV &w1, const GfxFontCIDWidthExcepV &w2) { return w1.first < w2.first; } + }; + +-GfxCIDFont::GfxCIDFont(XRef *xref, const char *tagA, Ref idA, std::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA, Dict *fontDict) : GfxFont(tagA, idA, std::move(nameA), typeA, embFontIDA) ++GfxCIDFont::GfxCIDFont(XRef *xref, const char *tagA, Ref idA, boost::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA, Dict *fontDict) : GfxFont(tagA, idA, std::move(nameA), typeA, embFontIDA) + { + Dict *desFontDict; + Object desFontDictObj; +diff -ur poppler/poppler/GfxFont.h poppler/poppler/GfxFont.h +--- poppler/poppler/GfxFont.h 2022-09-16 21:58:36.928310000 +0300 ++++ poppler/poppler/GfxFont.h 2022-09-16 16:29:36.703166800 +0300 +@@ -35,7 +35,7 @@ + #define GFXFONT_H + + #include <memory> +-#include <optional> ++#include <boost/optional.hpp> + + #include "goo/GooString.h" + #include "Object.h" +@@ -216,7 +216,7 @@ + + // Get the original font name (ignornig any munging that might have + // been done to map to a canonical Base-14 font name). +- const std::optional<std::string> &getName() const { return name; } ++ const boost::optional<std::string> &getName() const { return name; } + + bool isSubset() const; + +@@ -275,11 +275,11 @@ + virtual int getWMode() const { return 0; } + + // Locate the font file for this font. If <ps> is not null, includes PS +- // printer-resident fonts. Returns std::optional without a value on failure. +- std::optional<GfxFontLoc> locateFont(XRef *xref, PSOutputDev *ps); ++ // printer-resident fonts. Returns boost::optional without a value on failure. ++ boost::optional<GfxFontLoc> locateFont(XRef *xref, PSOutputDev *ps); + + // Read an external or embedded font file into a buffer. +- std::optional<std::vector<unsigned char>> readEmbFontFile(XRef *xref); ++ boost::optional<std::vector<unsigned char>> readEmbFontFile(XRef *xref); + + // Get the next char from a string <s> of <len> bytes, returning the + // char <code>, its Unicode mapping <u>, its displacement vector +@@ -301,16 +301,16 @@ + static const char *getAlternateName(const char *name); + + protected: +- GfxFont(const char *tagA, Ref idA, std::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA); ++ GfxFont(const char *tagA, Ref idA, boost::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA); + + static GfxFontType getFontType(XRef *xref, Dict *fontDict, Ref *embID); + void readFontDescriptor(XRef *xref, Dict *fontDict); + CharCodeToUnicode *readToUnicodeCMap(Dict *fontDict, int nBits, CharCodeToUnicode *ctu); +- static std::optional<GfxFontLoc> getExternalFont(GooString *path, bool cid); ++ static boost::optional<GfxFontLoc> getExternalFont(GooString *path, bool cid); + + const std::string tag; // PDF font tag + const Ref id; // reference (used as unique ID) +- std::optional<std::string> name; // font name ++ boost::optional<std::string> name; // font name + GooString *family; // font family + Stretch stretch; // font stretch + Weight weight; // font weight +@@ -335,7 +335,7 @@ + class POPPLER_PRIVATE_EXPORT Gfx8BitFont : public GfxFont + { + public: +- Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, std::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA, Dict *fontDict); ++ Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, boost::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA, Dict *fontDict); + + int getNextChar(const char *s, int len, CharCode *code, Unicode const **u, int *uLen, double *dx, double *dy, double *ox, double *oy) const override; + +@@ -395,7 +395,7 @@ + class POPPLER_PRIVATE_EXPORT GfxCIDFont : public GfxFont + { + public: +- GfxCIDFont(XRef *xref, const char *tagA, Ref idA, std::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA, Dict *fontDict); ++ GfxCIDFont(XRef *xref, const char *tagA, Ref idA, boost::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA, Dict *fontDict); + + bool isCIDFont() const override { return true; } + +diff -ur poppler/poppler/GlobalParams.cc poppler/poppler/GlobalParams.cc +--- poppler/poppler/GlobalParams.cc 2022-09-16 21:58:41.327712200 +0300 ++++ poppler/poppler/GlobalParams.cc 2022-09-16 16:36:52.853893500 +0300 +@@ -395,9 +395,9 @@ + return fi; + } + +-#define globalParamsLocker() const std::scoped_lock locker(mutex) +-#define unicodeMapCacheLocker() const std::scoped_lock locker(unicodeMapCacheMutex) +-#define cMapCacheLocker() const std::scoped_lock locker(cMapCacheMutex) ++#define globalParamsLocker() std::unique_lock<std::recursive_mutex> locker(mutex) ++#define unicodeMapCacheLocker() std::unique_lock<std::recursive_mutex> locker(unicodeMapCacheMutex) ++#define cMapCacheLocker() std::unique_lock<std::recursive_mutex> locker(cMapCacheMutex) + + //------------------------------------------------------------------------ + // parsing +@@ -953,7 +953,7 @@ + const SysFontInfo *fi = nullptr; + FcPattern *p = nullptr; + GooString *path = nullptr; +- const std::optional<std::string> &fontName = font->getName(); ++ const boost::optional<std::string> &fontName = font->getName(); + GooString substituteName; + if (!fontName) { + return nullptr; +@@ -1267,7 +1267,7 @@ + const SysFontInfo *fi; + GooString *path; + +- const std::optional<std::string> &fontName = font->getName(); ++ const boost::optional<std::string> &fontName = font->getName(); + if (!fontName) + return nullptr; + +@@ -1406,7 +1406,7 @@ + + GlobalParamsIniter::GlobalParamsIniter(ErrorCallback errorCallback) + { +- const std::scoped_lock lock { mutex }; ++ std::lock_guard<std::mutex> lock { mutex }; + + if (count == 0) { + globalParams = std::make_unique<GlobalParams>(!customDataDir.empty() ? customDataDir.c_str() : nullptr); +@@ -1419,7 +1419,7 @@ + + GlobalParamsIniter::~GlobalParamsIniter() + { +- const std::scoped_lock lock { mutex }; ++ std::lock_guard<std::mutex> lock { mutex }; + + --count; + +@@ -1430,7 +1430,7 @@ + + bool GlobalParamsIniter::setCustomDataDir(const std::string &dir) + { +- const std::scoped_lock lock { mutex }; ++ std::lock_guard<std::mutex> lock { mutex }; + + if (count == 0) { + customDataDir = dir; +diff -ur poppler/poppler/GlobalParamsWin.cc poppler/poppler/GlobalParamsWin.cc +--- poppler/poppler/GlobalParamsWin.cc 2022-09-16 21:58:41.381093500 +0300 ++++ poppler/poppler/GlobalParamsWin.cc 2022-09-16 16:33:34.090528600 +0300 +@@ -467,10 +467,10 @@ + { + const SysFontInfo *fi; + GooString *path = nullptr; +- const std::optional<std::string> &fontName = font->getName(); ++ const boost::optional<std::string> &fontName = font->getName(); + if (!fontName) + return nullptr; +- const std::scoped_lock locker(mutex); ++ std::unique_lock<std::recursive_mutex> locker(mutex); + setupBaseFonts(POPPLER_FONTSDIR); + + // TODO: base14Name should be changed? +@@ -505,7 +505,7 @@ + + FamilyStyleFontSearchResult GlobalParams::findSystemFontFileForFamilyAndStyle(const std::string &fontFamily, const std::string &fontStyle) + { +- const std::scoped_lock locker(mutex); ++ std::unique_lock<std::recursive_mutex> locker(mutex); + setupBaseFonts(POPPLER_FONTSDIR); + + const std::string familyAndStyle = fontFamily + " " + fontStyle; +@@ -520,7 +520,7 @@ + + UCharFontSearchResult GlobalParams::findSystemFontFileForUChar(Unicode uChar, const GfxFont &fontToEmulate) + { +- const std::scoped_lock locker(mutex); ++ std::unique_lock<std::recursive_mutex> locker(mutex); + setupBaseFonts(POPPLER_FONTSDIR); + + const std::vector<SysFontInfo *> &fonts = sysFonts->getFonts(); +diff -ur poppler/poppler/Link.cc poppler/poppler/Link.cc +--- poppler/poppler/Link.cc 2022-09-16 21:58:41.835750600 +0300 ++++ poppler/poppler/Link.cc 2022-09-16 16:27:46.843405900 +0300 +@@ -63,13 +63,13 @@ + return action; + } + +-std::unique_ptr<LinkAction> LinkAction::parseAction(const Object *obj, const std::optional<std::string> &baseURI) ++std::unique_ptr<LinkAction> LinkAction::parseAction(const Object *obj, const boost::optional<std::string> &baseURI) + { + std::set<int> seenNextActions; + return parseAction(obj, baseURI, &seenNextActions); + } + +-std::unique_ptr<LinkAction> LinkAction::parseAction(const Object *obj, const std::optional<std::string> &baseURI, std::set<int> *seenNextActions) ++std::unique_ptr<LinkAction> LinkAction::parseAction(const Object *obj, const boost::optional<std::string> &baseURI, std::set<int> *seenNextActions) + { + + if (!obj->isDict()) { +@@ -513,7 +513,7 @@ + // LinkURI + //------------------------------------------------------------------------ + +-LinkURI::LinkURI(const Object *uriObj, const std::optional<std::string> &baseURI) ++LinkURI::LinkURI(const Object *uriObj, const boost::optional<std::string> &baseURI) + { + hasURIFlag = false; + if (uriObj->isString()) { +diff -ur poppler/poppler/Link.h poppler/poppler/Link.h +--- poppler/poppler/Link.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/poppler/Link.h 2022-09-16 16:28:57.630770800 +0300 +@@ -35,7 +35,7 @@ + #include "Object.h" + #include "poppler_private_export.h" + #include <memory> +-#include <optional> ++#include <boost/optional.hpp> + #include <set> + + class GooString; +@@ -87,13 +87,13 @@ + static std::unique_ptr<LinkAction> parseDest(const Object *obj); + + // Parse an action dictionary. +- static std::unique_ptr<LinkAction> parseAction(const Object *obj, const std::optional<std::string> &baseURI = {}); ++ static std::unique_ptr<LinkAction> parseAction(const Object *obj, const boost::optional<std::string> &baseURI = {}); + + // A List of the next actions to execute in order. + const std::vector<std::unique_ptr<LinkAction>> &nextActions() const; + + private: +- static std::unique_ptr<LinkAction> parseAction(const Object *obj, const std::optional<std::string> &baseURI, std::set<int> *seenNextActions); ++ static std::unique_ptr<LinkAction> parseAction(const Object *obj, const boost::optional<std::string> &baseURI, std::set<int> *seenNextActions); + + std::vector<std::unique_ptr<LinkAction>> nextActionList; + }; +@@ -243,7 +243,7 @@ + { + public: + // Build a LinkURI given the URI (string) and base URI. +- LinkURI(const Object *uriObj, const std::optional<std::string> &baseURI); ++ LinkURI(const Object *uriObj, const boost::optional<std::string> &baseURI); + + ~LinkURI() override; + +diff -ur poppler/poppler/LocalPDFDocBuilder.cc poppler/poppler/LocalPDFDocBuilder.cc +--- poppler/poppler/LocalPDFDocBuilder.cc 2022-09-16 21:58:41.867032500 +0300 ++++ poppler/poppler/LocalPDFDocBuilder.cc 2022-09-16 16:27:46.990572300 +0300 +@@ -18,7 +18,7 @@ + // LocalPDFDocBuilder + //------------------------------------------------------------------------ + +-std::unique_ptr<PDFDoc> LocalPDFDocBuilder::buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, void *guiDataA) ++std::unique_ptr<PDFDoc> LocalPDFDocBuilder::buildPDFDoc(const GooString &uri, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword, void *guiDataA) + { + if (uri.cmpN("file://", 7) == 0) { + std::unique_ptr<GooString> fileName(uri.copy()); +diff -ur poppler/poppler/LocalPDFDocBuilder.h poppler/poppler/LocalPDFDocBuilder.h +--- poppler/poppler/LocalPDFDocBuilder.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/poppler/LocalPDFDocBuilder.h 2022-09-16 16:27:47.037437500 +0300 +@@ -25,7 +25,7 @@ + { + + public: +- std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr) override; ++ std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const boost::optional<GooString> &ownerPassword = {}, const boost::optional<GooString> &userPassword = {}, void *guiDataA = nullptr) override; + bool supports(const GooString &uri) override; + }; + +diff -ur poppler/poppler/Page.cc poppler/poppler/Page.cc +--- poppler/poppler/Page.cc 2022-09-16 21:58:42.283721100 +0300 ++++ poppler/poppler/Page.cc 2022-09-16 16:33:42.958478900 +0300 +@@ -249,7 +249,7 @@ + // Page + //------------------------------------------------------------------------ + +-#define pageLocker() const std::scoped_lock locker(mutex) ++#define pageLocker() std::unique_lock<std::recursive_mutex> locker(mutex) + + Page::Page(PDFDoc *docA, int numA, Object &&pageDict, Ref pageRefA, PageAttrs *attrsA, Form *form) + { +diff -ur poppler/poppler/PDFDoc.cc poppler/poppler/PDFDoc.cc +--- poppler/poppler/PDFDoc.cc 2022-09-16 21:58:42.483511900 +0300 ++++ poppler/poppler/PDFDoc.cc 2022-09-16 16:33:47.447609100 +0300 +@@ -121,11 +121,11 @@ + // PDFDoc + //------------------------------------------------------------------------ + +-#define pdfdocLocker() const std::scoped_lock locker(mutex) ++#define pdfdocLocker() std::unique_lock<std::recursive_mutex> locker(mutex) + + PDFDoc::PDFDoc() { } + +-PDFDoc::PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, void *guiDataA, const std::function<void()> &xrefReconstructedCallback) ++PDFDoc::PDFDoc(std::unique_ptr<GooString> &&fileNameA, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword, void *guiDataA, const std::function<void()> &xrefReconstructedCallback) + : fileName(std::move(fileNameA)), guiData(guiDataA) + { + #ifdef _WIN32 +@@ -160,7 +160,7 @@ + } + + #ifdef _WIN32 +-PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, void *guiDataA, const std::function<void()> &xrefReconstructedCallback) : guiData(guiDataA) ++PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword, void *guiDataA, const std::function<void()> &xrefReconstructedCallback) : guiData(guiDataA) + { + OSVERSIONINFO version; + +@@ -196,7 +196,7 @@ + } + #endif + +-PDFDoc::PDFDoc(BaseStream *strA, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, void *guiDataA, const std::function<void()> &xrefReconstructedCallback) : guiData(guiDataA) ++PDFDoc::PDFDoc(BaseStream *strA, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword, void *guiDataA, const std::function<void()> &xrefReconstructedCallback) : guiData(guiDataA) + { + if (strA->getFileName()) { + fileName.reset(strA->getFileName()->copy()); +@@ -213,7 +213,7 @@ + ok = setup(ownerPassword, userPassword, xrefReconstructedCallback); + } + +-bool PDFDoc::setup(const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, const std::function<void()> &xrefReconstructedCallback) ++bool PDFDoc::setup(const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword, const std::function<void()> &xrefReconstructedCallback) + { + pdfdocLocker(); + +@@ -389,7 +389,7 @@ + // We don't do the version check. Don't add it back in. + } + +-bool PDFDoc::checkEncryption(const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) ++bool PDFDoc::checkEncryption(const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword) + { + bool encrypted; + bool ret; +@@ -2154,7 +2154,7 @@ + + bool PDFDoc::sign(const char *saveFilename, const char *certNickname, const char *password, GooString *partialFieldName, int page, const PDFRectangle &rect, const GooString &signatureText, const GooString &signatureTextLeft, + double fontSize, double leftFontSize, std::unique_ptr<AnnotColor> &&fontColor, double borderWidth, std::unique_ptr<AnnotColor> &&borderColor, std::unique_ptr<AnnotColor> &&backgroundColor, const GooString *reason, +- const GooString *location, const std::string &imagePath, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) ++ const GooString *location, const std::string &imagePath, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword) + { + ::Page *destPage = getPage(page); + if (destPage == nullptr) { +diff -ur poppler/poppler/PDFDoc.h poppler/poppler/PDFDoc.h +--- poppler/poppler/PDFDoc.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/poppler/PDFDoc.h 2022-09-16 16:27:48.425364000 +0300 +@@ -130,14 +130,14 @@ + class POPPLER_PRIVATE_EXPORT PDFDoc + { + public: +- explicit PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, ++ explicit PDFDoc(std::unique_ptr<GooString> &&fileNameA, const boost::optional<GooString> &ownerPassword = {}, const boost::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, + const std::function<void()> &xrefReconstructedCallback = {}); + + #ifdef _WIN32 +- PDFDoc(wchar_t *fileNameA, int fileNameLen, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, const std::function<void()> &xrefReconstructedCallback = {}); ++ PDFDoc(wchar_t *fileNameA, int fileNameLen, const boost::optional<GooString> &ownerPassword = {}, const boost::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, const std::function<void()> &xrefReconstructedCallback = {}); + #endif + +- explicit PDFDoc(BaseStream *strA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, const std::function<void()> &xrefReconstructedCallback = {}); ++ explicit PDFDoc(BaseStream *strA, const boost::optional<GooString> &ownerPassword = {}, const boost::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, const std::function<void()> &xrefReconstructedCallback = {}); + ~PDFDoc(); + + PDFDoc(const PDFDoc &) = delete; +@@ -493,7 +493,7 @@ + // sign() takes ownership of partialFieldName. + bool sign(const char *saveFilename, const char *certNickname, const char *password, GooString *partialFieldName, int page, const PDFRectangle &rect, const GooString &signatureText, const GooString &signatureTextLeft, double fontSize, + double leftFontSize, std::unique_ptr<AnnotColor> &&fontColor, double borderWidth, std::unique_ptr<AnnotColor> &&borderColor, std::unique_ptr<AnnotColor> &&backgroundColor, const GooString *reason = nullptr, +- const GooString *location = nullptr, const std::string &imagePath = "", const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}); ++ const GooString *location = nullptr, const std::string &imagePath = "", const boost::optional<GooString> &ownerPassword = {}, const boost::optional<GooString> &userPassword = {}); + + private: + // insert referenced objects in XRef +@@ -526,10 +526,10 @@ + Hints *getHints(); + + PDFDoc(); +- bool setup(const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, const std::function<void()> &xrefReconstructedCallback); ++ bool setup(const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword, const std::function<void()> &xrefReconstructedCallback); + bool checkFooter(); + void checkHeader(); +- bool checkEncryption(const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword); ++ bool checkEncryption(const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword); + void extractPDFSubtype(); + + // Get the offset of the start xref table. +diff -ur poppler/poppler/PDFDocBuilder.h poppler/poppler/PDFDocBuilder.h +--- poppler/poppler/PDFDocBuilder.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/poppler/PDFDocBuilder.h 2022-09-16 16:27:48.525644000 +0300 +@@ -38,7 +38,7 @@ + // Builds a new PDFDoc. Returns a PDFDoc. You should check this PDFDoc + // with PDFDoc::isOk() for failures. + // The caller is responsible for deleting ownerPassword, userPassWord and guiData. +- virtual std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr) = 0; ++ virtual std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const boost::optional<GooString> &ownerPassword = {}, const boost::optional<GooString> &userPassword = {}, void *guiDataA = nullptr) = 0; + + // Returns true if the builder supports building a PDFDoc from the URI. + virtual bool supports(const GooString &uri) = 0; +diff -ur poppler/poppler/PDFDocFactory.cc poppler/poppler/PDFDocFactory.cc +--- poppler/poppler/PDFDocFactory.cc 2022-09-16 21:58:42.630812800 +0300 ++++ poppler/poppler/PDFDocFactory.cc 2022-09-16 16:27:48.663754200 +0300 +@@ -54,7 +54,7 @@ + } + } + +-std::unique_ptr<PDFDoc> PDFDocFactory::createPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, void *guiDataA) ++std::unique_ptr<PDFDoc> PDFDocFactory::createPDFDoc(const GooString &uri, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword, void *guiDataA) + { + for (int i = builders->size() - 1; i >= 0; i--) { + PDFDocBuilder *builder = (*builders)[i]; +diff -ur poppler/poppler/PDFDocFactory.h poppler/poppler/PDFDocFactory.h +--- poppler/poppler/PDFDocFactory.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/poppler/PDFDocFactory.h 2022-09-16 16:27:48.748339700 +0300 +@@ -46,7 +46,7 @@ + // Create a PDFDoc. Returns a PDFDoc. You should check this PDFDoc + // with PDFDoc::isOk() for failures. + // The caller is responsible for deleting ownerPassword, userPassWord and guiData. +- std::unique_ptr<PDFDoc> createPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr); ++ std::unique_ptr<PDFDoc> createPDFDoc(const GooString &uri, const boost::optional<GooString> &ownerPassword = {}, const boost::optional<GooString> &userPassword = {}, void *guiDataA = nullptr); + + // Extend supported URIs with the ones from the PDFDocBuilder. + void registerPDFDocBuilder(PDFDocBuilder *pdfDocBuilder); +diff -ur poppler/poppler/PSOutputDev.cc poppler/poppler/PSOutputDev.cc +--- poppler/poppler/PSOutputDev.cc 2022-09-16 21:58:42.831194900 +0300 ++++ poppler/poppler/PSOutputDev.cc 2022-09-16 16:27:49.196271400 +0300 +@@ -1979,7 +1979,7 @@ + psName = GooString::format("T3_{0:d}_{1:d}", font->getID()->num, font->getID()->gen).release(); + setupType3Font(font, psName, parentResDict); + } else { +- std::optional<GfxFontLoc> fontLoc = font->locateFont(xref, this); ++ boost::optional<GfxFontLoc> fontLoc = font->locateFont(xref, this); + if (fontLoc) { + switch (fontLoc->locType) { + case gfxFontLocEmbedded: +@@ -2395,7 +2395,7 @@ + embFontList->append("\n"); + + // convert it to a Type 1 font +- const std::optional<std::vector<unsigned char>> fontBuf = font->readEmbFontFile(xref); ++ const boost::optional<std::vector<unsigned char>> fontBuf = font->readEmbFontFile(xref); + if (fontBuf) { + if ((ffT1C = FoFiType1C::make(fontBuf->data(), fontBuf->size()))) { + ffT1C->convertToType1(psName->c_str(), nullptr, true, outputFunc, outputStream); +@@ -2434,7 +2434,7 @@ + embFontList->append("\n"); + + // convert it to a Type 1 font +- const std::optional<std::vector<unsigned char>> fontBuf = font->readEmbFontFile(xref); ++ const boost::optional<std::vector<unsigned char>> fontBuf = font->readEmbFontFile(xref); + if (fontBuf) { + if (std::unique_ptr<FoFiTrueType> ffTT = FoFiTrueType::make(fontBuf->data(), fontBuf->size())) { + if (ffTT->isOpenTypeCFF()) { +@@ -2458,7 +2458,7 @@ + embFontList->append("\n"); + + // convert it to a Type 42 font +- const std::optional<std::vector<unsigned char>> fontBuf = font->readEmbFontFile(xref); ++ const boost::optional<std::vector<unsigned char>> fontBuf = font->readEmbFontFile(xref); + if (fontBuf) { + if (std::unique_ptr<FoFiTrueType> ffTT = FoFiTrueType::make(fontBuf->data(), fontBuf->size())) { + codeToGID = ((Gfx8BitFont *)font)->getCodeToGIDMap(ffTT.get()); +@@ -2595,7 +2595,7 @@ + embFontList->append("\n"); + + // convert it to a Type 0 font +- const std::optional<std::vector<unsigned char>> fontBuf = font->readEmbFontFile(xref); ++ const boost::optional<std::vector<unsigned char>> fontBuf = font->readEmbFontFile(xref); + if (fontBuf) { + if ((ffT1C = FoFiType1C::make(fontBuf->data(), fontBuf->size()))) { + if (level >= psLevel3) { +@@ -2622,7 +2622,7 @@ + embFontList->append("\n"); + + // convert it to a Type 0 font +- const std::optional<std::vector<unsigned char>> fontBuf = font->readEmbFontFile(xref); ++ const boost::optional<std::vector<unsigned char>> fontBuf = font->readEmbFontFile(xref); + if (fontBuf) { + if (std::unique_ptr<FoFiTrueType> ffTT = FoFiTrueType::make(fontBuf->data(), fontBuf->size())) { + if (level >= psLevel3) { +@@ -2668,7 +2668,7 @@ + embFontList->append("\n"); + + // convert it to a Type 0 font +- const std::optional<std::vector<unsigned char>> fontBuf = font->readEmbFontFile(xref); ++ const boost::optional<std::vector<unsigned char>> fontBuf = font->readEmbFontFile(xref); + if (fontBuf) { + if (std::unique_ptr<FoFiTrueType> ffTT = FoFiTrueType::make(fontBuf->data(), fontBuf->size())) { + if (ffTT->isOpenTypeCFF()) { +diff -ur poppler/poppler/SecurityHandler.cc poppler/poppler/SecurityHandler.cc +--- poppler/poppler/SecurityHandler.cc 2022-09-16 21:58:43.016329200 +0300 ++++ poppler/poppler/SecurityHandler.cc 2022-09-16 16:27:49.497002700 +0300 +@@ -62,7 +62,7 @@ + + SecurityHandler::~SecurityHandler() { } + +-bool SecurityHandler::checkEncryption(const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) ++bool SecurityHandler::checkEncryption(const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword) + { + void *authData; + +@@ -290,7 +290,7 @@ + return encVersion == -1 && encRevision == -1; + } + +-void *StandardSecurityHandler::makeAuthData(const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) ++void *StandardSecurityHandler::makeAuthData(const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword) + { + return new StandardAuthData(ownerPassword ? ownerPassword->copy() : nullptr, userPassword ? userPassword->copy() : nullptr); + } +diff -ur poppler/poppler/SecurityHandler.h poppler/poppler/SecurityHandler.h +--- poppler/poppler/SecurityHandler.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/poppler/SecurityHandler.h 2022-09-16 16:29:39.504613800 +0300 +@@ -27,7 +27,7 @@ + + #include "Object.h" + +-#include <optional> ++#include <boost/optional.hpp> + + class GooString; + class PDFDoc; +@@ -59,12 +59,12 @@ + // document can be opened (if it's unencrypted, or if a correct + // password is obtained); false otherwise (encrypted and no correct + // password). +- bool checkEncryption(const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword); ++ bool checkEncryption(const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword); + + // Create authorization data for the specified owner and user + // passwords. If the security handler doesn't support "batch" mode, + // this function should return NULL. +- virtual void *makeAuthData(const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) = 0; ++ virtual void *makeAuthData(const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword) = 0; + + // Free the authorization data returned by makeAuthData or + // getAuthData. +@@ -101,7 +101,7 @@ + ~StandardSecurityHandler() override; + + bool isUnencrypted() const override; +- void *makeAuthData(const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) override; ++ void *makeAuthData(const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword) override; + void freeAuthData(void *authData) override; + bool authorize(void *authData) override; + int getPermissionFlags() const override { return permFlags; } +diff -ur poppler/poppler/SignatureHandler.cc poppler/poppler/SignatureHandler.cc +--- poppler/poppler/SignatureHandler.cc 2022-09-16 21:58:43.053838500 +0300 ++++ poppler/poppler/SignatureHandler.cc 2022-09-16 16:29:42.905567600 +0300 +@@ -26,7 +26,7 @@ + #include "goo/gdir.h" + #include "goo/gmem.h" + +-#include <optional> ++#include <boost/optional.hpp> + + #include <Error.h> + +@@ -703,7 +703,7 @@ + } + } + +-static std::optional<std::string> getDefaultFirefoxCertDB() ++static boost::optional<std::string> getDefaultFirefoxCertDB() + { + #ifdef _WIN32 + const char *env = getenv("APPDATA"); +@@ -756,7 +756,7 @@ + initSuccess = (NSS_Init(nssDir.c_str()) == SECSuccess); + sNssDir = nssDir.toStr(); + } else { +- const std::optional<std::string> certDBPath = getDefaultFirefoxCertDB(); ++ const boost::optional<std::string> certDBPath = getDefaultFirefoxCertDB(); + if (!certDBPath) { + initSuccess = (NSS_Init("sql:/etc/pki/nssdb") == SECSuccess); + sNssDir = "sql:/etc/pki/nssdb"; +diff -ur poppler/poppler/SplashOutputDev.cc poppler/poppler/SplashOutputDev.cc +--- poppler/poppler/SplashOutputDev.cc 2022-09-16 21:58:43.216349700 +0300 ++++ poppler/poppler/SplashOutputDev.cc 2022-09-16 16:27:50.045157400 +0300 +@@ -1880,7 +1880,7 @@ + + } else { + +- std::optional<GfxFontLoc> fontLoc = gfxFont->locateFont((xref) ? xref : doc->getXRef(), nullptr); ++ boost::optional<GfxFontLoc> fontLoc = gfxFont->locateFont((xref) ? xref : doc->getXRef(), nullptr); + if (!fontLoc) { + error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)"); + goto err2; +@@ -1888,7 +1888,7 @@ + + // embedded font + std::string fileName; +- std::optional<std::vector<unsigned char>> tmpBuf; ++ boost::optional<std::vector<unsigned char>> tmpBuf; + + if (fontLoc->locType == gfxFontLocEmbedded) { + // if there is an embedded font, read it to memory +diff -ur poppler/poppler/XRef.cc poppler/poppler/XRef.cc +--- poppler/poppler/XRef.cc 2022-09-16 21:58:43.739914900 +0300 ++++ poppler/poppler/XRef.cc 2022-09-16 16:33:54.004790900 +0300 +@@ -234,7 +234,7 @@ + // XRef + //------------------------------------------------------------------------ + +-#define xrefLocker() const std::scoped_lock locker(mutex) ++#define xrefLocker() std::unique_lock<std::recursive_mutex> locker(mutex) + + XRef::XRef() : objStrs { 5 } + { +diff -ur poppler/qt5/src/poppler-annotation.cc poppler/qt5/src/poppler-annotation.cc +--- poppler/qt5/src/poppler-annotation.cc 2022-09-16 21:58:43.802403600 +0300 ++++ poppler/qt5/src/poppler-annotation.cc 2022-09-16 16:27:54.525570000 +0300 +@@ -916,7 +916,7 @@ + // data fields + TextAnnotation::TextType textType; + QString textIcon; +- std::optional<QFont> textFont; ++ boost::optional<QFont> textFont; + QColor textColor = Qt::black; + int inplaceAlign; // 0:left, 1:center, 2:right + QVector<QPointF> inplaceCallout; +diff -ur poppler/qt5/src/poppler-form.cc poppler/qt5/src/poppler-form.cc +--- poppler/qt5/src/poppler-form.cc 2022-09-16 21:58:44.156316400 +0300 ++++ poppler/qt5/src/poppler-form.cc 2022-09-16 16:27:54.957870900 +0300 +@@ -1074,7 +1074,7 @@ + priv->range_bounds.append(bound); + } + } +- const std::optional<GooString> checkedSignature = fws->getCheckedSignature(&priv->docLength); ++ const boost::optional<GooString> checkedSignature = fws->getCheckedSignature(&priv->docLength); + if (priv->range_bounds.size() == 4 && checkedSignature) { + priv->signature = QByteArray::fromHex(checkedSignature->c_str()); + } +@@ -1090,7 +1090,7 @@ + } + + Goffset file_size = 0; +- const std::optional<GooString> sig = fws->getCheckedSignature(&file_size); ++ const boost::optional<GooString> sig = fws->getCheckedSignature(&file_size); + if (sig) { + // the above unsigned_signature_field check + // should already catch this, but double check +@@ -1098,8 +1098,8 @@ + } + const auto reason = std::unique_ptr<GooString>(data.reason().isEmpty() ? nullptr : QStringToUnicodeGooString(data.reason())); + const auto location = std::unique_ptr<GooString>(data.location().isEmpty() ? nullptr : QStringToUnicodeGooString(data.location())); +- const auto ownerPwd = std::optional<GooString>(data.documentOwnerPassword().constData()); +- const auto userPwd = std::optional<GooString>(data.documentUserPassword().constData()); ++ const auto ownerPwd = boost::optional<GooString>(data.documentOwnerPassword().constData()); ++ const auto userPwd = boost::optional<GooString>(data.documentUserPassword().constData()); + const auto gSignatureText = std::unique_ptr<GooString>(QStringToUnicodeGooString(data.signatureText())); + const auto gSignatureLeftText = std::unique_ptr<GooString>(QStringToUnicodeGooString(data.signatureLeftText())); + +diff -ur poppler/qt5/src/poppler-pdf-converter.cc poppler/qt5/src/poppler-pdf-converter.cc +--- poppler/qt5/src/poppler-pdf-converter.cc 2022-09-16 21:58:44.688637900 +0300 ++++ poppler/qt5/src/poppler-pdf-converter.cc 2022-09-16 16:27:55.929224400 +0300 +@@ -138,8 +138,8 @@ + std::unique_ptr<GooString> gSignatureLeftText = std::unique_ptr<GooString>(QStringToUnicodeGooString(data.signatureLeftText())); + const auto reason = std::unique_ptr<GooString>(data.reason().isEmpty() ? nullptr : QStringToUnicodeGooString(data.reason())); + const auto location = std::unique_ptr<GooString>(data.location().isEmpty() ? nullptr : QStringToUnicodeGooString(data.location())); +- const auto ownerPwd = std::optional<GooString>(data.documentOwnerPassword().constData()); +- const auto userPwd = std::optional<GooString>(data.documentUserPassword().constData()); ++ const auto ownerPwd = boost::optional<GooString>(data.documentOwnerPassword().constData()); ++ const auto userPwd = boost::optional<GooString>(data.documentUserPassword().constData()); + return doc->sign(d->outputFileName.toUtf8().constData(), data.certNickname().toUtf8().constData(), data.password().toUtf8().constData(), QStringToGooString(data.fieldPartialName()), data.page() + 1, + boundaryToPdfRectangle(destPage, data.boundingRectangle(), Annotation::FixedRotation), *gSignatureText, *gSignatureLeftText, data.fontSize(), data.leftFontSize(), convertQColor(data.fontColor()), data.borderWidth(), + convertQColor(data.borderColor()), convertQColor(data.backgroundColor()), reason.get(), location.get(), data.imagePath().toStdString(), ownerPwd, userPwd); +diff -ur poppler/qt5/src/poppler-private.h poppler/qt5/src/poppler-private.h +--- poppler/qt5/src/poppler-private.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/qt5/src/poppler-private.h 2022-09-16 16:27:56.082938600 +0300 +@@ -104,7 +104,7 @@ + class DocumentData : private GlobalParamsIniter + { + public: +- DocumentData(const QString &filePath, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) : GlobalParamsIniter(qt5ErrorFunction) ++ DocumentData(const QString &filePath, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword) : GlobalParamsIniter(qt5ErrorFunction) + { + init(); + m_device = nullptr; +@@ -117,7 +117,7 @@ + #endif + } + +- DocumentData(QIODevice *device, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) : GlobalParamsIniter(qt5ErrorFunction) ++ DocumentData(QIODevice *device, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword) : GlobalParamsIniter(qt5ErrorFunction) + { + m_device = device; + QIODeviceInStream *str = new QIODeviceInStream(device, 0, false, device->size(), Object(objNull)); +@@ -125,7 +125,7 @@ + doc = new PDFDoc(str, ownerPassword, userPassword, nullptr, std::bind(&DocumentData::noitfyXRefReconstructed, this)); + } + +- DocumentData(const QByteArray &data, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) : GlobalParamsIniter(qt5ErrorFunction) ++ DocumentData(const QByteArray &data, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword) : GlobalParamsIniter(qt5ErrorFunction) + { + m_device = nullptr; + fileContents = data; +diff -ur poppler/qt5/src/QPainterOutputDev.cc poppler/qt5/src/QPainterOutputDev.cc +--- poppler/qt5/src/QPainterOutputDev.cc 2022-09-16 21:58:45.036351300 +0300 ++++ poppler/qt5/src/QPainterOutputDev.cc 2022-09-16 16:27:56.631141300 +0300 +@@ -456,13 +456,13 @@ + // New font: load it into the cache + float fontSize = state->getFontSize(); + +- std::optional<GfxFontLoc> fontLoc = gfxFont->locateFont(xref, nullptr); ++ boost::optional<GfxFontLoc> fontLoc = gfxFont->locateFont(xref, nullptr); + + if (fontLoc) { + // load the font from respective location + switch (fontLoc->locType) { + case gfxFontLocEmbedded: { // if there is an embedded font, read it to memory +- const std::optional<std::vector<unsigned char>> fontData = gfxFont->readEmbFontFile(xref); ++ const boost::optional<std::vector<unsigned char>> fontData = gfxFont->readEmbFontFile(xref); + + // fontData gets copied in the QByteArray constructor + m_rawFont = new QRawFont(QByteArray(fontData ? (const char *)fontData->data() : nullptr, fontData ? fontData->size() : 0), fontSize, m_hintingPreference); +@@ -519,9 +519,9 @@ + + } else { + +- std::optional<std::vector<unsigned char>> fontBuffer; ++ boost::optional<std::vector<unsigned char>> fontBuffer; + +- std::optional<GfxFontLoc> fontLoc = gfxFont->locateFont(xref, nullptr); ++ boost::optional<GfxFontLoc> fontLoc = gfxFont->locateFont(xref, nullptr); + if (!fontLoc) { + error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)"); + return; +diff -ur poppler/qt6/src/poppler-annotation.cc poppler/qt6/src/poppler-annotation.cc +--- poppler/qt6/src/poppler-annotation.cc 2022-09-16 21:58:45.421753700 +0300 ++++ poppler/qt6/src/poppler-annotation.cc 2022-09-16 16:28:00.741508000 +0300 +@@ -836,7 +836,7 @@ + // data fields + TextAnnotation::TextType textType; + QString textIcon; +- std::optional<QFont> textFont; ++ boost::optional<QFont> textFont; + QColor textColor = Qt::black; + TextAnnotation::InplaceAlignPosition inplaceAlign; + QVector<QPointF> inplaceCallout; +diff -ur poppler/qt6/src/poppler-form.cc poppler/qt6/src/poppler-form.cc +--- poppler/qt6/src/poppler-form.cc 2022-09-16 21:58:45.690879600 +0300 ++++ poppler/qt6/src/poppler-form.cc 2022-09-16 16:28:01.195951400 +0300 +@@ -1074,7 +1074,7 @@ + priv->range_bounds.append(bound); + } + } +- const std::optional<GooString> checkedSignature = fws->getCheckedSignature(&priv->docLength); ++ const boost::optional<GooString> checkedSignature = fws->getCheckedSignature(&priv->docLength); + if (priv->range_bounds.size() == 4 && checkedSignature) { + priv->signature = QByteArray::fromHex(checkedSignature->c_str()); + } +@@ -1090,7 +1090,7 @@ + } + + Goffset file_size = 0; +- const std::optional<GooString> sig = fws->getCheckedSignature(&file_size); ++ const boost::optional<GooString> sig = fws->getCheckedSignature(&file_size); + if (sig) { + // the above unsigned_signature_field check + // should already catch this, but double check +@@ -1098,8 +1098,8 @@ + } + const auto reason = std::unique_ptr<GooString>(data.reason().isEmpty() ? nullptr : QStringToUnicodeGooString(data.reason())); + const auto location = std::unique_ptr<GooString>(data.location().isEmpty() ? nullptr : QStringToUnicodeGooString(data.location())); +- const auto ownerPwd = std::optional<GooString>(data.documentOwnerPassword().constData()); +- const auto userPwd = std::optional<GooString>(data.documentUserPassword().constData()); ++ const auto ownerPwd = boost::optional<GooString>(data.documentOwnerPassword().constData()); ++ const auto userPwd = boost::optional<GooString>(data.documentUserPassword().constData()); + const auto gSignatureText = std::unique_ptr<GooString>(QStringToUnicodeGooString(data.signatureText())); + const auto gSignatureLeftText = std::unique_ptr<GooString>(QStringToUnicodeGooString(data.signatureLeftText())); + +diff -ur poppler/qt6/src/poppler-pdf-converter.cc poppler/qt6/src/poppler-pdf-converter.cc +--- poppler/qt6/src/poppler-pdf-converter.cc 2022-09-16 21:58:46.138849200 +0300 ++++ poppler/qt6/src/poppler-pdf-converter.cc 2022-09-16 16:28:02.298624000 +0300 +@@ -138,8 +138,8 @@ + std::unique_ptr<GooString> gSignatureLeftText = std::unique_ptr<GooString>(QStringToUnicodeGooString(data.signatureLeftText())); + const auto reason = std::unique_ptr<GooString>(data.reason().isEmpty() ? nullptr : QStringToUnicodeGooString(data.reason())); + const auto location = std::unique_ptr<GooString>(data.location().isEmpty() ? nullptr : QStringToUnicodeGooString(data.location())); +- const auto ownerPwd = std::optional<GooString>(data.documentOwnerPassword().constData()); +- const auto userPwd = std::optional<GooString>(data.documentUserPassword().constData()); ++ const auto ownerPwd = boost::optional<GooString>(data.documentOwnerPassword().constData()); ++ const auto userPwd = boost::optional<GooString>(data.documentUserPassword().constData()); + return doc->sign(d->outputFileName.toUtf8().constData(), data.certNickname().toUtf8().constData(), data.password().toUtf8().constData(), QStringToGooString(data.fieldPartialName()), data.page() + 1, + boundaryToPdfRectangle(destPage, data.boundingRectangle(), Annotation::FixedRotation), *gSignatureText, *gSignatureLeftText, data.fontSize(), data.leftFontSize(), convertQColor(data.fontColor()), data.borderWidth(), + convertQColor(data.borderColor()), convertQColor(data.backgroundColor()), reason.get(), location.get(), data.imagePath().toStdString(), ownerPwd, userPwd); +diff -ur poppler/qt6/src/poppler-private.h poppler/qt6/src/poppler-private.h +--- poppler/qt6/src/poppler-private.h 2022-09-01 01:30:57.000000000 +0300 ++++ poppler/qt6/src/poppler-private.h 2022-09-16 16:28:02.430145200 +0300 +@@ -103,7 +103,7 @@ + class DocumentData : private GlobalParamsIniter + { + public: +- DocumentData(const QString &filePath, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) : GlobalParamsIniter(qt6ErrorFunction) ++ DocumentData(const QString &filePath, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword) : GlobalParamsIniter(qt6ErrorFunction) + { + init(); + m_device = nullptr; +@@ -116,7 +116,7 @@ + #endif + } + +- DocumentData(QIODevice *device, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) : GlobalParamsIniter(qt6ErrorFunction) ++ DocumentData(QIODevice *device, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword) : GlobalParamsIniter(qt6ErrorFunction) + { + m_device = device; + QIODeviceInStream *str = new QIODeviceInStream(device, 0, false, device->size(), Object(objNull)); +@@ -124,7 +124,7 @@ + doc = new PDFDoc(str, ownerPassword, userPassword, nullptr, std::bind(&DocumentData::noitfyXRefReconstructed, this)); + } + +- DocumentData(const QByteArray &data, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) : GlobalParamsIniter(qt6ErrorFunction) ++ DocumentData(const QByteArray &data, const boost::optional<GooString> &ownerPassword, const boost::optional<GooString> &userPassword) : GlobalParamsIniter(qt6ErrorFunction) + { + m_device = nullptr; + fileContents = data; +diff -ur poppler/qt6/src/QPainterOutputDev.cc poppler/qt6/src/QPainterOutputDev.cc +--- poppler/qt6/src/QPainterOutputDev.cc 2022-09-16 21:58:46.508788000 +0300 ++++ poppler/qt6/src/QPainterOutputDev.cc 2022-09-16 16:28:03.084267900 +0300 +@@ -456,13 +456,13 @@ + // New font: load it into the cache + float fontSize = state->getFontSize(); + +- std::optional<GfxFontLoc> fontLoc = gfxFont->locateFont(xref, nullptr); ++ boost::optional<GfxFontLoc> fontLoc = gfxFont->locateFont(xref, nullptr); + + if (fontLoc) { + // load the font from respective location + switch (fontLoc->locType) { + case gfxFontLocEmbedded: { // if there is an embedded font, read it to memory +- const std::optional<std::vector<unsigned char>> fontData = gfxFont->readEmbFontFile(xref); ++ const boost::optional<std::vector<unsigned char>> fontData = gfxFont->readEmbFontFile(xref); + + // fontData gets copied in the QByteArray constructor + m_rawFont = new QRawFont(QByteArray(fontData ? (const char *)fontData->data() : nullptr, fontData ? fontData->size() : 0), fontSize, m_hintingPreference); +@@ -519,9 +519,9 @@ + + } else { + +- std::optional<std::vector<unsigned char>> fontBuffer; ++ boost::optional<std::vector<unsigned char>> fontBuffer; + +- std::optional<GfxFontLoc> fontLoc = gfxFont->locateFont(xref, nullptr); ++ boost::optional<GfxFontLoc> fontLoc = gfxFont->locateFont(xref, nullptr); + if (!fontLoc) { + error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)"); + return; +diff -ur poppler/test/cairo-thread-test.cc poppler/test/cairo-thread-test.cc +--- poppler/test/cairo-thread-test.cc 2022-09-16 21:58:47.521142700 +0300 ++++ poppler/test/cairo-thread-test.cc 2022-09-16 16:34:02.295177800 +0300 +@@ -95,7 +95,7 @@ + + void pushJob(std::unique_ptr<Job> &job) + { +- std::scoped_lock lock { mutex }; ++ std::unique_lock<std::recursive_mutex> locker(mutex); + queue.push_back(std::move(job)); + condition.notify_one(); + } +diff -ur poppler/test/pdf-fullrewrite.cc poppler/test/pdf-fullrewrite.cc +--- poppler/test/pdf-fullrewrite.cc 2022-09-16 21:58:47.948504400 +0300 ++++ poppler/test/pdf-fullrewrite.cc 2022-09-16 16:28:07.674133900 +0300 +@@ -39,8 +39,8 @@ + { + PDFDoc *doc = nullptr; + PDFDoc *docOut = nullptr; +- std::optional<GooString> ownerPW; +- std::optional<GooString> userPW; ++ boost::optional<GooString> ownerPW; ++ boost::optional<GooString> userPW; + int res = 0; + + // parse args +diff -ur poppler/utils/HtmlFonts.cc poppler/utils/HtmlFonts.cc +--- poppler/utils/HtmlFonts.cc 2022-09-16 21:58:48.311749200 +0300 ++++ poppler/utils/HtmlFonts.cc 2022-09-16 16:28:08.144188300 +0300 +@@ -142,7 +142,7 @@ + italic = true; + } + +- if (const std::optional<std::string> &fontname = font.getName()) { ++ if (const boost::optional<std::string> &fontname = font.getName()) { + FontName = new GooString(*fontname); + + GooString fontnameLower(*fontname); +diff -ur poppler/utils/pdfdetach.cc poppler/utils/pdfdetach.cc +--- poppler/utils/pdfdetach.cc 2022-09-16 21:58:48.765935200 +0300 ++++ poppler/utils/pdfdetach.cc 2022-09-16 16:28:09.200135500 +0300 +@@ -75,7 +75,7 @@ + std::unique_ptr<PDFDoc> doc; + GooString *fileName; + const UnicodeMap *uMap; +- std::optional<GooString> ownerPW, userPW; ++ boost::optional<GooString> ownerPW, userPW; + char uBuf[8]; + char path[1024]; + char *p; +diff -ur poppler/utils/pdffonts.cc poppler/utils/pdffonts.cc +--- poppler/utils/pdffonts.cc 2022-09-16 21:58:48.866190300 +0300 ++++ poppler/utils/pdffonts.cc 2022-09-16 16:28:09.316058100 +0300 +@@ -68,7 +68,7 @@ + + int main(int argc, char *argv[]) + { +- std::optional<GooString> ownerPW, userPW; ++ boost::optional<GooString> ownerPW, userPW; + bool ok; + + Win32Console win32Console(&argc, &argv); +diff -ur poppler/utils/pdfimages.cc poppler/utils/pdfimages.cc +--- poppler/utils/pdfimages.cc 2022-09-16 21:58:48.966442700 +0300 ++++ poppler/utils/pdfimages.cc 2022-09-16 16:28:09.416306000 +0300 +@@ -98,7 +98,7 @@ + { + GooString *fileName; + char *imgRoot = nullptr; +- std::optional<GooString> ownerPW, userPW; ++ boost::optional<GooString> ownerPW, userPW; + ImageOutputDev *imgOut; + bool ok; + +diff -ur poppler/utils/pdfinfo.cc poppler/utils/pdfinfo.cc +--- poppler/utils/pdfinfo.cc 2022-09-16 21:58:49.113549500 +0300 ++++ poppler/utils/pdfinfo.cc 2022-09-16 16:28:09.494410900 +0300 +@@ -920,7 +920,7 @@ + { + std::unique_ptr<PDFDoc> doc; + GooString *fileName; +- std::optional<GooString> ownerPW, userPW; ++ boost::optional<GooString> ownerPW, userPW; + const UnicodeMap *uMap; + FILE *f; + bool ok; +diff -ur poppler/utils/pdfsig.cc poppler/utils/pdfsig.cc +--- poppler/utils/pdfsig.cc 2022-09-16 21:58:49.314079800 +0300 ++++ poppler/utils/pdfsig.cc 2022-09-16 16:28:09.701475800 +0300 +@@ -289,7 +289,7 @@ + + std::unique_ptr<GooString> fileName = std::make_unique<GooString>(argv[1]); + +- std::optional<GooString> ownerPW, userPW; ++ boost::optional<GooString> ownerPW, userPW; + if (ownerPassword[0] != '\001') { + ownerPW = GooString(ownerPassword); + } +@@ -425,7 +425,7 @@ + + FormFieldSignature *ffs = signatures.at(signatureNumber - 1); + Goffset file_size = 0; +- const std::optional<GooString> sig = ffs->getCheckedSignature(&file_size); ++ const boost::optional<GooString> sig = ffs->getCheckedSignature(&file_size); + if (sig) { + printf("Signature number %d is already signed\n", signatureNumber); + return 2; +@@ -530,7 +530,7 @@ + if (ranges.size() == 4) { + printf(" - Signed Ranges: [%lld - %lld], [%lld - %lld]\n", ranges[0], ranges[1], ranges[2], ranges[3]); + Goffset checked_file_size; +- const std::optional<GooString> signature = signatures.at(i)->getCheckedSignature(&checked_file_size); ++ const boost::optional<GooString> signature = signatures.at(i)->getCheckedSignature(&checked_file_size); + if (signature && checked_file_size == ranges[3]) { + printf(" - Total document signed\n"); + } else { +diff -ur poppler/utils/pdftocairo.cc poppler/utils/pdftocairo.cc +--- poppler/utils/pdftocairo.cc 2022-09-16 21:58:49.483371200 +0300 ++++ poppler/utils/pdftocairo.cc 2022-09-16 16:28:09.948904300 +0300 +@@ -900,7 +900,7 @@ + GooString *outputName = nullptr; + GooString *outputFileName = nullptr; + GooString *imageFileName = nullptr; +- std::optional<GooString> ownerPW, userPW; ++ boost::optional<GooString> ownerPW, userPW; + CairoOutputDev *cairoOut; + int pg, pg_num_len; + double pg_w, pg_h, tmp, output_w, output_h; +diff -ur poppler/utils/pdftohtml.cc poppler/utils/pdftohtml.cc +--- poppler/utils/pdftohtml.cc 2022-09-16 21:58:49.599244600 +0300 ++++ poppler/utils/pdftohtml.cc 2022-09-16 16:28:10.080425900 +0300 +@@ -165,7 +165,7 @@ + SplashOutputDev *splashOut = nullptr; + bool doOutline; + bool ok; +- std::optional<GooString> ownerPW, userPW; ++ boost::optional<GooString> ownerPW, userPW; + Object info; + int exit_status = EXIT_FAILURE; + +diff -ur poppler/utils/pdftoppm.cc poppler/utils/pdftoppm.cc +--- poppler/utils/pdftoppm.cc 2022-09-16 21:58:49.683883000 +0300 ++++ poppler/utils/pdftoppm.cc 2022-09-16 16:28:10.198840800 +0300 +@@ -401,7 +401,7 @@ + GooString *fileName = nullptr; + char *ppmRoot = nullptr; + char *ppmFile; +- std::optional<GooString> ownerPW, userPW; ++ boost::optional<GooString> ownerPW, userPW; + SplashColor paperColor; + #ifndef UTILS_USE_PTHREADS + SplashOutputDev *splashOut; +diff -ur poppler/utils/pdftops.cc poppler/utils/pdftops.cc +--- poppler/utils/pdftops.cc 2022-09-16 21:58:49.752940500 +0300 ++++ poppler/utils/pdftops.cc 2022-09-16 16:28:10.318740600 +0300 +@@ -197,7 +197,7 @@ + GooString *psFileName; + PSLevel level; + PSOutMode mode; +- std::optional<GooString> ownerPW, userPW; ++ boost::optional<GooString> ownerPW, userPW; + PSOutputDev *psOut; + bool ok; + int exitCode; +diff -ur poppler/utils/pdftotext.cc poppler/utils/pdftotext.cc +--- poppler/utils/pdftotext.cc 2022-09-16 21:58:49.831085500 +0300 ++++ poppler/utils/pdftotext.cc 2022-09-16 16:28:10.465845300 +0300 +@@ -167,7 +167,7 @@ + std::unique_ptr<PDFDoc> doc; + GooString *fileName; + GooString *textFileName; +- std::optional<GooString> ownerPW, userPW; ++ boost::optional<GooString> ownerPW, userPW; + TextOutputDev *textOut; + FILE *f; + const UnicodeMap *uMap; diff --git a/external/postgresql/ExternalProject_postgresql.mk b/external/postgresql/ExternalProject_postgresql.mk index 2d360134e6ba..e73a1c19f789 100644 --- a/external/postgresql/ExternalProject_postgresql.mk +++ b/external/postgresql/ExternalProject_postgresql.mk @@ -43,7 +43,7 @@ endif ifeq ($(DISABLE_OPENSSL),) ifeq ($(SYSTEM_OPENSSL),) postgresql_CPPFLAGS += -I$(call gb_UnpackedTarball_get_dir,openssl)/include -postgresql_LDFLAGS += -L$(call gb_UnpackedTarball_get_dir,openssl)/ +postgresql_LDFLAGS += -L$(call gb_UnpackedTarball_get_dir,openssl)/ $(if $(filter $(OS),LINUX),-pthread) endif endif diff --git a/external/postgresql/postgres-msvc-build.patch.1 b/external/postgresql/postgres-msvc-build.patch.1 index 4ccd82aa28fb..c217a755918b 100644 --- a/external/postgresql/postgres-msvc-build.patch.1 +++ b/external/postgresql/postgres-msvc-build.patch.1 @@ -80,7 +80,7 @@ Also Cygwin perl has $Config{osname} different from MSWin32, and why even check # Quote the .exe name in case it has spaces my $opensslcmd = - qq("$self->{options}->{openssl}\\bin\\openssl.exe" version 2>&1); -+ qq("$self->{options}->{openssl}\\out32dll\\openssl.exe" version 2>&1); ++ qq("$self->{options}->{openssl}\\apps\\openssl.exe" version 2>&1); + print "$opensslcmd"; my $sslout = `$opensslcmd`; @@ -101,10 +101,10 @@ Also Cygwin perl has $Config{osname} different from MSWin32, and why even check # parameter. $proj->AddLibrary( - $self->{options}->{openssl} . '\lib\ssleay32.lib', 0); -+ $self->{options}->{openssl} . '\out32dll\ssleay32.lib', 0); ++ $self->{options}->{openssl} . '\ssleay32.lib', 0); $proj->AddLibrary( - $self->{options}->{openssl} . '\lib\libeay32.lib', 0); -+ $self->{options}->{openssl} . '\out32dll\libeay32.lib', 0); ++ $self->{options}->{openssl} . '\libeay32.lib', 0); } } } diff --git a/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1 b/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1 deleted file mode 100644 index 489e5d0e89ee..000000000000 --- a/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1 +++ /dev/null @@ -1,59 +0,0 @@ -From 582d188e6e3487180891f1fc457a80dec8be26a8 Mon Sep 17 00:00:00 2001 -From: Christian Heimes <christian@python.org> -Date: Mon, 24 Sep 2018 14:38:31 +0200 -Subject: [PATCH] [3.6] bpo-17239: Disable external entities in SAX parser - (GH-9217) (GH-9512) - -The SAX parser no longer processes general external entities by default -to increase security. Before, the parser created network connections -to fetch remote files or loaded local files from the file system for DTD -and entities. - -Signed-off-by: Christian Heimes <christian@python.org> - -https://bugs.python.org/issue17239. -(cherry picked from commit 17b1d5d4e36aa57a9b25a0e694affbd1ee637e45) - -Co-authored-by: Christian Heimes <christian@python.org> - - - -https://bugs.python.org/issue17239 ---- - Doc/library/xml.dom.pulldom.rst | 14 +++++ - Doc/library/xml.rst | 6 +- - Doc/library/xml.sax.rst | 8 +++ - Doc/whatsnew/3.6.rst | 18 +++++- - Lib/test/test_pulldom.py | 7 +++ - Lib/test/test_sax.py | 60 ++++++++++++++++++- - Lib/test/test_xml_etree.py | 13 ++++ - Lib/xml/sax/expatreader.py | 2 +- - .../2018-09-11-18-30-55.bpo-17239.kOpwK2.rst | 3 + - 9 files changed, 125 insertions(+), 6 deletions(-) - create mode 100644 Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst - -diff --git a/Lib/xml/sax/expatreader.py b/Lib/xml/sax/expatreader.py -index 421358fa5b..5066ffc2fa 100644 ---- a/Lib/xml/sax/expatreader.py -+++ b/Lib/xml/sax/expatreader.py -@@ -95,7 +95,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): - self._lex_handler_prop = None - self._parsing = 0 - self._entity_stack = [] -- self._external_ges = 1 -+ self._external_ges = 0 - self._interning = None - - # XMLReader methods -diff --git a/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst b/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst -new file mode 100644 -index 0000000000..8dd0fe8c1b ---- /dev/null -+++ b/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst -@@ -0,0 +1,3 @@ -+The xml.sax and xml.dom.minidom parsers no longer processes external -+entities by default. External DTD and ENTITY declarations no longer -+load files or create network connections. --- -2.20.1 - diff --git a/external/python3/0001-3.6-closes-bpo-42938-Replace-snprintf-with-Python-un.patch.1 b/external/python3/0001-3.6-closes-bpo-42938-Replace-snprintf-with-Python-un.patch.1 deleted file mode 100644 index fdcc5cb65267..000000000000 --- a/external/python3/0001-3.6-closes-bpo-42938-Replace-snprintf-with-Python-un.patch.1 +++ /dev/null @@ -1,175 +0,0 @@ -From 34df10a9a16b38d54421eeeaf73ec89828563be7 Mon Sep 17 00:00:00 2001 -From: Benjamin Peterson <benjamin@python.org> -Date: Mon, 18 Jan 2021 15:11:46 -0600 -Subject: [PATCH] [3.6] closes bpo-42938: Replace snprintf with Python unicode - formatting in ctypes param reprs. (GH-24250) - -(cherry picked from commit 916610ef90a0d0761f08747f7b0905541f0977c7) - -Co-authored-by: Benjamin Peterson <benjamin@python.org> ---- - Lib/ctypes/test/test_parameters.py | 43 +++++++++++++++ - .../2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst | 2 + - Modules/_ctypes/callproc.c | 55 +++++++------------ - 3 files changed, 66 insertions(+), 34 deletions(-) - create mode 100644 Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst - -diff --git a/Lib/ctypes/test/test_parameters.py b/Lib/ctypes/test/test_parameters.py -index e4c25fd880..531894fdec 100644 ---- a/Lib/ctypes/test/test_parameters.py -+++ b/Lib/ctypes/test/test_parameters.py -@@ -201,6 +201,49 @@ def __dict__(self): - self.assertRaises(ArgumentError, func, 99) - - -+ def test_parameter_repr(self): -+ from ctypes import ( -+ c_bool, -+ c_char, -+ c_wchar, -+ c_byte, -+ c_ubyte, -+ c_short, -+ c_ushort, -+ c_int, -+ c_uint, -+ c_long, -+ c_ulong, -+ c_longlong, -+ c_ulonglong, -+ c_float, -+ c_double, -+ c_longdouble, -+ c_char_p, -+ c_wchar_p, -+ c_void_p, -+ ) -+ self.assertRegex(repr(c_bool.from_param(True)), r"^<cparam '\?' at 0x[A-Fa-f0-9]+>$") -+ self.assertEqual(repr(c_char.from_param(97)), "<cparam 'c' ('a')>") -+ self.assertRegex(repr(c_wchar.from_param('a')), r"^<cparam 'u' at 0x[A-Fa-f0-9]+>$") -+ self.assertEqual(repr(c_byte.from_param(98)), "<cparam 'b' (98)>") -+ self.assertEqual(repr(c_ubyte.from_param(98)), "<cparam 'B' (98)>") -+ self.assertEqual(repr(c_short.from_param(511)), "<cparam 'h' (511)>") -+ self.assertEqual(repr(c_ushort.from_param(511)), "<cparam 'H' (511)>") -+ self.assertRegex(repr(c_int.from_param(20000)), r"^<cparam '[li]' \(20000\)>$") -+ self.assertRegex(repr(c_uint.from_param(20000)), r"^<cparam '[LI]' \(20000\)>$") -+ self.assertRegex(repr(c_long.from_param(20000)), r"^<cparam '[li]' \(20000\)>$") -+ self.assertRegex(repr(c_ulong.from_param(20000)), r"^<cparam '[LI]' \(20000\)>$") -+ self.assertRegex(repr(c_longlong.from_param(20000)), r"^<cparam '[liq]' \(20000\)>$") -+ self.assertRegex(repr(c_ulonglong.from_param(20000)), r"^<cparam '[LIQ]' \(20000\)>$") -+ self.assertEqual(repr(c_float.from_param(1.5)), "<cparam 'f' (1.5)>") -+ self.assertEqual(repr(c_double.from_param(1.5)), "<cparam 'd' (1.5)>") -+ self.assertEqual(repr(c_double.from_param(1e300)), "<cparam 'd' (1e+300)>") -+ self.assertRegex(repr(c_longdouble.from_param(1.5)), r"^<cparam ('d' \(1.5\)|'g' at 0x[A-Fa-f0-9]+)>$") -+ self.assertRegex(repr(c_char_p.from_param(b'hihi')), "^<cparam 'z' \(0x[A-Fa-f0-9]+\)>$") -+ self.assertRegex(repr(c_wchar_p.from_param('hihi')), "^<cparam 'Z' \(0x[A-Fa-f0-9]+\)>$") -+ self.assertRegex(repr(c_void_p.from_param(0x12)), r"^<cparam 'P' \(0x0*12\)>$") -+ - ################################################################ - - if __name__ == '__main__': -diff --git a/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst b/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst -new file mode 100644 -index 0000000000..7df65a156f ---- /dev/null -+++ b/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst -@@ -0,0 +1,2 @@ -+Avoid static buffers when computing the repr of :class:`ctypes.c_double` and -+:class:`ctypes.c_longdouble` values. -diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c -index 70e416b950..9fcf95f543 100644 ---- a/Modules/_ctypes/callproc.c -+++ b/Modules/_ctypes/callproc.c -@@ -451,54 +451,43 @@ PyCArg_dealloc(PyCArgObject *self) - static PyObject * - PyCArg_repr(PyCArgObject *self) - { -- char buffer[256]; - switch(self->tag) { - case 'b': - case 'B': -- sprintf(buffer, "<cparam '%c' (%d)>", -+ return PyUnicode_FromFormat("<cparam '%c' (%d)>", - self->tag, self->value.b); -- break; - case 'h': - case 'H': -- sprintf(buffer, "<cparam '%c' (%d)>", -+ return PyUnicode_FromFormat("<cparam '%c' (%d)>", - self->tag, self->value.h); -- break; - case 'i': - case 'I': -- sprintf(buffer, "<cparam '%c' (%d)>", -+ return PyUnicode_FromFormat("<cparam '%c' (%d)>", - self->tag, self->value.i); -- break; - case 'l': - case 'L': -- sprintf(buffer, "<cparam '%c' (%ld)>", -+ return PyUnicode_FromFormat("<cparam '%c' (%ld)>", - self->tag, self->value.l); -- break; - - #ifdef HAVE_LONG_LONG - case 'q': - case 'Q': -- sprintf(buffer, --#ifdef MS_WIN32 -- "<cparam '%c' (%I64d)>", --#else -- "<cparam '%c' (%qd)>", --#endif -+ return PyUnicode_FromFormat("<cparam '%c' (%qd)>", - self->tag, self->value.q); -- break; - #endif - case 'd': -- sprintf(buffer, "<cparam '%c' (%f)>", -- self->tag, self->value.d); -- break; -- case 'f': -- sprintf(buffer, "<cparam '%c' (%f)>", -- self->tag, self->value.f); -- break; -- -+ case 'f': { -+ PyObject *f = PyFloat_FromDouble((self->tag == 'f') ? self->value.f : self->value.d); -+ if (f == NULL) { -+ return NULL; -+ } -+ { PyObject *result = PyUnicode_FromFormat("<cparam '%c' (%R)>", self->tag, f); -+ Py_DECREF(f); -+ return result; } -+ } - case 'c': -- sprintf(buffer, "<cparam '%c' (%c)>", -+ return PyUnicode_FromFormat("<cparam '%c' ('%c')>", - self->tag, self->value.c); -- break; - - /* Hm, are these 'z' and 'Z' codes useful at all? - Shouldn't they be replaced by the functionality of c_string -@@ -507,16 +495,14 @@ PyCArg_repr(PyCArgObject *self) - case 'z': - case 'Z': - case 'P': -- sprintf(buffer, "<cparam '%c' (%p)>", -+ return PyUnicode_FromFormat("<cparam '%c' (%p)>", - self->tag, self->value.p); - break; - - default: -- sprintf(buffer, "<cparam '%c' at %p>", -- self->tag, self); -- break; -+ return PyUnicode_FromFormat("<cparam '%c' at %p>", -+ (unsigned char)self->tag, (void *)self); - } -- return PyUnicode_FromString(buffer); - } - - static PyMemberDef PyCArgType_members[] = { --- -2.29.2 - diff --git a/external/python3/0001-remove-long-double-from-ctypes-value-union.patch.1 b/external/python3/0001-remove-long-double-from-ctypes-value-union.patch.1 index 8cdaf84de37c..c7c6809bcb80 100644 --- a/external/python3/0001-remove-long-double-from-ctypes-value-union.patch.1 +++ b/external/python3/0001-remove-long-double-from-ctypes-value-union.patch.1 @@ -14,17 +14,17 @@ index 0d3f7241ca..d80ea82cee 100644 --- a/Modules/_ctypes/ctypes.h +++ b/Modules/_ctypes/ctypes.h @@ -34,7 +34,6 @@ union value { - #ifdef HAVE_LONG_LONG - PY_LONG_LONG ll; - #endif + float f; + double d; + long long ll; - long double D; }; /* @@ -306,7 +305,6 @@ struct tagPyCArgObject { - #ifdef HAVE_LONG_LONG - PY_LONG_LONG q; - #endif + int i; + long l; + long long q; - long double D; double d; float f; diff --git a/external/python3/ExternalPackage_python3.mk b/external/python3/ExternalPackage_python3.mk index dc3d739c295b..f7b8d67f25b2 100644 --- a/external/python3/ExternalPackage_python3.mk +++ b/external/python3/ExternalPackage_python3.mk @@ -23,16 +23,16 @@ ifeq ($(MSVC_USE_DEBUG_RUNTIME),) $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python$(PYTHON_VERSION_MAJOR).dll,PCbuild/$(python_arch_subdir)python$(PYTHON_VERSION_MAJOR).dll)) endif $(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\ + PCbuild/$(python_arch_subdir)_asyncio$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)_ctypes$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ - PCbuild/$(python_arch_subdir)_ctypes_test$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)_decimal$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)_elementtree$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)_msi$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)_multiprocessing$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ + PCbuild/$(python_arch_subdir)_overlapped$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ + PCbuild/$(python_arch_subdir)_queue$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)_socket$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)_ssl$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ - PCbuild/$(python_arch_subdir)_testbuffer$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ - PCbuild/$(python_arch_subdir)_testcapi$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)pyexpat$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)select$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ PCbuild/$(python_arch_subdir)unicodedata$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \ @@ -41,8 +41,8 @@ $(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-cor else $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python.bin,python)) $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).so,libpython$(PYTHON_VERSION_MAJOR).so)) -$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so.1.0,libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so)) -$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so.1.0-gdb.py,Tools/gdb/libpython.py)) +$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so.1.0,libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so)) +$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python-gdb.py,Tools/gdb/libpython.py)) # Unfortunately the python build system does not allow to explicitly enable or # disable these, it just tries to build them and then prints which did not @@ -53,63 +53,68 @@ $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$( ifneq ($(OS),AIX) $(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/lib-dynload,\ - LO_lib/array.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/audioop.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/binascii.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_bisect.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/cmath.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_codecs_cn.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_codecs_hk.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_codecs_iso2022.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_codecs_jp.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_codecs_kr.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_codecs_tw.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_crypt.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_csv.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_ctypes.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_ctypes_test.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_datetime.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_decimal.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_elementtree.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/fcntl.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/grp.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ + LO_lib/array.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_asyncio.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/audioop.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/binascii.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_bisect.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_blake2.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/cmath.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_codecs_cn.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_codecs_hk.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_codecs_iso2022.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_codecs_jp.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_codecs_kr.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_codecs_tw.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_contextvars.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_crypt.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_csv.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_ctypes.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_datetime.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_decimal.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_elementtree.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/fcntl.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/grp.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ $(if $(DISABLE_OPENSSL),, \ - LO_lib/_hashlib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ + LO_lib/_hashlib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ ) \ - LO_lib/_heapq.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_json.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_lsprof.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/math.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/mmap.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_multibytecodec.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_multiprocessing.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_opcode.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/ossaudiodev.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/parser.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_pickle.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_posixsubprocess.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/pyexpat.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_random.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/resource.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/select.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_sha1.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_sha256.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_sha512.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_socket.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/spwd.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ + LO_lib/_heapq.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_json.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_lsprof.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/math.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_md5.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/mmap.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_multibytecodec.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_multiprocessing.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_opcode.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/ossaudiodev.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/parser.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_pickle.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_posixshmem.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_posixsubprocess.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/pyexpat.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_queue.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_random.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/resource.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/select.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_sha1.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_sha256.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_sha3.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_sha512.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_socket.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/spwd.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ $(if $(DISABLE_OPENSSL),, \ - LO_lib/_ssl.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ + LO_lib/_ssl.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ ) \ - LO_lib/_struct.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/syslog.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/termios.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_testbuffer.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_testcapi.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_testimportmultiple.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/_testmultiphase.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/unicodedata.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/xxlimited.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ - LO_lib/zlib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \ + LO_lib/_statistics.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_struct.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/syslog.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/termios.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/unicodedata.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/xxlimited.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_xxsubinterpreters.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/_xxtestfuzz.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ + LO_lib/zlib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \ )) endif endif @@ -117,10 +122,20 @@ endif # headers are not delivered, but used from unpacked dir Include/ # (+ toplevel for pyconfig.h) +ifeq ($(OS),LINUX) +python3_MACHDEP=linux +else +ifeq ($(OS),MACOSX) +python3_MACHDEP=darwin +endif +endif + # that one is generated... +# note: python configure overrides config.guess with something that doesn't +# put -pc in its linux platform triplets, so filter that... ifneq ($(OS),WNT) $(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\ - LO_lib/_sysconfigdata.py \ + LO_lib/_sysconfigdata__$(python3_MACHDEP)_$(subst i686,i386,$(subst -pc,,$(HOST_PLATFORM))).py \ )) endif @@ -130,33 +145,10 @@ endif # idlelib, tkinter, turtledemo - need Tk to build the C module # test - probably unnecessary? was explicitly removed #i116738# # venv - why would we need virtual environments - -$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/plat-linux,\ - Lib/plat-linux/regen \ - Lib/plat-linux/CDROM.py \ - Lib/plat-linux/DLFCN.py \ - Lib/plat-linux/IN.py \ - Lib/plat-linux/TYPES.py \ -)) - -$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/plat-darwin,\ - Lib/plat-darwin/IN.py \ - Lib/plat-darwin/regen \ -)) - -$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/plat-sunos5,\ - Lib/plat-sunos5/regen \ - Lib/plat-sunos5/CDIO.py \ - Lib/plat-sunos5/DLFCN.py \ - Lib/plat-sunos5/IN.py \ - Lib/plat-sunos5/STROPTS.py \ - Lib/plat-sunos5/TYPES.py \ -)) - -$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/plat-aix4,\ - Lib/plat-aix4/regen \ - Lib/plat-aix4/IN.py \ -)) +# +# These lists are now sorted with "LC_COLLATE=C sort", by using +# find Lib/ -name "*.py" | sort | sed -e 's/^/\t/' -e 's/$/ \\/' +# $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\ LICENSE \ @@ -169,6 +161,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/_dummy_thread.py \ Lib/_markupbase.py \ Lib/_osx_support.py \ + Lib/_py_abc.py \ Lib/_pydecimal.py \ Lib/_pyio.py \ Lib/_sitebuiltins.py \ @@ -187,6 +180,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/binhex.py \ Lib/bisect.py \ Lib/bz2.py \ + Lib/cProfile.py \ Lib/calendar.py \ Lib/cgi.py \ Lib/cgitb.py \ @@ -199,11 +193,12 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/compileall.py \ Lib/configparser.py \ Lib/contextlib.py \ + Lib/contextvars.py \ Lib/copy.py \ Lib/copyreg.py \ - Lib/cProfile.py \ Lib/crypt.py \ Lib/csv.py \ + Lib/dataclasses.py \ Lib/datetime.py \ Lib/decimal.py \ Lib/difflib.py \ @@ -237,8 +232,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/linecache.py \ Lib/locale.py \ Lib/lzma.py \ - Lib/macpath.py \ - Lib/macurl2path.py \ Lib/mailbox.py \ Lib/mailcap.py \ Lib/mimetypes.py \ @@ -266,19 +259,20 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/profile.py \ Lib/pstats.py \ Lib/pty.py \ - Lib/pyclbr.py \ Lib/py_compile.py \ + Lib/pyclbr.py \ Lib/pydoc.py \ Lib/queue.py \ Lib/quopri.py \ Lib/random.py \ - Lib/reprlib.py \ Lib/re.py \ + Lib/reprlib.py \ Lib/rlcompleter.py \ Lib/runpy.py \ Lib/sched.py \ - Lib/shelve.py \ + Lib/secrets.py \ Lib/selectors.py \ + Lib/shelve.py \ Lib/shlex.py \ Lib/shutil.py \ Lib/signal.py \ @@ -292,10 +286,10 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/sre_constants.py \ Lib/sre_parse.py \ Lib/ssl.py \ - Lib/statistics.py \ Lib/stat.py \ - Lib/stringprep.py \ + Lib/statistics.py \ Lib/string.py \ + Lib/stringprep.py \ Lib/struct.py \ Lib/subprocess.py \ Lib/sunau.py \ @@ -310,25 +304,15 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/this.py \ Lib/threading.py \ Lib/timeit.py \ - Lib/tokenize.py \ Lib/token.py \ - Lib/traceback.py \ + Lib/tokenize.py \ Lib/trace.py \ + Lib/traceback.py \ + Lib/tracemalloc.py \ Lib/tty.py \ Lib/turtle.py \ Lib/types.py \ Lib/typing.py \ - Lib/unittest/case.py \ - Lib/unittest/__init__.py \ - Lib/unittest/loader.py \ - Lib/unittest/__main__.py \ - Lib/unittest/main.py \ - Lib/unittest/mock.py \ - Lib/unittest/result.py \ - Lib/unittest/runner.py \ - Lib/unittest/signals.py \ - Lib/unittest/suite.py \ - Lib/unittest/util.py \ Lib/uu.py \ Lib/uuid.py \ Lib/warnings.py \ @@ -336,12 +320,45 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/weakref.py \ Lib/webbrowser.py \ Lib/xdrlib.py \ + Lib/zipapp.py \ Lib/zipfile.py \ + Lib/zipimport.py \ +)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/asyncio,\ + Lib/asyncio/__init__.py \ + Lib/asyncio/__main__.py \ + Lib/asyncio/base_events.py \ + Lib/asyncio/base_futures.py \ + Lib/asyncio/base_subprocess.py \ + Lib/asyncio/base_tasks.py \ + Lib/asyncio/constants.py \ + Lib/asyncio/coroutines.py \ + Lib/asyncio/events.py \ + Lib/asyncio/exceptions.py \ + Lib/asyncio/format_helpers.py \ + Lib/asyncio/futures.py \ + Lib/asyncio/locks.py \ + Lib/asyncio/log.py \ + Lib/asyncio/proactor_events.py \ + Lib/asyncio/protocols.py \ + Lib/asyncio/queues.py \ + Lib/asyncio/runners.py \ + Lib/asyncio/selector_events.py \ + Lib/asyncio/sslproto.py \ + Lib/asyncio/staggered.py \ + Lib/asyncio/streams.py \ + Lib/asyncio/subprocess.py \ + Lib/asyncio/tasks.py \ + Lib/asyncio/transports.py \ + Lib/asyncio/trsock.py \ + Lib/asyncio/unix_events.py \ + Lib/asyncio/windows_events.py \ + Lib/asyncio/windows_utils.py \ )) $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/collections,\ Lib/collections/__init__.py \ - Lib/collections/__main__.py \ Lib/collections/abc.py \ )) @@ -358,6 +375,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/ctypes,\ Lib/ctypes/__init__.py \ + Lib/ctypes/_aix.py \ Lib/ctypes/_endian.py \ Lib/ctypes/util.py \ Lib/ctypes/wintypes.py \ @@ -391,8 +409,8 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/distutils/errors.py \ Lib/distutils/extension.py \ Lib/distutils/fancy_getopt.py \ - Lib/distutils/filelist.py \ Lib/distutils/file_util.py \ + Lib/distutils/filelist.py \ Lib/distutils/log.py \ Lib/distutils/msvc9compiler.py \ Lib/distutils/msvccompiler.py \ @@ -401,44 +419,44 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/distutils/text_file.py \ Lib/distutils/unixccompiler.py \ Lib/distutils/util.py \ - Lib/distutils/versionpredicate.py \ Lib/distutils/version.py \ + Lib/distutils/versionpredicate.py \ )) $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/distutils/command,\ Lib/distutils/command/__init__.py \ + Lib/distutils/command/bdist.py \ Lib/distutils/command/bdist_dumb.py \ Lib/distutils/command/bdist_msi.py \ - Lib/distutils/command/bdist.py \ Lib/distutils/command/bdist_rpm.py \ Lib/distutils/command/bdist_wininst.py \ + Lib/distutils/command/build.py \ Lib/distutils/command/build_clib.py \ Lib/distutils/command/build_ext.py \ - Lib/distutils/command/build.py \ Lib/distutils/command/build_py.py \ Lib/distutils/command/build_scripts.py \ Lib/distutils/command/check.py \ Lib/distutils/command/clean.py \ Lib/distutils/command/command_template \ Lib/distutils/command/config.py \ + Lib/distutils/command/install.py \ Lib/distutils/command/install_data.py \ Lib/distutils/command/install_egg_info.py \ Lib/distutils/command/install_headers.py \ Lib/distutils/command/install_lib.py \ - Lib/distutils/command/install.py \ Lib/distutils/command/install_scripts.py \ Lib/distutils/command/register.py \ Lib/distutils/command/sdist.py \ Lib/distutils/command/upload.py \ - Lib/distutils/command/wininst-10.0-amd64.exe \ Lib/distutils/command/wininst-10.0.exe \ - Lib/distutils/command/wininst-14.0-amd64.exe \ + Lib/distutils/command/wininst-10.0-amd64.exe \ Lib/distutils/command/wininst-14.0.exe \ + Lib/distutils/command/wininst-14.0-amd64.exe \ Lib/distutils/command/wininst-6.0.exe \ Lib/distutils/command/wininst-7.1.exe \ Lib/distutils/command/wininst-8.0.exe \ - Lib/distutils/command/wininst-9.0-amd64.exe \ Lib/distutils/command/wininst-9.0.exe \ + Lib/distutils/command/wininst-9.0-amd64.exe \ )) $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/email,\ @@ -482,8 +500,8 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/encodings/aliases.py \ Lib/encodings/ascii.py \ Lib/encodings/base64_codec.py \ - Lib/encodings/big5hkscs.py \ Lib/encodings/big5.py \ + Lib/encodings/big5hkscs.py \ Lib/encodings/bz2_codec.py \ Lib/encodings/charmap.py \ Lib/encodings/cp037.py \ @@ -500,10 +518,10 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/encodings/cp1256.py \ Lib/encodings/cp1257.py \ Lib/encodings/cp1258.py \ + Lib/encodings/cp273.py \ Lib/encodings/cp424.py \ Lib/encodings/cp437.py \ Lib/encodings/cp500.py \ - Lib/encodings/cp65001.py \ Lib/encodings/cp720.py \ Lib/encodings/cp737.py \ Lib/encodings/cp775.py \ @@ -537,20 +555,20 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/encodings/hp_roman8.py \ Lib/encodings/hz.py \ Lib/encodings/idna.py \ + Lib/encodings/iso2022_jp.py \ Lib/encodings/iso2022_jp_1.py \ - Lib/encodings/iso2022_jp_2004.py \ Lib/encodings/iso2022_jp_2.py \ + Lib/encodings/iso2022_jp_2004.py \ Lib/encodings/iso2022_jp_3.py \ Lib/encodings/iso2022_jp_ext.py \ - Lib/encodings/iso2022_jp.py \ Lib/encodings/iso2022_kr.py \ + Lib/encodings/iso8859_1.py \ Lib/encodings/iso8859_10.py \ Lib/encodings/iso8859_11.py \ Lib/encodings/iso8859_13.py \ Lib/encodings/iso8859_14.py \ Lib/encodings/iso8859_15.py \ Lib/encodings/iso8859_16.py \ - Lib/encodings/iso8859_1.py \ Lib/encodings/iso8859_2.py \ Lib/encodings/iso8859_3.py \ Lib/encodings/iso8859_4.py \ @@ -573,29 +591,29 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/encodings/mac_greek.py \ Lib/encodings/mac_iceland.py \ Lib/encodings/mac_latin2.py \ - Lib/encodings/mac_romanian.py \ Lib/encodings/mac_roman.py \ + Lib/encodings/mac_romanian.py \ Lib/encodings/mac_turkish.py \ Lib/encodings/mbcs.py \ + Lib/encodings/oem.py \ Lib/encodings/palmos.py \ Lib/encodings/ptcp154.py \ Lib/encodings/punycode.py \ Lib/encodings/quopri_codec.py \ Lib/encodings/raw_unicode_escape.py \ Lib/encodings/rot_13.py \ - Lib/encodings/shift_jis_2004.py \ Lib/encodings/shift_jis.py \ + Lib/encodings/shift_jis_2004.py \ Lib/encodings/shift_jisx0213.py \ Lib/encodings/tis_620.py \ Lib/encodings/undefined.py \ Lib/encodings/unicode_escape.py \ - Lib/encodings/unicode_internal.py \ + Lib/encodings/utf_16.py \ Lib/encodings/utf_16_be.py \ Lib/encodings/utf_16_le.py \ - Lib/encodings/utf_16.py \ + Lib/encodings/utf_32.py \ Lib/encodings/utf_32_be.py \ Lib/encodings/utf_32_le.py \ - Lib/encodings/utf_32.py \ Lib/encodings/utf_7.py \ Lib/encodings/utf_8.py \ Lib/encodings/utf_8_sig.py \ @@ -623,6 +641,8 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/importlib/_bootstrap_external.py \ Lib/importlib/abc.py \ Lib/importlib/machinery.py \ + Lib/importlib/metadata.py \ + Lib/importlib/resources.py \ Lib/importlib/util.py \ )) @@ -658,8 +678,8 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/lib2to3/fixes/fix_buffer.py \ Lib/lib2to3/fixes/fix_dict.py \ Lib/lib2to3/fixes/fix_except.py \ - Lib/lib2to3/fixes/fix_execfile.py \ Lib/lib2to3/fixes/fix_exec.py \ + Lib/lib2to3/fixes/fix_execfile.py \ Lib/lib2to3/fixes/fix_exitfunc.py \ Lib/lib2to3/fixes/fix_filter.py \ Lib/lib2to3/fixes/fix_funcattrs.py \ @@ -668,13 +688,13 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/lib2to3/fixes/fix_has_key.py \ Lib/lib2to3/fixes/fix_idioms.py \ Lib/lib2to3/fixes/fix_import.py \ - Lib/lib2to3/fixes/fix_imports2.py \ Lib/lib2to3/fixes/fix_imports.py \ + Lib/lib2to3/fixes/fix_imports2.py \ Lib/lib2to3/fixes/fix_input.py \ Lib/lib2to3/fixes/fix_intern.py \ Lib/lib2to3/fixes/fix_isinstance.py \ - Lib/lib2to3/fixes/fix_itertools_imports.py \ Lib/lib2to3/fixes/fix_itertools.py \ + Lib/lib2to3/fixes/fix_itertools_imports.py \ Lib/lib2to3/fixes/fix_long.py \ Lib/lib2to3/fixes/fix_map.py \ Lib/lib2to3/fixes/fix_metaclass.py \ @@ -714,8 +734,8 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/lib2to3/pgen2/literals.py \ Lib/lib2to3/pgen2/parse.py \ Lib/lib2to3/pgen2/pgen.py \ - Lib/lib2to3/pgen2/tokenize.py \ Lib/lib2to3/pgen2/token.py \ + Lib/lib2to3/pgen2/tokenize.py \ )) $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/logging,\ @@ -724,13 +744,25 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/logging/handlers.py \ )) +ifeq (WNT,$(OS)) +$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/msilib,\ + Lib/msilib/__init__.py \ + Lib/msilib/schema.py \ + Lib/msilib/sequence.py \ + Lib/msilib/text.py \ +)) +endif + $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/multiprocessing,\ Lib/multiprocessing/__init__.py \ Lib/multiprocessing/connection.py \ Lib/multiprocessing/context.py \ + Lib/multiprocessing/dummy/__init__.py \ + Lib/multiprocessing/dummy/connection.py \ Lib/multiprocessing/forkserver.py \ Lib/multiprocessing/heap.py \ Lib/multiprocessing/managers.py \ + Lib/multiprocessing/pool.py \ Lib/multiprocessing/popen_fork.py \ Lib/multiprocessing/popen_forkserver.py \ Lib/multiprocessing/popen_spawn_posix.py \ @@ -739,7 +771,8 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/multiprocessing/queues.py \ Lib/multiprocessing/reduction.py \ Lib/multiprocessing/resource_sharer.py \ - Lib/multiprocessing/semaphore_tracker.py \ + Lib/multiprocessing/resource_tracker.py \ + Lib/multiprocessing/shared_memory.py \ Lib/multiprocessing/sharedctypes.py \ Lib/multiprocessing/spawn.py \ Lib/multiprocessing/synchronize.py \ @@ -760,6 +793,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/unittest,\ Lib/unittest/__init__.py \ Lib/unittest/__main__.py \ + Lib/unittest/async_case.py \ Lib/unittest/case.py \ Lib/unittest/loader.py \ Lib/unittest/main.py \ @@ -771,39 +805,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/unittest/util.py \ )) -$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/unittest/test,\ - Lib/unittest/test/__init__.py \ - Lib/unittest/test/__main__.py \ - Lib/unittest/test/_test_warnings.py \ - Lib/unittest/test/dummy.py \ - Lib/unittest/test/support.py \ - Lib/unittest/test/test_assertions.py \ - Lib/unittest/test/test_break.py \ - Lib/unittest/test/test_case.py \ - Lib/unittest/test/test_discovery.py \ - Lib/unittest/test/test_functiontestcase.py \ - Lib/unittest/test/test_loader.py \ - Lib/unittest/test/test_program.py \ - Lib/unittest/test/test_result.py \ - Lib/unittest/test/test_runner.py \ - Lib/unittest/test/test_setups.py \ - Lib/unittest/test/test_skipping.py \ - Lib/unittest/test/test_suite.py \ -)) - -$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/unittest/test/testmock,\ - Lib/unittest/test/testmock/__init__.py \ - Lib/unittest/test/testmock/__main__.py \ - Lib/unittest/test/testmock/support.py \ - Lib/unittest/test/testmock/testcallable.py \ - Lib/unittest/test/testmock/testhelpers.py \ - Lib/unittest/test/testmock/testmagicmethods.py \ - Lib/unittest/test/testmock/testmock.py \ - Lib/unittest/test/testmock/testpatch.py \ - Lib/unittest/test/testmock/testsentinel.py \ - Lib/unittest/test/testmock/testwith.py \ -)) - $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/urllib,\ Lib/urllib/__init__.py \ Lib/urllib/error.py \ @@ -828,21 +829,21 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml/dom,\ Lib/xml/dom/__init__.py \ - Lib/xml/dom/NodeFilter.py \ Lib/xml/dom/domreg.py \ Lib/xml/dom/expatbuilder.py \ Lib/xml/dom/minicompat.py \ Lib/xml/dom/minidom.py \ + Lib/xml/dom/NodeFilter.py \ Lib/xml/dom/pulldom.py \ Lib/xml/dom/xmlbuilder.py \ )) $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml/etree,\ Lib/xml/etree/__init__.py \ + Lib/xml/etree/cElementTree.py \ Lib/xml/etree/ElementInclude.py \ Lib/xml/etree/ElementPath.py \ Lib/xml/etree/ElementTree.py \ - Lib/xml/etree/cElementTree.py \ )) $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml/parsers,\ @@ -866,7 +867,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p )) $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/site-packages,\ - Lib/site-packages/README \ + Lib/site-packages/README.txt \ )) # vim: set noet sw=4 ts=4: diff --git a/external/python3/ExternalProject_python3.mk b/external/python3/ExternalProject_python3.mk index 99547f384844..309b9008699e 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 WNT LINUX,$(OS)),libffi) \ openssl \ zlib \ )) @@ -28,13 +29,25 @@ ifeq ($(OS),WNT) # TODO: using Debug configuration and related mangling of pyconfig.h +python3_WIN_PLATFORM_MSBUILD := $(strip \ + $(if $(filter INTEL,$(CPUNAME)),Win32) \ + $(if $(filter X86_64,$(CPUNAME)),x64) \ + $(if $(filter ARM64,$(CPUNAME)),arm64) \ + ) + # at least for MSVC 2008 it is necessary to clear MAKEFLAGS because # nmake is invoked $(call gb_ExternalProject_get_state_target,python3,build) : $(call gb_ExternalProject_run,build,\ MAKEFLAGS= MSBuild.exe pcbuild.sln /t:Build \ /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \ - /p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \ + /p:Platform=$(python3_WIN_PLATFORM_MSBUILD) \ + /p:opensslIncludeDir=$(call gb_UnpackedTarball_get_dir,openssl)/include \ + /p:opensslOutDir=$(call gb_UnpackedTarball_get_dir,openssl) \ + /p:zlibDir=$(call gb_UnpackedTarball_get_dir,zlib) \ + /p:libffiOutDir=$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)/.libs \ + /p:libffiIncludeDir=$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)/include \ + /maxcpucount \ $(if $(filter 140,$(VCVER)),/p:PlatformToolset=v140 /p:VisualStudioVersion=14.0 /ToolsVersion:14.0) \ $(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 /p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \ $(if $(filter 150-10,$(VCVER)-$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \ @@ -44,6 +57,16 @@ else # --with-system-expat: this should find the one in the workdir (or system) +# OPENSSL_INCLUDES OPENSSL_LDFLAGS OPENSSL_LIBS cannot be set via commandline! +# use --with-openssl instead, which requires include/ and lib/ subdirs. + +# 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 @@ -75,17 +98,22 @@ $(call gb_ExternalProject_get_state_target,python3,build) : ) \ --enable-framework=/@__________________________________________________OOO --with-framework-name=LibreOfficePython, \ --enable-shared \ + $(if $(filter 1090 101000 101100 101200,$(MAC_OS_X_VERSION_MIN_REQUIRED)),ac_cv_func_utimensat=no) \ + ) \ + $(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_OPENSSL),,-I$(call gb_UnpackedTarball_get_dir,openssl)/include \ - $(if $(DISABLE_OPENSSL),,-I$(call gb_UnpackedTarball_get_dir,openssl)/include)) \ $(if $(SYSTEM_EXPAT),,-I$(call gb_UnpackedTarball_get_dir,expat)/lib) \ $(if $(SYSBASE), -I$(SYSBASE)/usr/include) \ )" \ $(if $(python3_cflags),CFLAGS='$(python3_cflags)') \ $(if $(filter -fsanitize=%,$(CC)),LINKCC="$(CXX) -pthread") \ LDFLAGS="$(strip $(LDFLAGS) \ - $(if $(SYSTEM_OPENSSL),,-L$(call gb_UnpackedTarball_get_dir,openssl)) \ + $(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) \ @@ -107,14 +135,14 @@ python3_fw_prefix=$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@______ $(call gb_ExternalProject_get_state_target,python3,fixscripts) : $(call gb_ExternalProject_get_state_target,python3,build) $(call gb_Output_announce,python3 - remove reference to installroot from scripts,build,CUS,5) $(COMMAND_ECHO)for file in \ - $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/2to3 \ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/2to3-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/easy_install-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/idle$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pip$(PYTHON_VERSION_MAJOR) \ + $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pip$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pydoc$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)-config \ - $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m-config \ - $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pyvenv-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) ; do \ - { rm "$$file" && $(gb_AWK) '\ + ; do { rm "$$file" && $(gb_AWK) '\ BEGIN {print "#!/bin/bash\n\ origpath=$$(pwd)\n\ bindir=$$(cd $$(dirname \"$$0\") ; pwd)\n\ @@ -136,14 +164,11 @@ $(call gb_ExternalProject_get_state_target,python3,fixinstallnames) : $(call gb_ @loader_path/../../../LibreOfficePython $$file ; done touch $@ -# also delete binaries that are symlinked in scp2 $(call gb_ExternalProject_get_state_target,python3,executables) : $(call gb_ExternalProject_get_state_target,python3,build) cd $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin ; \ - for file in python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \ - python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m ; do \ $(INSTALL_NAME_TOOL) -change \ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/LibreOfficePython \ - @executable_path/../LibreOfficePython $$file ; done + @executable_path/../LibreOfficePython python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) touch $@ endif diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk index 5e29cf21b238..3fe3f24bddcb 100644 --- a/external/python3/UnpackedTarball_python3.mk +++ b/external/python3/UnpackedTarball_python3.mk @@ -17,16 +17,11 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,python3,\ $(eval $(call gb_UnpackedTarball_add_patches,python3,\ external/python3/i100492-freebsd.patch.1 \ - $(if $(filter AIX,$(OS)),external/python3/python-3.3.3-aix.patch.1) \ external/python3/python-3.3.0-darwin.patch.1 \ - external/python3/python-3.5.4-ssl.patch.1 \ + external/python3/python-3.7.6-msvc-ssl.patch.1 \ external/python3/python-3.5.4-msvc-disable.patch.1 \ - external/python3/python-3.3.0-pythreadstate.patch.1 \ - external/python3/python-3.3.0-clang.patch.1 \ external/python3/ubsan.patch.0 \ external/python3/python-3.5.tweak.strip.soabi.patch \ - external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1 \ - external/python3/0001-3.6-closes-bpo-42938-Replace-snprintf-with-Python-un.patch.1 \ external/python3/0001-remove-long-double-from-ctypes-value-union.patch.1 \ )) @@ -48,12 +43,4 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3, \ )) endif -ifeq ($(OS),MACOSX) -ifneq ($(filter 1090 101000 101100 101200,$(MAC_OS_X_VERSION_MIN_REQUIRED)),) -$(eval $(call gb_UnpackedTarball_add_patches,python3,\ - external/python3/python3-osx-avoid-new-10.13.patch.1 \ -)) -endif -endif - # vim: set noet sw=4 ts=4: diff --git a/external/python3/i100492-freebsd.patch.1 b/external/python3/i100492-freebsd.patch.1 index 9b4b33729f75..b2ca1ee7117f 100644 --- a/external/python3/i100492-freebsd.patch.1 +++ b/external/python3/i100492-freebsd.patch.1 @@ -1,40 +1,8 @@ FreeBSD porting fixes, patch by maho@openoffice.org ---- python3.orig/Lib/test/test_threading.py 2015-07-05 18:50:07.000000000 +0200 -+++ python3/Lib/test/test_threading.py 2015-07-26 17:03:55.935367820 +0200 -@@ -24,8 +24,8 @@ - # #12316 and #11870), and fork() from a worker thread is known to trigger - # problems with some operating systems (issue #3863): skip problematic tests - # on platforms known to behave badly. --platforms_to_skip = ('freebsd4', 'freebsd5', 'freebsd6', 'netbsd5', -- 'hp-ux11') -+platforms_to_skip = ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'netbsd5', -+ 'os2emx', 'hp-ux11') - - - # A trivial mutable counter. --- Python-3.3.0/Python/thread_pthread.h 2012-11-28 09:00:41.097955124 +0000 +++ Python-3.3.0/Python/thread_pthread.h 2012-11-28 09:01:13.018329351 +0000 -@@ -42,6 +42,10 @@ - #endif - #endif - -+#ifdef __FreeBSD__ -+#include <osreldate.h> -+#endif -+ - /* The POSIX spec says that implementations supporting the sem_* - family of functions must indicate this by defining - _POSIX_SEMAPHORES. */ -@@ -60,7 +64,6 @@ - in default setting. So the process scope is preferred to get - enough number of threads to work. */ - #ifdef __FreeBSD__ --#include <osreldate.h> - #if __FreeBSD_version >= 500000 && __FreeBSD_version < 504101 - #undef PTHREAD_SYSTEM_SCHED_SUPPORTED - #endif -@@ -186,6 +189,9 @@ +@@ -238,6 +238,9 @@ { pthread_t th; int status; @@ -44,11 +12,10 @@ FreeBSD porting fixes, patch by maho@openoffice.org #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) pthread_attr_t attrs; #endif -@@ -214,7 +220,10 @@ - #if defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) - pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM); - #endif -- +@@ -277,6 +280,10 @@ + callback->func = func; + callback->arg = arg; + +#ifdef __FreeBSD__ + sigfillset(&set); + SET_THREAD_SIGMASK(SIG_BLOCK, &set, &oset); @@ -56,9 +23,9 @@ FreeBSD porting fixes, patch by maho@openoffice.org status = pthread_create(&th, #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) &attrs, -@@ -225,6 +234,9 @@ - (void *)arg - ); +@@ -285,6 +292,9 @@ + #endif + pythread_wrapper, callback); +#ifdef __FreeBSD__ + SET_THREAD_SIGMASK(SIG_SETMASK, &oset, NULL); diff --git a/external/python3/internal-zlib.patch.0 b/external/python3/internal-zlib.patch.0 index abe2630bd2e7..27bb737db0c7 100644 --- a/external/python3/internal-zlib.patch.0 +++ b/external/python3/internal-zlib.patch.0 @@ -19,32 +19,32 @@ --- setup.py +++ setup.py -@@ -1362,7 +1362,7 @@ +@@ -1483,7 +1483,7 @@ # # You can upgrade zlib to version 1.1.4 yourself by going to # http://www.gzip.org/zlib/ -- zlib_inc = find_file('zlib.h', [], inc_dirs) +- zlib_inc = find_file('zlib.h', [], self.inc_dirs) + zlib_inc = [os.environ.get('ZLIB_INCDIR')] have_zlib = False if zlib_inc is not None: zlib_h = zlib_inc[0] + '/zlib.h' -@@ -1379,13 +1379,13 @@ +@@ -1500,13 +1500,13 @@ version = line.split()[2] break if version >= version_req: -- if (self.compiler.find_library_file(lib_dirs, 'z')): -+ if (self.compiler.find_library_file(lib_dirs, 'zlib')): - if host_platform == "darwin": +- if (self.compiler.find_library_file(self.lib_dirs, 'z')): ++ if (self.compiler.find_library_file(self.lib_dirs, 'zlib')): + if MACOS: zlib_extra_link_args = ('-Wl,-search_paths_first',) else: zlib_extra_link_args = () - exts.append( Extension('zlib', ['zlibmodule.c'], -- libraries = ['z'], -+ libraries = ['zlib'], - extra_link_args = zlib_extra_link_args)) + self.add(Extension('zlib', ['zlibmodule.c'], +- libraries=['z'], ++ libraries=['zlib'], + extra_link_args=zlib_extra_link_args)) have_zlib = True else: -@@ -1399,7 +1399,7 @@ +@@ -1520,7 +1520,7 @@ # crc32 if we have it. Otherwise binascii uses its own. if have_zlib: extra_compile_args = ['-DUSE_ZLIB_CRC32'] diff --git a/external/python3/python-3.3.0-clang.patch.1 b/external/python3/python-3.3.0-clang.patch.1 deleted file mode 100644 index 9001110fbed4..000000000000 --- a/external/python3/python-3.3.0-clang.patch.1 +++ /dev/null @@ -1,13 +0,0 @@ --*- Mode: diff -*- - ---- python3/setup.py -+++ python3/setup.py -@@ -436,7 +436,7 @@ - if ret >> 8 == 0: - with open(tmpfile) as fp: - for line in fp.readlines(): -- if line.startswith("gcc version"): -+ if line.startswith("gcc version") or line.startswith("clang -cc1 version"): - is_gcc = True - elif line.startswith("#include <...>"): - in_incdirs = True diff --git a/external/python3/python-3.3.0-darwin.patch.1 b/external/python3/python-3.3.0-darwin.patch.1 index d5cb17e339a2..39d3c9180a19 100644 --- a/external/python3/python-3.3.0-darwin.patch.1 +++ b/external/python3/python-3.3.0-darwin.patch.1 @@ -5,7 +5,7 @@ LO needs to build both against MacOSX SDK and not produce universal binaries. diff -ru python3.orig/configure python3/configure --- python3.orig/configure 2015-07-26 17:36:11.808497783 +0200 +++ python3/configure 2015-07-26 17:38:49.016508337 +0200 -@@ -6794,7 +6794,20 @@ +@@ -7385,7 +7385,20 @@ then case "$UNIVERSAL_ARCHS" in 32-bit) @@ -30,7 +30,7 @@ diff -ru python3.orig/configure python3/configure diff -ru python3.orig/Mac/Makefile.in python3/Mac/Makefile.in --- python3.orig/Mac/Makefile.in 2015-07-05 18:50:07.000000000 +0200 +++ python3/Mac/Makefile.in 2015-07-26 17:40:14.860514100 +0200 -@@ -43,7 +43,7 @@ +@@ -44,7 +44,7 @@ INSTALL_SCRIPT= @INSTALL_SCRIPT@ INSTALL_DATA=@INSTALL_DATA@ LN=@LN@ @@ -49,7 +49,7 @@ diff -ru python3.orig/Mac/Resources/app/Info.plist.in python3/Mac/Resources/app/ - <string>Python</string> + <string>LibreOfficePython</string> <key>CFBundleGetInfoString</key> - <string>%version%, (c) 2001-2016 Python Software Foundation.</string> + <string>%version%, (c) 2001-2020 Python Software Foundation.</string> <key>CFBundleHelpBookFolder</key> diff -ru python3.orig/Mac/Resources/framework/Info.plist.in python3/Mac/Resources/framework/Info.plist.in --- python3.orig/Mac/Resources/framework/Info.plist.in 2015-07-05 18:50:07.000000000 +0200 @@ -63,19 +63,3 @@ diff -ru python3.orig/Mac/Resources/framework/Info.plist.in python3/Mac/Resource <key>CFBundleGetInfoString</key> <string>Python Runtime and Library</string> <key>CFBundleIdentifier</key> -diff -ru python3.orig/setup.py python3/setup.py ---- python3.orig/setup.py 2015-07-26 17:36:11.804497783 +0200 -+++ python3/setup.py 2015-07-26 17:39:48.599512337 +0200 -@@ -468,11 +468,11 @@ - # Ensure that /usr/local is always used, but the local build - # directories (i.e. '.' and 'Include') must be first. See issue - # 10520. -- if not cross_compiling: -+ if not cross_compiling and host_platform != 'darwin': - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') - # only change this for cross builds for 3.3, issues on Mageia -- if cross_compiling: -+ if cross_compiling or host_platform == 'darwin': - self.add_gcc_paths() - self.add_multiarch_paths() diff --git a/external/python3/python-3.3.0-pythreadstate.patch.1 b/external/python3/python-3.3.0-pythreadstate.patch.1 deleted file mode 100644 index 66350e2c8112..000000000000 --- a/external/python3/python-3.3.0-pythreadstate.patch.1 +++ /dev/null @@ -1,15 +0,0 @@ -disable a check in PyThreadState_Swap that is hopefully not a "real" problem - ---- python3/Python/pystate.c 2013-04-17 22:45:00.799800000 +0200 -+++ python3/Python/pystate.c 2013-04-17 22:46:53.743800000 +0200 -@@ -437,7 +437,9 @@ - to be used for a thread. Check this the best we can in debug - builds. - */ --#if defined(Py_DEBUG) && defined(WITH_THREAD) -+#if defined(Py_DEBUG) && defined(WITH_THREAD) && 0 -+ /* disable this for LO - it is triggered by nested PyThreadAttach -+ which do not appear to be a real problem */ - if (newts) { - /* This can be called from PyEval_RestoreThread(). Similar - to it, we need to ensure errno doesn't change. diff --git a/external/python3/python-3.3.3-aix.patch.1 b/external/python3/python-3.3.3-aix.patch.1 deleted file mode 100644 index 571d69a88f6b..000000000000 --- a/external/python3/python-3.3.3-aix.patch.1 +++ /dev/null @@ -1,146 +0,0 @@ -build with GCC on AIX - -diff -ru python3.orig/configure python3/configure ---- python3.orig/configure 2015-07-26 17:10:18.218393484 +0200 -+++ python3/configure 2015-07-26 17:29:44.460471779 +0200 -@@ -3534,8 +3534,6 @@ - else - - case $ac_sys_system in -- AIX*) CC=${CC:-xlc_r} -- without_gcc=;; - *) without_gcc=no;; - esac - fi -@@ -5787,10 +5785,18 @@ - PY3LIBRARY=libpython3.so - fi - ;; -- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) -+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|AIX*) - LDLIBRARY='libpython$(LDVERSION).so' -- BLDLIBRARY='-L. -lpython$(LDVERSION)' -- RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} -+ case $ac_sys_system in -+ AIX*) -+ BLDLIBRARY='-Wl,-brtl -L. -lpython$(LDVERSION)' -+ RUNSHARED=LIBPATH=`pwd`:${LIBPATH} -+ ;; -+ *) -+ BLDLIBRARY='-L. -lpython$(LDVERSION)' -+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} -+ ;; -+ esac - INSTSONAME="$LDLIBRARY".$SOVERSION - if test "$with_pydebug" != yes - then -@@ -8789,8 +8795,13 @@ - then - case $ac_sys_system/$ac_sys_release in - AIX*) -- BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp" -- LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp" -+ if test "$GCC" = "yes"; then -+ LDSHARED='$(CC) -shared' -+ BLDSHARED='$(CC) -Wl,-brtl -shared' -+ else -+ BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp" -+ LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp" -+ fi - ;; - IRIX/5*) LDSHARED="ld -shared";; - IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";; -diff -ru python3.orig/configure.ac python3/configure.ac ---- python3.orig/configure.ac 2015-07-05 18:50:08.000000000 +0200 -+++ python3/configure.ac 2015-07-26 17:32:10.445481579 +0200 -@@ -587,8 +587,6 @@ - without_gcc=$withval;; - esac], [ - case $ac_sys_system in -- AIX*) CC=${CC:-xlc_r} -- without_gcc=;; - *) without_gcc=no;; - esac]) - AC_MSG_RESULT($without_gcc) -@@ -1090,10 +1088,18 @@ - PY3LIBRARY=libpython3.so - fi - ;; -- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) -+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|AIX*)Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) - LDLIBRARY='libpython$(LDVERSION).so' -- BLDLIBRARY='-L. -lpython$(LDVERSION)' -- RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} -+ case $ac_sys_system in -+ AIX*) -+ BLDLIBRARY='-Wl,-brtl -L. -lpython$(LDVERSION)' -+ RUNSHARED=LIBPATH=`pwd`:${LIBPATH} -+ ;; -+ *) -+ BLDLIBRARY='-L. -lpython$(LDVERSION)' -+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} -+ ;; -+ esac - INSTSONAME="$LDLIBRARY".$SOVERSION - if test "$with_pydebug" != yes - then -@@ -2164,8 +2170,13 @@ - then - case $ac_sys_system/$ac_sys_release in - AIX*) -- BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp" -- LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp" -+ if test "$GCC" = "yes"; then -+ LDSHARED='$(CC) -shared' -+ BLDSHARED='$(CC) -Wl,-brtl -shared' -+ else -+ BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp" -+ LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp" -+ fi - ;; - IRIX/5*) LDSHARED="ld -shared";; - IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";; -diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in ---- python3.orig/Makefile.pre.in 2015-07-05 18:50:07.000000000 +0200 -+++ python3/Makefile.pre.in 2015-07-26 17:34:00.386488960 +0200 -@@ -598,14 +598,17 @@ - - libpython$(LDVERSION).so: $(LIBRARY_OBJS) - if test $(INSTSONAME) != $(LDLIBRARY); then \ -- $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -+ $(BLDSHARED) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ - $(LN) -f $(INSTSONAME) $@; \ - else \ - $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ - fi - - libpython3.so: libpython$(LDVERSION).so -- $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^ -+ if [ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" != "aix" ]; then \ -+ SONAME="-Wl,-h$@"; \ -+ fi; \ -+ $(BLDSHARED) $(NO_AS_NEEDED) -o $@ $(SONAME) $^ - - libpython$(LDVERSION).dylib: $(LIBRARY_OBJS) - $(CC) -dynamiclib -Wl,-single_module $(PY_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -@@ -1299,6 +1305,8 @@ - export PATH; PATH="`pwd`:$$PATH"; \ - export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ - export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \ -+ export LD_LIBRARY_PATH; LD_LIBRARY_PATH="`pwd`${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"; \ -+ export LIBPATH; LIBPATH="`pwd`${LIBPATH:+:$LIBPATH}"; \ - export EXE; EXE="$(BUILDEXE)"; \ - if [ -n "$(MULTIARCH)" ]; then export MULTIARCH; MULTIARCH=$(MULTIARCH); fi; \ - export PYTHON_FOR_BUILD; \ -diff -ru python3.orig/Modules/Setup.dist python3/Modules/Setup.dist ---- python3.orig/Modules/Setup.dist 2015-07-05 18:50:07.000000000 +0200 -+++ python3/Modules/Setup.dist 2015-07-26 17:34:27.951490811 +0200 -@@ -181,7 +181,7 @@ - #_bisect _bisectmodule.c # Bisection algorithms - #_heapq _heapqmodule.c # Heap queue algorithm - --#unicodedata unicodedata.c # static Unicode character database -+unicodedata unicodedata.c # static Unicode character database - - - # Modules with some UNIX dependencies -- on by default: diff --git a/external/python3/python-3.3.3-disable-obmalloc.patch.0 b/external/python3/python-3.3.3-disable-obmalloc.patch.0 index a162298d4971..c4a1dea61ecf 100644 --- a/external/python3/python-3.3.3-disable-obmalloc.patch.0 +++ b/external/python3/python-3.3.3-disable-obmalloc.patch.0 @@ -1,17 +1,6 @@ ---- Include/objimpl.h -+++ Include/objimpl.h -@@ -250,7 +250,7 @@ - union _gc_head *gc_prev; - Py_ssize_t gc_refs; - } gc; -- double dummy; /* force worst-case alignment */ -+ long double dummy; /* force worst-case alignment */ - } PyGC_Head; - - extern PyGC_Head *_PyGC_generation0; --- Objects/obmalloc.c +++ Objects/obmalloc.c -@@ -413,8 +413,8 @@ +@@ -712,8 +712,8 @@ #ifdef WITH_PYMALLOC @@ -21,12 +10,12 @@ /* If we're using GCC, use __builtin_expect() to reduce overhead of the valgrind checks */ -@@ -1181,7 +1181,7 @@ +@@ -1430,7 +1430,7 @@ #ifdef WITH_VALGRIND - if (UNLIKELY(running_on_valgrind == -1)) + if (UNLIKELY(running_on_valgrind == -1)) { - running_on_valgrind = RUNNING_ON_VALGRIND; + running_on_valgrind = 1; - if (UNLIKELY(running_on_valgrind)) - goto redirect; - #endif + } + if (UNLIKELY(running_on_valgrind)) { + return NULL; diff --git a/external/python3/python-3.3.3-elf-rpath.patch.1 b/external/python3/python-3.3.3-elf-rpath.patch.1 index 029d98c0310d..a408858f5917 100644 --- a/external/python3/python-3.3.3-elf-rpath.patch.1 +++ b/external/python3/python-3.3.3-elf-rpath.patch.1 @@ -5,18 +5,16 @@ set RPATH (only to be used on ELF platforms) diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in --- python3.orig/Makefile.pre.in 2015-07-26 20:29:07.126194320 +0200 +++ python3/Makefile.pre.in 2015-07-26 20:37:21.814227530 +0200 -@@ -550,7 +550,7 @@ +@@ -566,7 +566,7 @@ # Build the interpreter $(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) -- $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) -+ $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) -Wl,-rpath,\$$ORIGIN +- $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) ++ $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) -Wl,-rpath,\$$ORIGIN platform: $(BUILDPYTHON) pybuilddir.txt - $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform ---- python3.orig/Makefile.pre.in 2015-07-05 18:50:07.000000000 +0200 -+++ python3/Makefile.pre.in 2015-07-26 17:34:00.386488960 +0200 -@@ -607,7 +607,7 @@ + $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform +@@ -628,7 +628,7 @@ fi libpython3.so: libpython$(LDVERSION).so @@ -24,5 +22,4 @@ diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in + $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^ -Wl,-rpath,\$$ORIGIN libpython$(LDVERSION).dylib: $(LIBRARY_OBJS) - $(CC) -dynamiclib -Wl,-single_module $(PY_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ - + $(CC) -dynamiclib -Wl,-single_module $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \ diff --git a/external/python3/python-3.5.4-msvc-disable.patch.1 b/external/python3/python-3.5.4-msvc-disable.patch.1 index 54b2a5f46540..d5b4e3f6264b 100644 --- a/external/python3/python-3.5.4-msvc-disable.patch.1 +++ b/external/python3/python-3.5.4-msvc-disable.patch.1 @@ -3,7 +3,7 @@ Disable some stuff LO does not need, especially stuff with external dependencies diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln --- python3.orig/PCbuild/pcbuild.sln 2017-08-10 00:04:44.359879894 +0200 +++ python3/PCbuild/pcbuild.sln 2017-08-10 00:13:51.179873748 +0200 -@@ -12,8 +12,6 @@ +@@ -15,8 +15,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" EndProject @@ -12,7 +12,7 @@ diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winsound", "winsound.vcxproj", "{28B5D777-DDF2-4B6B-B34F-31D938813856}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_decimal", "_decimal.vcxproj", "{0E9791DB-593A-465F-98BC-681011311617}" -@@ -28,32 +26,18 @@ +@@ -31,34 +29,20 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_socket", "_socket.vcxproj", "{86937F53-C189-40EF-8CE8-8759D8E7D480}" EndProject @@ -22,6 +22,8 @@ diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcxproj", "{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}" EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testinternalcapi", "_testinternalcapi.vcxproj", "{900342D7-516A-4469-B1AD-59A66E49A25F}" + EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testimportmultiple", "_testimportmultiple.vcxproj", "{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_tkinter", "_tkinter.vcxproj", "{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}" @@ -45,17 +47,12 @@ diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_multiprocessing", "_multiprocessing.vcxproj", "{9E48B300-37D1-11DD-8C41-005056C00008}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python3dll", "python3dll.vcxproj", "{885D4898-D08D-4091-9C40-C700CFE3FC5A}" -@@ -80,12 +64,6 @@ +@@ -93,8 +77,6 @@ EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testmultiphase", "_testmultiphase.vcxproj", "{16BFE6F0-22EF-40B5-B831-7E937119EF10}" + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_queue", "_queue.vcxproj", "{78D80A15-BD8C-44E2-B49E-1F05B0A0A687}" EndProject --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tcl", "tcl.vcxproj", "{B5FD6F1D-129E-4BFF-9340-03606FAC7283}" --EndProject --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tix", "tix.vcxproj", "{C5A3E7FB-9695-4B2E-960B-1D9F43F1E555}" --EndProject --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tk", "tk.vcxproj", "{7E85ECCF-A72C-4DA4-9E52-884508E80BA1}" +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblzma", "liblzma.vcxproj", "{12728250-16EC-4DC6-94D7-E21DD88947F8}" -EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyshellext", "pyshellext.vcxproj", "{0F6EE4A4-C75F-4578-B4B3-2D64F4B9B782}" + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python_uwp", "python_uwp.vcxproj", "{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}" EndProject - Global -Only in python3/PCbuild: pcbuild.sln~ + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "venvlauncher", "venvlauncher.vcxproj", "{494BAC80-A60C-43A9-99E7-ACB691CE2C4D}" diff --git a/external/python3/python-3.5.4-ssl.patch.1 b/external/python3/python-3.5.4-ssl.patch.1 deleted file mode 100644 index beb6fe38882f..000000000000 --- a/external/python3/python-3.5.4-ssl.patch.1 +++ /dev/null @@ -1,83 +0,0 @@ --*- Mode: diff -*- - -Tweak SSL build to find OpenSSL in workdir & not build it itself in "ssl.vcproj" etc. - -diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln ---- python3.orig/PCbuild/pcbuild.sln 2017-08-09 23:39:15.511897077 +0200 -+++ python3/PCbuild/pcbuild.sln 2017-08-09 23:48:41.375890717 +0200 -@@ -86,10 +86,6 @@ - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tk", "tk.vcxproj", "{7E85ECCF-A72C-4DA4-9E52-884508E80BA1}" - EndProject --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libeay", "libeay.vcxproj", "{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}" --EndProject --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssleay", "ssleay.vcxproj", "{10615B24-73BF-4EFA-93AA-236916321317}" --EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyshellext", "pyshellext.vcxproj", "{0F6EE4A4-C75F-4578-B4B3-2D64F4B9B782}" - EndProject - Global -diff -ru python3.orig/PCbuild/_ssl.vcxproj python3/PCbuild/_ssl.vcxproj ---- python3.orig/PCbuild/_ssl.vcxproj 2017-08-07 09:59:11.000000000 +0200 -+++ python3/PCbuild/_ssl.vcxproj 2017-08-09 23:50:36.871889419 +0200 -@@ -1,4 +1,4 @@ --<?xml version="1.0" encoding="utf-8"?>
-+<?xml version="1.0" encoding="utf-8"?>
- <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
-@@ -61,10 +61,10 @@ - </PropertyGroup>
- <ItemDefinitionGroup>
- <ClCompile>
-- <AdditionalIncludeDirectories>$(opensslIncludeDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-+ <AdditionalIncludeDirectories>$(WORKDIR)/UnpackedTarball/openssl/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- <Link>
-- <AdditionalDependencies>ws2_32.lib;crypt32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies)</AdditionalDependencies>
-+ <AdditionalDependencies>ws2_32.lib;crypt32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\libeay32.lib;$(WORKDIR)\UnpackedTarball\openssl\out32dll\ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
-@@ -78,14 +78,6 @@ - <Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
-- <ProjectReference Include="libeay.vcxproj">
-- <Project>{e5b04cc0-eb4c-42ab-b4dc-18ef95f864b0}</Project>
-- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-- </ProjectReference>
-- <ProjectReference Include="ssleay.vcxproj">
-- <Project>{10615b24-73bf-4efa-93aa-236916321317}</Project>
-- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-- </ProjectReference>
- <ProjectReference Include="_socket.vcxproj">
- <Project>{86937f53-c189-40ef-8ce8-8759d8e7d480}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-diff -ru python3.orig/setup.py python3/setup.py ---- python3.orig/setup.py 2017-08-09 23:39:15.495897077 +0200 -+++ python3/setup.py 2017-08-09 23:53:06.891887733 +0200 -@@ -807,7 +807,10 @@ - exts.append( Extension('_socket', ['socketmodule.c'], - depends = ['socketmodule.h']) ) - # Detect SSL support for the socket module (via _ssl) -+ ooosslinc = os.environ.get('WORKDIR') + \ -+ '/UnpackedTarball/openssl/include/' - search_for_ssl_incs_in = [ -+ ooosslinc, - '/usr/local/ssl/include', - '/usr/contrib/ssl/include/' - ] -@@ -819,8 +822,12 @@ - ['/usr/kerberos/include']) - if krb5_h: - ssl_incs += krb5_h -+ ooossllib = os.environ.get('WORKDIR') + \ -+ '/UnpackedTarball/openssl' -+ ooosslinc = ooosslinc + '/' - ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, -- ['/usr/local/ssl/lib', -+ [ooossllib, -+ '/usr/local/ssl/lib', - '/usr/contrib/ssl/lib/' - ] ) - diff --git a/external/python3/python-3.5.tweak.strip.soabi.patch b/external/python3/python-3.5.tweak.strip.soabi.patch index 48ac7f82f8be..4c2bb2bb9a29 100644 --- a/external/python3/python-3.5.tweak.strip.soabi.patch +++ b/external/python3/python-3.5.tweak.strip.soabi.patch @@ -1,7 +1,7 @@ diff -ru python3.orig/configure python3/configure --- misc/python3.orig/configure 2015-07-26 21:14:31.127377193 +0200 +++ misc/python3/configure 2015-07-26 21:21:34.975405648 +0200 -@@ -14388,7 +14388,7 @@ +@@ -15229,7 +15229,7 @@ $as_echo "$ABIFLAGS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5 $as_echo_n "checking SOABI... " >&6; } diff --git a/external/python3/python-3.7.6-msvc-ssl.patch.1 b/external/python3/python-3.7.6-msvc-ssl.patch.1 new file mode 100644 index 000000000000..17cc440f2204 --- /dev/null +++ b/external/python3/python-3.7.6-msvc-ssl.patch.1 @@ -0,0 +1,25 @@ +No use for applink.c OPENSSL_Applink, everything is compiled with the same MSVC + +--- python3/PCbuild/_ssl.vcxproj.orig2 2019-12-23 15:54:19.254298900 +0100 ++++ python3/PCbuild/_ssl.vcxproj 2019-12-23 15:54:24.693251200 +0100 +@@ -99,9 +99,6 @@ + </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\Modules\_ssl.c" />
+- <ClCompile Include="$(opensslIncludeDir)\applink.c">
+- <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(PreprocessorDefinitions)</PreprocessorDefinitions>
+- </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="..\PC\python_nt.rc" />
+--- python3/PCbuild/openssl.props.orig 2019-12-23 16:20:34.588135900 +0100 ++++ python3/PCbuild/openssl.props 2019-12-23 16:20:51.074001300 +0100 +@@ -6,8 +6,6 @@ + </ItemDefinitionGroup>
+ <PropertyGroup>
+ <_DLLSuffix>-1_1</_DLLSuffix>
+- <_DLLSuffix Condition="$(Platform) == 'ARM'">$(_DLLSuffix)-arm</_DLLSuffix>
+- <_DLLSuffix Condition="$(Platform) == 'ARM64'">$(_DLLSuffix)-arm64</_DLLSuffix>
+ </PropertyGroup>
+ <ItemGroup>
+ <_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).dll" />
diff --git a/external/python3/python3-osx-avoid-new-10.13.patch.1 b/external/python3/python3-osx-avoid-new-10.13.patch.1 deleted file mode 100644 index 93bf5a078e01..000000000000 --- a/external/python3/python3-osx-avoid-new-10.13.patch.1 +++ /dev/null @@ -1,61 +0,0 @@ --*- Mode: Diff -*- - ---- python3/Modules/posixmodule.c -+++ python3/Modules/posixmodule.c -@@ -4565,12 +4565,12 @@ - } \ - - --#if defined(HAVE_FUTIMESAT) || defined(HAVE_UTIMENSAT) -+#if defined(HAVE_FUTIMESAT) - - static int - utime_dir_fd(utime_t *ut, int dir_fd, char *path, int follow_symlinks) - { --#ifdef HAVE_UTIMENSAT -+#if 0 - int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW; - UTIME_TO_TIMESPEC; - return utimensat(dir_fd, path, time, flags); -@@ -4591,12 +4591,12 @@ - #define FUTIMENSAT_DIR_FD_CONVERTER dir_fd_unavailable - #endif - --#if defined(HAVE_FUTIMES) || defined(HAVE_FUTIMENS) -+#if defined(HAVE_FUTIMES) - - static int - utime_fd(utime_t *ut, int fd) - { --#ifdef HAVE_FUTIMENS -+#if 0 - UTIME_TO_TIMESPEC; - return futimens(fd, time); - #else -@@ -4619,7 +4619,7 @@ - static int - utime_nofollow_symlinks(utime_t *ut, char *path) - { --#ifdef HAVE_UTIMENSAT -+#if 0 - UTIME_TO_TIMESPEC; - return utimensat(DEFAULT_DIR_FD, path, time, AT_SYMLINK_NOFOLLOW); - #else -@@ -4635,7 +4635,7 @@ - static int - utime_default(utime_t *ut, char *path) - { --#ifdef HAVE_UTIMENSAT -+#if 0 - UTIME_TO_TIMESPEC; - return utimensat(DEFAULT_DIR_FD, path, time, 0); - #elif defined(HAVE_UTIMES) -@@ -4836,7 +4836,7 @@ - else - #endif - --#if defined(HAVE_FUTIMESAT) || defined(HAVE_UTIMENSAT) -+#if defined(HAVE_FUTIMESAT) - if ((dir_fd != DEFAULT_DIR_FD) || (!follow_symlinks)) - result = utime_dir_fd(&utime, dir_fd, path->narrow, follow_symlinks); - else diff --git a/external/python3/ubsan.patch.0 b/external/python3/ubsan.patch.0 index 36d2acf1c947..d44fbe055c86 100644 --- a/external/python3/ubsan.patch.0 +++ b/external/python3/ubsan.patch.0 @@ -1,25 +1,3 @@ ---- Modules/_ctypes/libffi/src/x86/ffi64.c -+++ Modules/_ctypes/libffi/src/x86/ffi64.c -@@ -548,11 +548,15 @@ - tramp = (volatile unsigned short *) &closure->tramp[0]; - - tramp[0] = 0xbb49; /* mov <code>, %r11 */ -- *((unsigned long long * volatile) &tramp[1]) -- = (unsigned long) ffi_closure_unix64; -+ tramp[1] = (unsigned long) ffi_closure_unix64; -+ tramp[2] = ((unsigned long) ffi_closure_unix64) >> 16; -+ tramp[3] = ((unsigned long) ffi_closure_unix64) >> 32; -+ tramp[4] = ((unsigned long) ffi_closure_unix64) >> 48; - tramp[5] = 0xba49; /* mov <data>, %r10 */ -- *((unsigned long long * volatile) &tramp[6]) -- = (unsigned long) codeloc; -+ tramp[6] = (unsigned long) codeloc; -+ tramp[7] = ((unsigned long) codeloc) >> 16; -+ tramp[8] = ((unsigned long) codeloc) >> 32; -+ tramp[9] = ((unsigned long) codeloc) >> 48; - - /* Set the carry bit iff the function uses any sse registers. - This is clc or stc, together with the first byte of the jmp. */ --- Modules/_ctypes/libffi_osx/x86/x86-ffi64.c +++ Modules/_ctypes/libffi_osx/x86/x86-ffi64.c @@ -599,9 +599,15 @@ @@ -40,3 +18,26 @@ /* Set the carry bit if the function uses any sse registers. This is clc or stc, together with the first byte of the jmp. */ +--- Modules/posixmodule.c ++++ Modules/posixmodule.c +@@ -13998,6 +13998,9 @@ + }; + + static int ++#if defined __clang__ ++__attribute__((no_sanitize("shift-base"))) // MFD_HUGE_16GB in /usr/include/linux/memfd.h ++#endif + all_ins(PyObject *m) + { + #ifdef F_OK +--- Objects/listobject.c ++++ Objects/listobject.c +@@ -554,7 +554,7 @@ + dest[i] = v; + } + src = b->ob_item; +- dest = np->ob_item + Py_SIZE(a); ++ dest = Py_SIZE(a) == 0 ? np->ob_item : np->ob_item + Py_SIZE(a); + for (i = 0; i < Py_SIZE(b); i++) { + PyObject *v = src[i]; + Py_INCREF(v); diff --git a/external/zlib/UnpackedTarball_zlib.mk b/external/zlib/UnpackedTarball_zlib.mk index fa476b918b7c..dd9fc1c31445 100644 --- a/external/zlib/UnpackedTarball_zlib.mk +++ b/external/zlib/UnpackedTarball_zlib.mk @@ -16,4 +16,6 @@ $(eval $(call gb_UnpackedTarball_set_post_action,zlib,\ cp $(addsuffix .c,adler32 compress crc32 deflate inffast inflate inftrees trees zutil) x64 \ )) +$(eval $(call gb_UnpackedTarball_set_patchlevel,zlib,0)) + # vim: set noet sw=4 ts=4: |