nss: change target from WIN95 to WINNT

In preparation for the upgrade to nss 3.104

In nss 3.103 or older, when OS_TARGET is not specified, it defaults to
WIN95, See comment

-  When building on Windows, OS_TARGET now defaults to WIN95. To use the WINNT build
      configuration, specify OS_TARGET=WINNT.

in doc/rst/legacy/nss_releases/nss_3.15.4_release_notes/index.rst
However, in nss 3.104 or newer, WIN95 support has been dropped and
the WINNT has become the default. It needs some tweaks though:

* Add external/nss/nspr-win95-target.patch to keep building
nspr with WIN95 target, which is still available in nspr.
Explicitly pass --enable-win32-target=WIN95 to NSPR_CONFIGURE_OPTS,
otherwise, it would use WINNT, as nss, and it will fail with

make[7]: *** No rule to make target 'libnspr4.lib', needed by 'build'.  Stop.
make[7]: *** Waiting for unfinished jobs....

* Add external/nss/winnt.patch.0 to remove the 'lib' prefix as WIN95 does,
otherwise it fails with

LINK : fatal error LNK1181: cannot open input file '..\..\..\..\dist\out\lib\libplc4.lib'


Change-Id: Ifaf19eeb1398389256a5c441a056f542b409622a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183262
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli
2025-03-25 11:27:29 +01:00
parent ca109bc22f
commit 81b820a7ea
4 changed files with 24 additions and 0 deletions
+1
View File
@@ -30,6 +30,7 @@ $(call gb_ExternalProject_get_state_target,nss,build): \
MOZ_DEBUG_SYMBOLS=1 \
MOZ_DEBUG_FLAGS=" " \
OPT_CODE_SIZE=0) \
OS_TARGET=WINNT \
USE_SYSTEM_ZLIB=1 \
$(if $(filter X86_64,$(CPUNAME)),USE_64=1) \
$(if $(filter AARCH64,$(CPUNAME)),USE_64=1 CPU_ARCH=aarch64) \
+2
View File
@@ -19,6 +19,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\
external/nss/nss-win32-make.patch.1 \
external/nss/ubsan.patch.0 \
external/nss/clang-cl.patch.0 \
external/nss/winnt.patch.0 \
external/nss/nss.vs2015.patch \
external/nss/nss.vs2015.pdb.patch \
external/nss/nss.bzmozilla1238154.patch \
@@ -26,6 +27,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\
external/nss/macos-dlopen.patch.0 \
external/nss/nss-restore-manual-pre-dependencies.patch.1 \
external/nss/Wincompatible-function-pointer-types.patch.0 \
external/nss/nspr-win95-target.patch \
$(if $(filter LINUX,$(OS)), \
external/nss/nss.disablefsync.patch \
external/nss/nss.getrandom.patch) \
+11
View File
@@ -0,0 +1,11 @@
--- a/nss/nss/Makefile 2025-03-24 15:04:03.270924656 +0100
+++ b/nss/nss/Makefile 2025-03-24 15:04:03.270924656 +0100
@@ -63,6 +63,8 @@
# Translate coreconf build options to NSPR configure options.
#
+NSPR_CONFIGURE_OPTS += --enable-win32-target=WIN95
+
ifeq ($(OS_TARGET),Android)
NSPR_CONFIGURE_OPTS += --with-android-ndk=$(ANDROID_NDK) \
--target=$(ANDROID_PREFIX) \
+10
View File
@@ -0,0 +1,10 @@
--- nss/coreconf/WINNT.mk 2025-03-24 14:11:13.771104127 +0100
+++ nss/coreconf/WINNT.mk 2025-03-24 14:11:13.771104127 +0100
@@ -15,6 +15,3 @@
# Win NT needs -GT so that fibers can work
#
OS_CFLAGS += -GT
-
-# WINNT uses the lib prefix, Win95 doesn't
-NSPR31_LIB_PREFIX = lib