summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2019-06-26 18:09:19 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2020-05-31 12:15:23 +0200
commitb56e8d6def26a0430853835e997f1be841840a61 (patch)
tree2294aabb1121aff24d16b2f0514aa213ae5867b2
parent07379e0eb27de0c16ae3838532310aa5aec4f20f (diff)
NSS: enable parallel build
Since NSS 3.53, the Makefile based build should be fixed (upstream bug 290526). The only missing patch is a minimal NSPR fix for the "NSPR, configure + make, parallel, Windows, MS VS, debug" build. That patch isn't incuded in the NSPR 4.25 release (but it's already in the mercurial repo for NSPR 4.26). Change-Id: I8eaa3792a12bdff734e56ac3f552991478957e23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95218 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
-rw-r--r--download.lst4
-rw-r--r--external/nss/ExternalProject_nss.mk6
-rw-r--r--external/nss/UnpackedTarball_nss.mk38
-rw-r--r--external/nss/nsinstall.py7
-rw-r--r--external/nss/nss-3.13.5-zlib-werror.patch7
-rw-r--r--external/nss/nss-win32-make.patch.12
-rw-r--r--external/nss/nss.nspr-parallel-win-debug_build.patch40
-rw-r--r--external/nss/nss.windows.patch4
8 files changed, 77 insertions, 31 deletions
diff --git a/download.lst b/download.lst
index 1be7fb4d8b8c..6ec71be2e830 100644
--- a/download.lst
+++ b/download.lst
@@ -193,8 +193,8 @@ export MYTHES_SHA256SUM := 1e81f395d8c851c3e4e75b568e20fa2fa549354e75ab397f9de4b
export MYTHES_TARBALL := a8c2c5b8f09e7ede322d5c602ff6a4b6-mythes-1.2.4.tar.gz
export NEON_SHA256SUM := c9dfcee723050df37ce18ba449d7707b78e7ab8230f3a4c59d9112e17dc2718d
export NEON_TARBALL := neon-0.31.1.tar.gz
-export NSS_SHA256SUM := 07d4276168f59bb3038c7826dabb5fbfbab8336ddf65e4e6e43bce89ada78c64
-export NSS_TARBALL := nss-3.47.1-with-nspr-4.23.tar.gz
+export NSS_SHA256SUM := 861a4510b7c21516f49a4cfa5b871aa796e4e1ef2dfe949091970e56f9d60cdf
+export NSS_TARBALL := nss-3.53-with-nspr-4.25.tar.gz
export ODFGEN_SHA256SUM := 2c7b21892f84a4c67546f84611eccdad6259875c971e98ddb027da66ea0ac9c2
export ODFGEN_VERSION_MICRO := 6
export ODFGEN_TARBALL := libodfgen-0.1.$(ODFGEN_VERSION_MICRO).tar.bz2
diff --git a/external/nss/ExternalProject_nss.mk b/external/nss/ExternalProject_nss.mk
index 796d8151c168..b4c4f37cf07c 100644
--- a/external/nss/ExternalProject_nss.mk
+++ b/external/nss/ExternalProject_nss.mk
@@ -24,11 +24,11 @@ $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecuta
MOZ_DEBUG_SYMBOLS=1 \
MOZ_DEBUG_FLAGS=" " \
OPT_CODE_SIZE=0) \
- MOZ_MSVCVERSION=9 OS_TARGET=WIN95 \
+ OS_TARGET=WIN95 \
$(if $(filter X86_64,$(CPUNAME)),USE_64=1) \
LIB="$(ILIB)" \
XCFLAGS="$(SOLARINC)" \
- $(MAKE) -j1 nss_build_all RC="rc.exe $(SOLARINC)" \
+ $(MAKE) nss_build_all RC="rc.exe $(SOLARINC)" \
NSINSTALL='$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py' \
NSS_DISABLE_GTESTS=1 \
,nss)
@@ -53,7 +53,7 @@ $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecuta
$(if $(filter iOS-ARM,$(OS)-$(CPUNAME)),CPU_ARCH=arm) \
NSPR_CONFIGURE_OPTS="--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)") \
NSDISTMODE=copy \
- $(MAKE) -j1 AR="$(AR)" \
+ $(MAKE) AR="$(AR)" \
RANLIB="$(RANLIB)" \
NMEDIT="$(NM)edit" \
COMMA=$(COMMA) \
diff --git a/external/nss/UnpackedTarball_nss.mk b/external/nss/UnpackedTarball_nss.mk
index 0e174879a702..8801c7cdad63 100644
--- a/external/nss/UnpackedTarball_nss.mk
+++ b/external/nss/UnpackedTarball_nss.mk
@@ -12,34 +12,34 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,nss))
$(eval $(call gb_UnpackedTarball_set_tarball,nss,$(NSS_TARBALL)))
$(eval $(call gb_UnpackedTarball_add_patches,nss,\
- external/nss/nss.patch \
- external/nss/nss.aix.patch \
- external/nss/nss-3.13.5-zlib-werror.patch \
- external/nss/nss_macosx.patch \
- external/nss/nss-win32-make.patch.1 \
- $(if $(filter WNT,$(OS)),external/nss/nss.windows.patch \
- external/nss/nss.nowerror.patch \
- external/nss/nss.vs2015.patch) \
+ external/nss/nss.patch \
+ external/nss/nss.aix.patch \
+ external/nss/nss-3.13.5-zlib-werror.patch \
+ external/nss/nss_macosx.patch \
+ external/nss/nss-win32-make.patch.1 \
external/nss/ubsan.patch.0 \
external/nss/clang-cl.patch.0 \
+ external/nss/nss.vs2015.patch \
+ external/nss/nss.vs2015.pdb.patch \
+ external/nss/nss.bzmozilla1238154.patch \
+ external/nss/macos-dlopen.patch.0 \
+ external/nss/nss.nspr-parallel-win-debug_build.patch \
$(if $(filter iOS,$(OS)), \
external/nss/nss-ios.patch) \
- $(if $(filter MSC-INTEL,$(COM)-$(CPUNAME)), \
- external/nss/nss.cygwin64.in32bit.patch) \
- $(if $(filter WNT,$(OS)), \
- external/nss/nss.vs2015.pdb.patch) \
- $(if $(filter WNT,$(OS)), \
- external/nss/nss.utf8bom.patch.1) \
- $(if $(filter ANDROID,$(OS)), \
- external/nss/nss-android.patch.1) \
- external/nss/nss.bzmozilla1238154.patch \
- external/nss/macos-dlopen.patch.0 \
+ $(if $(filter ANDROID,$(OS)), \
+ external/nss/nss-android.patch.1) \
+ $(if $(filter MSC-INTEL,$(COM)-$(CPUNAME)), \
+ external/nss/nss.cygwin64.in32bit.patch) \
+ $(if $(filter WNT,$(OS)), \
+ external/nss/nss.windows.patch \
+ external/nss/nss.nowerror.patch \
+ external/nss/nss.utf8bom.patch.1) \
))
ifeq ($(COM_IS_CLANG),TRUE)
ifneq ($(filter -fsanitize=%,$(CC)),)
$(eval $(call gb_UnpackedTarball_add_patches,nss,\
- external/nss/asan.patch.1 \
+ external/nss/asan.patch.1 \
))
endif
endif
diff --git a/external/nss/nsinstall.py b/external/nss/nsinstall.py
index 31b3de3450c5..80e9c1679373 100644
--- a/external/nss/nsinstall.py
+++ b/external/nss/nsinstall.py
@@ -155,7 +155,12 @@ def nsinstall(argv):
target = args.pop()
# ensure target directory
if not os.path.isdir(target):
- os.makedirs(target)
+ try:
+ os.makedirs(target)
+ except FileExistsError:
+ if not os.path.isdir(target):
+ sys.stderr.write('nsinstall: ' + target + ' is not a directoy!\n')
+ return 1
copy_all_entries(args, target)
return 0
diff --git a/external/nss/nss-3.13.5-zlib-werror.patch b/external/nss/nss-3.13.5-zlib-werror.patch
index 6cda50023f1b..0cdbf7808f81 100644
--- a/external/nss/nss-3.13.5-zlib-werror.patch
+++ b/external/nss/nss-3.13.5-zlib-werror.patch
@@ -1,9 +1,10 @@
--- a/a/nss/lib/zlib/gzguts.h 2010-08-22 03:07:03.000000000 +0200
+++ b/b/nss/lib/zlib/gzguts.h 2012-07-17 08:52:14.821552788 +0200
-@@ -26,6 +26,9 @@
- # include <limits.h>
+@@ -26,6 +26,10 @@
+ # define write _write
+ # define close _close
#endif
- #include <fcntl.h>
++
+#ifndef _WIN32
+#include <unistd.h>
+#endif
diff --git a/external/nss/nss-win32-make.patch.1 b/external/nss/nss-win32-make.patch.1
index bc5a759275e2..7ba3df451ee6 100644
--- a/external/nss/nss-win32-make.patch.1
+++ b/external/nss/nss-win32-make.patch.1
@@ -1,7 +1,7 @@
--- nss/nss/coreconf/rules.mk.orig2 2014-06-03 15:30:01.667200000 +0200
+++ nss/nss/coreconf/rules.mk 2014-06-03 15:30:14.537200000 +0200
@@ -259,7 +259,7 @@
- @$(MAKE_OBJDIR)
+ $(LIBRARY): $(OBJS) | $$(@D)/d
rm -f $@
ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
- $(AR) $(subst /,\\,$(OBJS))
diff --git a/external/nss/nss.nspr-parallel-win-debug_build.patch b/external/nss/nss.nspr-parallel-win-debug_build.patch
new file mode 100644
index 000000000000..86b55e1ccf7f
--- /dev/null
+++ b/external/nss/nss.nspr-parallel-win-debug_build.patch
@@ -0,0 +1,40 @@
+Ă„nderung: 4866:23940b78e965
+Nutzer: Jan-Marek Glogowski <glogow@fbihome.de>
+Datum: Fri May 01 22:50:55 2020 +0000
+Dateien: pr/tests/Makefile.in
+Beschreibung:
+Bug 290526 Write separate PDBs for test OBJs r=glandium
+
+Quite often when running a parallel NSS build, I get the following
+compiler error message, resulting in a build failure, despite
+compiling with the -FS flag:
+
+.../nss/nspr/pr/tests/zerolen.c: fatal error C1041:
+Programmdatenbank "...\nss\nspr\out\pr\tests\vc140.pdb" kann nicht
+ge<94>ffnet werden; verwenden Sie /FS, wenn mehrere CL.EXE in
+dieselbe .PDB-Datei schreiben.
+
+The failing source file is always one of the last test object
+files. But the actual problem is not the compiler accessing the
+PDB file, but the linker already linking the first test
+executables accessing the shared PDB; at least that's my guess.
+
+So instead of using a shared PDB for all test object files, this
+uses -Fd$(@:.$(OBJ_SUFFIX)=.pdb) to write a separate PDB for every
+test's object file. The linker works fine with the shared OBJ PDB.
+
+Differential Revision: https://phabricator.services.mozilla.com/D68693
+
+
+diff -r 219d131499d5 -r 23940b78e965 nss/nspr/pr/tests/Makefile.in
+--- a/nss/nspr/pr/tests/Makefile.in Mon Feb 10 20:58:42 2020 +0000
++++ b/nss/nspr/pr/tests/Makefile.in Fri May 01 22:50:55 2020 +0000
+@@ -211,6 +211,7 @@
+ else
+ EXTRA_LIBS += ws2_32.lib
+ LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
++ CFLAGS += -Fd$(@:.$(OBJ_SUFFIX)=.pdb)
+ ifdef PROFILE
+ LDOPTS += -PROFILE -MAP
+ endif # profile
+
diff --git a/external/nss/nss.windows.patch b/external/nss/nss.windows.patch
index 9dbeaa946520..901846e7bc1f 100644
--- a/external/nss/nss.windows.patch
+++ b/external/nss/nss.windows.patch
@@ -18,8 +18,8 @@
-core_abspath = '$(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))'
+core_abspath = '$(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(shell cygpath -m $(1))),$(1),$(shell cygpath -m $(PWD)/$(1))))'
- $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
- @$(MAKE_OBJDIR)
+ $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c | $$(@D)/d
+ ifdef USE_NT_C_SYNTAX
--- a/a/nspr/pr/include/md/_win95.h
+++ b/b/nspr/pr/include/md/_win95.h
@@ -312,7 +312,7 @@