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

leginee pushed a commit to branch bazel-migration
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 8db47c6cb7a2099bf85bbdb70a14bbd4cf3a5814
Author: Peter Kovacs <[email protected]>
AuthorDate: Fri Jul 24 12:06:04 2026 +0200

    build/win64: NSS/NSPR + CoinMP x64 external overlays [P4]
    
    - nss: append two hunks to nss_win.patch (from the reference
      nss_win64.patch, origin/windows-amd64 9bbb3c7f6b): prsocket.c C89
      declaration-after-statement (VC9 compiles .c as C89) and blinit.c
      _xgetbv -> return 0 (the intrinsic needs VS2010 SP1+; disables AVX
      detection).  Add NSS_USE_64 to the overlay on x64 so freebl size_t>4
      static asserts (drbg.c) hold.  The hunks carry `diff -ur` separators --
      bazel's patch parser needs them to delimit files (GNU patch infers).
    - coinmp: drop hardcoded _X86_=1 (a pre-P2 leftover; the P2 sweep only
      touched main/* BUILD files, not external overlays).  On x64 it collided
      with the toolchain's global _AMD64_=1 and winnt.h defined _CONTEXT
      twice (C2011).
    
    Recompute the affected patch/overlay sha256 in each module's source.json.
    
    Co-Authored-By: Claude Opus 4.8 <[email protected]>
    (cherry picked from commit b82f018cdda33ed91a50a41db341ccf135d66fc6)
---
 .../modules/coinmp/1.7.6/overlay/BUILD.bazel       |  4 ++-
 ext_libraries/modules/coinmp/1.7.6/source.json     |  2 +-
 ext_libraries/modules/nss/3.39/overlay/BUILD.bazel | 15 +++++++++-
 .../modules/nss/3.39/patches/nss_win.patch         | 32 ++++++++++++++++++++++
 ext_libraries/modules/nss/3.39/source.json         |  4 +--
 5 files changed, 52 insertions(+), 5 deletions(-)

diff --git a/ext_libraries/modules/coinmp/1.7.6/overlay/BUILD.bazel 
b/ext_libraries/modules/coinmp/1.7.6/overlay/BUILD.bazel
index 73c7eeddff..578f716149 100644
--- a/ext_libraries/modules/coinmp/1.7.6/overlay/BUILD.bazel
+++ b/ext_libraries/modules/coinmp/1.7.6/overlay/BUILD.bazel
@@ -18,7 +18,9 @@ cc_binary(
         "COINMP_EXPORTS",
         "_CRT_SECURE_NO_DEPRECATE",
         "_CRT_SECURE_NO_WARNINGS",
-        "_X86_=1",
+        # Arch CPU define (_X86_ / _AMD64_) comes from the toolchain 
arch_defines
+        # globally — do NOT hardcode _X86_=1 here: on x64 it collides with the
+        # toolchain's _AMD64_=1 and winnt.h defines the CONTEXT struct twice 
(C2011).
     ],
     copts = ["/FIwindef.h"],
     win_def_file = "CoinMP/src/CoinMP.def",
diff --git a/ext_libraries/modules/coinmp/1.7.6/source.json 
b/ext_libraries/modules/coinmp/1.7.6/source.json
index ca3c304388..5701e65e6b 100644
--- a/ext_libraries/modules/coinmp/1.7.6/source.json
+++ b/ext_libraries/modules/coinmp/1.7.6/source.json
@@ -4,7 +4,7 @@
     "strip_prefix": "CoinMP-releases-1.7.6",
     "overlay": {
         "MODULE.bazel": "sha256-leibdbQi7pf+2uZbPTsVDcr7riTg8fX4zfoqEtyl65I=",
-        "BUILD.bazel":  "sha256-8FprSzd0502j0rjXQzswLPmEr3AzVRySwFJRpSHa+rE="
+        "BUILD.bazel":  "sha256-LasDks4dj7ASug2LKmR9crd+e58A/7TAdbDdsSBhDIM="
     },
     "patches": {},
     "patch_strip": 0
diff --git a/ext_libraries/modules/nss/3.39/overlay/BUILD.bazel 
b/ext_libraries/modules/nss/3.39/overlay/BUILD.bazel
index d28e1bb5cd..6e81203cc4 100644
--- a/ext_libraries/modules/nss/3.39/overlay/BUILD.bazel
+++ b/ext_libraries/modules/nss/3.39/overlay/BUILD.bazel
@@ -2,6 +2,13 @@ load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
 
 package(default_visibility = ["//visibility:public"])
 
+# Local x64 selector — kept self-contained so this overlay never references
+# main-repo labels (same pattern as the boost.legacy overlay).
+config_setting(
+    name = "x64",
+    constraint_values = ["@platforms//cpu:x86_64"],
+)
+
 # ── Common flags ─────────────────────────────────────────────────────────────
 
 WIN_DEFINES = [
@@ -14,7 +21,13 @@ WIN_DEFINES = [
     "NDEBUG",
     "_USRDLL",
     "IEEE_8087",   # x86/x64 little-endian IEEE 754; required by nspr/dtoa.c
-]
+] + select({
+    # 64-bit build mode (coreconf USE_64=1 → -DNSS_USE_64).  Gates size_t>4
+    # code paths (e.g. freebl/drbg.c PR_STATIC_ASSERT) and 64-bit pointer
+    # assumptions.  Mirrors reference makefile.mk (origin/windows-amd64).
+    ":x64": ["NSS_USE_64"],
+    "//conditions:default": [],
+})
 
 WIN_COPTS = [
     "/W3",
diff --git a/ext_libraries/modules/nss/3.39/patches/nss_win.patch 
b/ext_libraries/modules/nss/3.39/patches/nss_win.patch
index 10d5efcee7..90b8df377f 100644
--- a/ext_libraries/modules/nss/3.39/patches/nss_win.patch
+++ b/ext_libraries/modules/nss/3.39/patches/nss_win.patch
@@ -2949,3 +2949,35 @@ diff -ur misc/nss-3.39/nss/lib/util/utilmod.c 
misc/build/nss-3.39/nss/lib/util/u
      if (!toWide) {
          PORT_Free(fromWide);
          return PR_FAILURE;
+diff -ur misc/nss-3.39/nspr/pr/src/io/prsocket.c 
misc/build/nss-3.39/nspr/pr/src/io/prsocket.c
+--- misc/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,
+diff -ur misc/nss-3.39/nss/lib/freebl/blinit.c 
misc/build/nss-3.39/nss/lib/freebl/blinit.c
+--- misc/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;
diff --git a/ext_libraries/modules/nss/3.39/source.json 
b/ext_libraries/modules/nss/3.39/source.json
index 22e0422596..85b07a9e03 100644
--- a/ext_libraries/modules/nss/3.39/source.json
+++ b/ext_libraries/modules/nss/3.39/source.json
@@ -4,7 +4,7 @@
   "url": 
"https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_39_RTM/src/nss-3.39-with-nspr-4.20.tar.gz";,
   "overlay": {
     "MODULE.bazel":                    
"sha256-mXRzSNFfz0l/ZE/gxIXrTXgGEu73DRFzcL03hpjgzWw=",
-    "BUILD.bazel":                     
"sha256-BVN8Qf65vHdXoWqhWZQcmrQEbmftW8U+Ef9T5FoQiG0=",
+    "BUILD.bazel":                     
"sha256-iacJ8e9bTRBAXvjJE+0NcYbV5+XompHcriE9vxCwaqo=",
     "nspr/pr/include/prcpucfg.h":      
"sha256-epNyl8GFFwovhIu3m76CCZkyQlMxDlsitfA/83I/oS8=",
     "nspr/pr/src/_pr_bld.h":           
"sha256-KbNBXdVYpv4NqdFTM9U1OGsXFI0t2Pvsv4p7b6dTnNE=",
     "nspr/lib/libc/src/_pl_bld.h":     
"sha256-8EkKDhgBCnbvsC3iz8vHqVtm6Mzwq8VgAFjve6zRPcQ=",
@@ -14,7 +14,7 @@
   },
   "patches": {
     "nss.patch":       "sha256-PNisPTc+Syr3cnD+8Ixipw65zUrG2rOg1peBfXVcdck=",
-    "nss_win.patch":   "sha256-ORoSU5UGyh5eR5VfrS9LBDG5oHGPGmKyhC3ZYgvxvyA=",
+    "nss_win.patch":   "sha256-8F2wx79jkH2SAUYuEMznXApW7E0z2Yvc+fKJF9LcmmU=",
     "nss_sizes.patch": "sha256-OMYmfwozZnvzpRVl0ipMnbUsmedPULlPoGKBUsdONDw="
   },
   "patch_strip": 2

Reply via email to