summaryrefslogtreecommitdiffstats
path: root/external/openssl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
commit267c6f2ac71f92999e969232431ba04678e7437e (patch)
tree358c9467650e1d0a1d7227a21dac2e3d08b622b2 /external/openssl
parentInitial commit. (diff)
downloadlibreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz
libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'external/openssl')
-rw-r--r--external/openssl/ExternalPackage_openssl.mk29
-rw-r--r--external/openssl/ExternalProject_openssl.mk98
-rw-r--r--external/openssl/Makefile7
-rw-r--r--external/openssl/Module_openssl.mk18
-rw-r--r--external/openssl/README7
-rw-r--r--external/openssl/UnpackedTarball_openssl.mk21
-rw-r--r--external/openssl/configurable-z-option.patch.034
-rw-r--r--external/openssl/openssl-no-ipc-cmd.patch.060
-rw-r--r--external/openssl/openssl-no-multilib.patch.038
-rw-r--r--external/openssl/system-cannot-find-path-for-move.patch.011
10 files changed, 323 insertions, 0 deletions
diff --git a/external/openssl/ExternalPackage_openssl.mk b/external/openssl/ExternalPackage_openssl.mk
new file mode 100644
index 0000000000..7d02dfc6ed
--- /dev/null
+++ b/external/openssl/ExternalPackage_openssl.mk
@@ -0,0 +1,29 @@
+# -*- 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,openssl,openssl))
+
+$(eval $(call gb_ExternalPackage_use_external_project,openssl,openssl))
+
+ifeq ($(COM),MSC)
+$(eval $(call gb_ExternalPackage_add_files,openssl,$(LIBO_LIB_FOLDER),\
+ libcrypto-3.dll \
+ libssl-3.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-3.dll \
+ libssl-3.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
new file mode 100644
index 0000000000..d197721d02
--- /dev/null
+++ b/external/openssl/ExternalProject_openssl.mk
@@ -0,0 +1,98 @@
+# -*- 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,openssl))
+
+$(eval $(call gb_ExternalProject_register_targets,openssl,\
+ build \
+))
+
+# For multi-line conditionals, align the $(if and the corresponding ),
+# putting the latter on a line of its own. Also put the "else" comma
+# on a line of its own. Hopefully should make the logic more clear.
+
+OPENSSL_PLATFORM := \
+ $(if $(filter LINUX FREEBSD ANDROID,$(OS)),\
+ $(if $(filter INTEL,$(CPUNAME)),\
+ $(if $(filter GNU/kFreeBSD,$(shell uname)),debian-kfreebsd-i386,linux-elf)\
+ ,\
+ $(if $(filter X86_64,$(CPUNAME)),\
+ $(if $(filter GNU/kFreeBSD,$(shell uname)),\
+ debian-kfreebsd-amd64\
+ ,\
+ $(if $(filter TRUE, $(ENABLE_DBGUTIL)), debug-linux-generic64, linux-generic64) no-asm\
+ )\
+ ,\
+ $(if $(filter TRUE, $(ENABLE_DBGUTIL)), debug-linux-generic32, linux-generic32)\
+ )\
+ )\
+ ,\
+ $(if $(filter SOLARIS,$(OS)),\
+ $(if $(filter INTEL,$(CPUNAME)),solaris-x86-cc,\
+ $(if $(filter X86_64,$(CPUNAME)),solaris64-x86_64-cc,solaris-sparcv9-cc)\
+ )\
+ ,\
+ $(if $(filter iOS,$(OS)),\
+ ios-aarch64\
+ ,\
+ $(if $(filter WNT,$(OS)),\
+ $(if $(filter INTEL,$(CPUNAME)),VC-WIN32)\
+ $(if $(filter X86_64,$(CPUNAME)),VC-WIN64A)\
+ $(if $(filter AARCH64,$(CPUNAME)),VC-WIN64-ARM)\
+ ,\
+ $(if $(filter MACOSX,$(OS)),\
+ $(if $(filter X86_64,$(CPUNAME)),darwin64-x86_64-cc)\
+ $(if $(filter AARCH64,$(CPUNAME)),darwin64-arm64-cc)\
+ ,\
+ $(if $(filter EMSCRIPTEN,$(OS)),no-engine no-dso no-dgram no-srtp no-err no-ocsp no-psk no-ts no-asm) \
+ )\
+ )\
+ )\
+ )\
+ )
+
+ifeq ($(COM),MSC)
+$(eval $(call gb_ExternalProject_use_nmake,openssl,build))
+
+$(call gb_ExternalProject_get_state_target,openssl,build):
+ $(call gb_Trace_StartRange,openssl,EXTERNAL)
+ $(call gb_ExternalProject_run,build,\
+ CONFIGURE_INSIST=1 $(PERL) Configure $(OPENSSL_PLATFORM) no-tests no-multilib \
+ && export PERL="$(shell cygpath -w $(PERL))" \
+ && nmake -f makefile \
+ $(if $(call gb_Module__symbols_enabled,openssl),DEBUG_FLAGS_VALUE="$(gb_DEBUGINFO_FLAGS)") \
+ )
+ $(call gb_Trace_EndRange,openssl,EXTERNAL)
+
+else
+$(call gb_ExternalProject_get_state_target,openssl,build):
+ $(call gb_Trace_StartRange,openssl,EXTERNAL)
+ $(call gb_ExternalProject_run,build,\
+ unset MAKEFLAGS && \
+ $(if $(filter LINUX MACOSX FREEBSD ANDROID SOLARIS iOS,$(OS)), \
+ ./Configure, \
+ $(if $(filter WNT,$(OS)), \
+ $(PERL) Configure, \
+ ./config)) \
+ $(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 -fsanitize=undefined,$(CC)),-fno-sanitize=function) \
+ $(if $(filter TRUE, $(ENABLE_DBGUTIL)), -DPURIFY,) \
+ $(if $(filter-out WNT MACOSX,$(OS)),-fvisibility=hidden)" \
+ && ln -s . lib \
+ )
+ $(call gb_Trace_EndRange,openssl,EXTERNAL)
+# symlink lib dir for python3
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/openssl/Makefile b/external/openssl/Makefile
new file mode 100644
index 0000000000..e4968cf85f
--- /dev/null
+++ b/external/openssl/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/openssl/Module_openssl.mk b/external/openssl/Module_openssl.mk
new file mode 100644
index 0000000000..7a03fe5364
--- /dev/null
+++ b/external/openssl/Module_openssl.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,openssl))
+
+$(eval $(call gb_Module_add_targets,openssl,\
+ UnpackedTarball_openssl \
+ ExternalPackage_openssl \
+ ExternalProject_openssl \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/openssl/README b/external/openssl/README
new file mode 100644
index 0000000000..eda5e7eb17
--- /dev/null
+++ b/external/openssl/README
@@ -0,0 +1,7 @@
+Open Source toolkit implementing SSL and TLS.
+
+From [https://www.openssl.org/].
+
+SSL = Secure Sockets Layer (SSL v2/v3) protocol.
+TLS = Transport Layer Security (TLS v1) protocol.
+
diff --git a/external/openssl/UnpackedTarball_openssl.mk b/external/openssl/UnpackedTarball_openssl.mk
new file mode 100644
index 0000000000..2a8f3bb3f9
--- /dev/null
+++ b/external/openssl/UnpackedTarball_openssl.mk
@@ -0,0 +1,21 @@
+# -*- 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,openssl))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,openssl,$(OPENSSL_TARBALL),,openssl))
+
+$(eval $(call gb_UnpackedTarball_add_patches,openssl,\
+ external/openssl/openssl-no-multilib.patch.0 \
+ external/openssl/configurable-z-option.patch.0 \
+ external/openssl/openssl-no-ipc-cmd.patch.0 \
+ external/openssl/system-cannot-find-path-for-move.patch.0 \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/openssl/configurable-z-option.patch.0 b/external/openssl/configurable-z-option.patch.0
new file mode 100644
index 0000000000..d9478b6a97
--- /dev/null
+++ b/external/openssl/configurable-z-option.patch.0
@@ -0,0 +1,34 @@
+--- Configurations/10-main.conf.sav 2023-09-19 22:02:31.000000000 +0900
++++ Configurations/10-main.conf 2023-09-30 23:47:49.734377000 +0900
+@@ -14,7 +14,7 @@
+ } elsif ($disabled{asm}) {
+ # assembler is still used to compile uplink shim
+ $vc_win64a_info = { AS => "ml64",
+- ASFLAGS => "/nologo /Zi",
++ ASFLAGS => "/nologo $$(DEBUG_FLAGS_VALUE)",
+ asflags => "/c /Cp /Cx",
+ asoutflag => "/Fo",
+ perlasm_scheme => "masm" };
+@@ -44,7 +44,7 @@
+ } elsif ($disabled{asm}) {
+ # not actually used, uplink shim is inlined into C code
+ $vc_win32_info = { AS => "ml",
+- ASFLAGS => "/nologo /Zi",
++ ASFLAGS => "/nologo $$(DEBUG_FLAGS_VALUE)",
+ asflags => "/Cp /coff /c /Cx",
+ asoutflag => "/Fo",
+ perlasm_scheme => "win32" };
+@@ -1333,10 +1333,10 @@
+ "UNICODE", "_UNICODE",
+ "_CRT_SECURE_NO_DEPRECATE",
+ "_WINSOCK_DEPRECATED_NO_WARNINGS"),
+- lib_cflags => add("/Zi /Fdossl_static.pdb"),
++ lib_cflags => add("\$(DEBUG_FLAGS_VALUE)"),
+ lib_defines => add("L_ENDIAN"),
+- dso_cflags => "/Zi /Fddso.pdb",
+- bin_cflags => "/Zi /Fdapp.pdb",
++ dso_cflags => "\$(DEBUG_FLAGS_VALUE)",
++ bin_cflags => "\$(DEBUG_FLAGS_VALUE)",
+ # def_flag made to empty string so a .def file gets generated
+ shared_defflag => '',
+ shared_ldflag => "/dll",
diff --git a/external/openssl/openssl-no-ipc-cmd.patch.0 b/external/openssl/openssl-no-ipc-cmd.patch.0
new file mode 100644
index 0000000000..8c6b2c58d6
--- /dev/null
+++ b/external/openssl/openssl-no-ipc-cmd.patch.0
@@ -0,0 +1,60 @@
+--- util/perl/OpenSSL/config.pm 2022-09-08 11:45:57.408532119 +0100
++++ util/perl/OpenSSL/config.pm 2022-09-08 11:47:46.877590711 +0100
+@@ -16,7 +16,7 @@
+ use Getopt::Std;
+ use File::Basename;
+ use File::Spec;
+-use IPC::Cmd;
++# use IPC::Cmd;
+ use POSIX;
+ use Config;
+ use Carp;
+@@ -205,7 +205,8 @@
+
+ # Look for ISC/SCO with its unique uname program
+ sub is_sco_uname {
+- return undef unless IPC::Cmd::can_run('uname');
++ return undef;
++# return undef unless IPC::Cmd::can_run('uname');
+
+ open UNAME, "uname -X 2>/dev/null|" or return '';
+ my $line = "";
+@@ -303,13 +304,13 @@
+ $CCVENDOR = ''; # Dunno, don't care (unless found later)
+
+ # Find a compiler if we don't already have one
+- if ( ! $cc ) {
+- foreach (@c_compilers) {
+- next unless IPC::Cmd::can_run("$CROSS_COMPILE$_");
+- $CC = $_;
+- last;
+- }
+- }
++# if ( ! $cc ) {
++# foreach (@c_compilers) {
++# next unless IPC::Cmd::can_run("$CROSS_COMPILE$_");
++# $CC = $_;
++# last;
++# }
++# }
+
+ if ( $CC ) {
+ # Find the compiler vendor and version number for certain compilers
+--- util/perl/OpenSSL/config.pm.orig 2022-11-08 12:54:59.751298823 +0100
++++ util/perl/OpenSSL/config.pm 2022-11-08 12:55:16.436287053 +0100
+@@ -52,13 +52,13 @@
+ my @cc_version =
+ (
+ clang => sub {
+- return undef unless IPC::Cmd::can_run("$CROSS_COMPILE$CC");
++ return undef; # unless IPC::Cmd::can_run("$CROSS_COMPILE$CC");
+ my $v = `$CROSS_COMPILE$CC -v 2>&1`;
+ $v =~ m/(?:(?:clang|LLVM) version|.*based on LLVM)\s+([0-9]+\.[0-9]+)/;
+ return $1;
+ },
+ gnu => sub {
+- return undef unless IPC::Cmd::can_run("$CROSS_COMPILE$CC");
++ return undef; # unless IPC::Cmd::can_run("$CROSS_COMPILE$CC");
+ my $nul = File::Spec->devnull();
+ my $v = `$CROSS_COMPILE$CC -dumpversion 2> $nul`;
+ # Strip off whatever prefix egcs prepends the number with.
diff --git a/external/openssl/openssl-no-multilib.patch.0 b/external/openssl/openssl-no-multilib.patch.0
new file mode 100644
index 0000000000..da9adf3578
--- /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
+@@ -27,7 +27,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";
+
+ my $banner = <<"EOF";
+
+@@ -86,6 +86,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.
+@@ -458,6 +459,7 @@
+ "module",
+ "msan",
+ "multiblock",
++ "multilib",
+ "nextprotoneg",
+ "ocb",
+ "ocsp",
+@@ -1907,6 +1909,10 @@
+
+ my @build_dirs = ( [ ] ); # current directory
+
++ if ($disabled{"multilib"}) {
++ $target{"multilib"} = "";
++ }
++
+ $config{build_infos} = [ ];
+
+ # We want to detect configdata.pm in the source tree, so we
diff --git a/external/openssl/system-cannot-find-path-for-move.patch.0 b/external/openssl/system-cannot-find-path-for-move.patch.0
new file mode 100644
index 0000000000..421d6b8df2
--- /dev/null
+++ b/external/openssl/system-cannot-find-path-for-move.patch.0
@@ -0,0 +1,11 @@
+--- Configurations/windows-makefile.tmpl 2022-09-09 15:18:35.849924899 +0100
++++ Configurations/windows-makefile.tmpl 2022-09-09 15:20:28.895825331 +0100
+@@ -790,7 +790,7 @@
+ return <<"EOF";
+ $target: "$gen0" $deps
+ \$(CPP) $incs $cppflags $defs "$gen0" > \$@.i
+- move /Y \$@.i \$@
++ mv -f \$@.i \$@
+ EOF
+ } elsif ($gen0 =~ m|^.*\.in$|) {
+ #