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

jimjag pushed a commit to branch msys2-dev-prototype
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/msys2-dev-prototype by this 
push:
     new a403e4896b Separate the ATL question from the -fms-compatibility 
question
a403e4896b is described below

commit a403e4896ba76c2a58032be776bd9a7aaabb7a4d
Author: Jim Jagielski <[email protected]>
AuthorDate: Tue Aug 11 13:49:02 2026 -0400

    Separate the ATL question from the -fms-compatibility question
    
    Under -fms-compatibility the mingw header set fails on its own terms -- 
vadefs.h
    takes its #error branch and libc++ loses aligned_alloc -- so the probe never
    reached ATL and its verdict was unearned.  Try -fms-extensions alone as 
well,
    which section 3 shows is all the tree's MSVC extensions actually need.
    
    Also accept an x86 MSI tool: it runs on x64, and only arm builds truly do 
not.
---
 msys2-probe.sh | 37 ++++++++++++++++++++++++++-----------
 1 file changed, 26 insertions(+), 11 deletions(-)

diff --git a/msys2-probe.sh b/msys2-probe.sh
index 32a3a66849..891f4a8c7f 100755
--- a/msys2-probe.sh
+++ b/msys2-probe.sh
@@ -443,17 +443,29 @@ else
     # Via CPATH, not -I: the path contains spaces, and try_compile word-splits
     # its flags.  cygpath -m because clang here is a native binary.
     ATL_CPATH="$(cygpath -m "$ATL_DIR" 2>/dev/null || echo "$ATL_DIR")"
-    if CPATH="$ATL_CPATH" try_compile atl cxx "-fms-extensions 
-fms-compatibility" compile <<'EOF'
-#include <atlbase.h>
+
+    ATL_SRC='#include <atlbase.h>
 #include <atlcom.h>
 CComModule _Module;
-struct Probe { CComPtr<IUnknown> p; CComBSTR s; };
-EOF
-        then pass "ATL compiles under clang" "the plan's Phase 3 estimate 
holds"
-        else fail "ATL does not compile under clang" \
-                  "reinstates the de-ATL port; re-estimate Phase 3 at 6-10 
weeks" HIGH
-             show_log atl
-        fi
+struct Probe { CComPtr<IUnknown> p; CComBSTR s; };'
+
+    # Both flag sets, because -fms-compatibility breaks mingw's own vadefs.h 
and
+    # libc++ before ATL is reached -- which tells us nothing about ATL itself.
+    atl_try() { printf '%s\n' "$ATL_SRC" | CPATH="$ATL_CPATH" try_compile "$1" 
cxx "$2" compile; }
+
+    if atl_try atl "-fms-extensions -fms-compatibility"; then
+        pass "ATL compiles under clang" "the plan's Phase 3 estimate holds"
+    elif atl_try atl_nocompat "-fms-extensions"; then
+        pass "ATL compiles under clang" \
+             "only without -fms-compatibility, which the mingw header set 
rejects"
+    else
+        fail "ATL does not compile under clang" \
+             "reinstates the de-ATL port; re-estimate Phase 3 at 6-10 weeks" 
HIGH
+        head2 "with -fms-compatibility"
+        show_log atl
+        head2 "with -fms-extensions alone"
+        show_log atl_nocompat
+    fi
 fi
 
 # --------------------------------------------------------------- host tools --
@@ -466,9 +478,12 @@ find_win_tool() {  # find_win_tool <exe> <severity> 
<what-for>
         pass "$exe" "$p"
         return
     fi
-    # x64 first: the SDK ships arm/ and arm64/ copies that cannot run here.
+    # x64 then x86 (which still runs here); the SDK's arm/arm64 copies do not.
     local roots=("/c/Program Files (x86)/Windows Kits/10/bin" "/c/Program 
Files/Windows Kits/10/bin")
-    p="$(find "${roots[@]}" -maxdepth 3 -ipath "*/x64/$exe" 2>/dev/null | sort 
-r | head -1)"
+    for sub in x64 x86; do
+        p="$(find "${roots[@]}" -maxdepth 3 -ipath "*/$sub/$exe" 2>/dev/null | 
sort -r | head -1)"
+        [ -n "$p" ] && break
+    done
     [ -n "$p" ] || p="$(find "${roots[@]}" -maxdepth 3 -iname "$exe" 
2>/dev/null | head -1)"
     if [ -n "$p" ]; then
         case "$p" in

Reply via email to