This is an automated email from the ASF dual-hosted git repository.

damjan pushed a commit to branch windows-amd64
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 9bbb3c7f6b2903f7ff32e88096e41ed5dc704e35
Author: Damjan Jovanovic <dam...@apache.org>
AuthorDate: Wed Jan 22 02:31:15 2025 +0200

    NSS/NSPR fixes for Windows/amd64.
    
    Patch by: me
---
 main/nss/makefile.mk     |  8 ++++++++
 main/nss/nss_win64.patch | 30 ++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/main/nss/makefile.mk b/main/nss/makefile.mk
index afd4ed74b8..4a6bf5510b 100644
--- a/main/nss/makefile.mk
+++ b/main/nss/makefile.mk
@@ -117,6 +117,9 @@ OUT2LIB= \
 MOZ_MSVCVERSION= 9
 .EXPORT : MOZ_MSVCVERSION
 PATCH_FILES+=nss_win.patch
+.IF "$(CPU)" == "X"
+PATCH_FILES+=nss_win64.patch
+.ENDIF
 moz_build:=$(shell cygpath -p $(MOZILLABUILD))
 
 # Using WINNT will cause at least that nspr4.dll, plc4.dll, plds4.dll
@@ -131,8 +134,13 @@ EXT_USE_STLPORT=TRUE
 
 # To build nss one has to call "make nss_build_all" in nss
 NSS_BUILD_DIR= $(subst,\,/ $(PWD)/$(MISC)/build/$(TARFILE_ROOTDIR)/nss)
+.IF "$(CPU)" == "I"
 BUILD_ACTION= 
PATH="$(PATH):$(moz_build)/msys/bin:$(moz_build)/bin:$(moz_build)/msys/local/bin:$(moz_build)/moztools/bin"
 && $(subst,/,$/ $(MOZILLABUILD)/msys/bin/bash) -i \
        -c "cd $(NSS_BUILD_DIR) && make nss_build_all NSS_DISABLE_GTESTS=1"
+.ELIF "$(CPU)" == "X"
+BUILD_ACTION= 
PATH="$(PATH):$(moz_build)/msys/bin:$(moz_build)/bin:$(moz_build)/msys/local/bin:$(moz_build)/moztools/bin"
 && $(subst,/,$/ $(MOZILLABUILD)/msys/bin/bash) -i \
+       -c "cd $(NSS_BUILD_DIR) && make nss_build_all NSS_DISABLE_GTESTS=1 
USE_64=1"
+.ENDIF
 
 OUT2LIB= \
        dist$/*.OBJ$/lib$/libnspr4.lib \
diff --git a/main/nss/nss_win64.patch b/main/nss/nss_win64.patch
new file mode 100644
index 0000000000..f4e6ca9db9
--- /dev/null
+++ b/main/nss/nss_win64.patch
@@ -0,0 +1,30 @@
+--- misc/build/nss-3.39/nspr/pr/src/io/prsocket.c      2025-01-21 
18:09:11.629055000 +0200
++++ misc/build/nss-3.39/nspr/pr/src/io/prsocket.c      2025-01-21 
18:11:44.990333000 +0200
+@@ -337,8 +337,8 @@
+      * input/output.
+      * To get result we need to use GetOverlappedResult. */
+     if (fd->secret->overlappedActive) {
+-        PR_ASSERT(fd->secret->nonblocking);
+         PRInt32 rvSent;
++        PR_ASSERT(fd->secret->nonblocking);
+         if (GetOverlappedResult(osfd, &fd->secret->ol, &rvSent, FALSE) == 
TRUE) {
+             fd->secret->overlappedActive = PR_FALSE;
+             PR_LOG(_pr_io_lm, PR_LOG_MIN,
+--- misc/build/nss-3.39/nss/lib/freebl/blinit.c        2025-01-21 
18:09:11.487953000 +0200
++++ misc/build/nss-3.39/nss/lib/freebl/blinit.c        2025-01-21 
18:28:06.705161000 +0200
+@@ -50,14 +50,8 @@
+         mov xcr0, eax
+     }
+ #else
+-    xcr0 = (PRUint32)_xgetbv(0); /* Requires VS2010 SP1 or later. */
++    return 0;
+ #endif /* _M_IX86 */
+-#else  /* _MSC_VER */
+-    /* Old OSX compilers don't support xgetbv. Use byte form. */
+-    __asm__(".byte 0x0F, 0x01, 0xd0"
+-            : "=a"(xcr0)
+-            : "c"(0)
+-            : "%edx");
+ #endif /* _MSC_VER */
+     /* Check if xmm and ymm state are enabled in XCR0. */
+     return (xcr0 & 6) == 6;

Reply via email to