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 2a2b784788 Teach the probe the clang-cl build, and make the mode
explicit
2a2b784788 is described below
commit 2a2b784788def9e6693fceadaa83f24f9b9e1bab
Author: Jim Jagielski <[email protected]>
AuthorDate: Tue Aug 11 14:21:34 2026 -0400
Teach the probe the clang-cl build, and make the mode explicit
The two plans need opposite environments -- one wants /clang64/bin on PATH,
the
other is broken by it -- so the script now infers a mode from MSYSTEM and
probes
accordingly, guarding each side against the other's setup.
The clang-cl side settles what that baseline currently assumes: whether ATL
compiles
and links, whether ml64 accepts the tree's own call.asm and rejects the
-safeseh
gbuild still passes, which of the tree's cl flags clang-cl silently
ignores, and
whether MSYS2 hands native tools a path they can open.
---
msys2-probe.sh | 464 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 425 insertions(+), 39 deletions(-)
diff --git a/msys2-probe.sh b/msys2-probe.sh
index 2350a1c1a8..acb7e3ba95 100755
--- a/msys2-probe.sh
+++ b/msys2-probe.sh
@@ -20,18 +20,29 @@
#
#**************************************************************
#
-# Environment probe for the proposed MSYS2/clang Windows build of Apache
-# OpenOffice. See MSYS2-WINDOWS-BUILD-FEASIBILITY.md.
+# Environment probe for the two proposed Windows builds of Apache OpenOffice.
+# It does not build anything; it answers the questions those plans list as
+# asserted-but-unverified, so the effort estimates rest on measurements.
#
-# This script does not build anything. It answers the questions that
-# feasibility document lists as asserted-but-unverified, so that the plan's
-# effort estimates rest on measurements rather than on assumptions.
+# Two modes, for two different projects:
#
-# Run it from an MSYS2 **CLANG64** shell on a Windows 10+ x86_64 machine:
+# gnu-abi MSYS2 CLANG64, x86_64-w64-windows-gnu, libc++. No MSVC at all.
+# See MSYS2-WINDOWS-BUILD-FEASIBILITY.md.
+# Run from the "MSYS2 CLANG64" shell.
#
-# ./msys2-probe.sh # probe only
-# ./msys2-probe.sh --install # pacman -S the toolchain first, then
probe
+# clang-cl clang-cl, x86_64-pc-windows-msvc, MSVC headers/STL/ABI, with
MSYS2
+# supplying only the host shell. See
CLANG-CL-WINDOWS-BUILD-BASELINE.md.
+# Run from the plain "MSYS2 MSYS" shell, launched from an x64
Native
+# Tools Command Prompt so the MSVC environment is inherited:
+# C:\msys64\msys2_shell.cmd -use-full-path -msys
+#
+# The mode is inferred from MSYSTEM unless given explicitly.
+#
+# ./msys2-probe.sh # infer mode, probe only
+# ./msys2-probe.sh --mode=clang-cl # force a mode
+# ./msys2-probe.sh --install # pacman -S what the mode needs,
then probe
# ./msys2-probe.sh --atl-include=/c/path/to/atlmfc/include
+# ./msys2-probe.sh --keep-tmp # keep the scratch dir for
inspection
#
# Exit status: 0 if no CRITICAL probe failed, 1 otherwise.
@@ -40,14 +51,17 @@ set -uo pipefail
DO_INSTALL=0
ATL_INCLUDE_OVERRIDE=""
KEEP_TMP=0
+MODE=""
for arg in "$@"; do
case "$arg" in
--install) DO_INSTALL=1 ;;
--atl-include=*) ATL_INCLUDE_OVERRIDE="${arg#*=}" ;;
--keep-tmp) KEEP_TMP=1 ;;
+ --mode=gnu-abi|--mode=gnu) MODE="gnu-abi" ;;
+ --mode=clang-cl|--mode=msvc) MODE="clang-cl" ;;
-h|--help)
- sed -n '23,37p' "$0" | sed 's/^# \{0,1\}//'
+ sed -n '23,47p' "$0" | sed 's/^# \{0,1\}//'
exit 0 ;;
*)
echo "unknown option: $arg (try --help)" >&2
@@ -55,6 +69,14 @@ for arg in "$@"; do
esac
done
+# Where the AOO tree sits relative to this script, so probes can use the real
+# sources (the bridge's call.asm in particular) rather than synthetic
stand-ins.
+SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
+AOO_MAIN=""
+for cand in "$SCRIPT_DIR/main" "$SCRIPT_DIR/../main" "$SCRIPT_DIR"; do
+ [ -f "$cand/configure.ac" ] && { AOO_MAIN="$cand"; break; }
+done
+
# ---------------------------------------------------------------- reporting --
PASS_N=0; FAIL_N=0; WARN_N=0; INFO_N=0
@@ -125,15 +147,50 @@ case "$UNAME_S" in
esac
MSYSTEM_VAL="${MSYSTEM:-<unset>}"
-if [ "$MSYSTEM_VAL" = "CLANG64" ]; then
- pass "MSYSTEM=CLANG64"
+
+if [ -z "$MODE" ]; then
+ case "$MSYSTEM_VAL" in
+ CLANG64) MODE="gnu-abi" ;;
+ MSYS) MODE="clang-cl" ;;
+ *) MODE="gnu-abi" ;;
+ esac
+fi
+info "probe mode" "$MODE (override with --mode=gnu-abi|clang-cl)"
+
+if [ "$MODE" = "gnu-abi" ]; then
+ if [ "$MSYSTEM_VAL" = "CLANG64" ]; then
+ pass "MSYSTEM=CLANG64"
+ else
+ fail "MSYSTEM is $MSYSTEM_VAL, expected CLANG64" \
+ "start the 'MSYS2 CLANG64' shell, not MINGW64/UCRT64/MSYS"
CRITICAL
+ echo
+ echo " Why CLANG64 specifically: the tree needs __try/__except,
__uuidof and"
+ echo " __declspec(uuid), none of which GCC-mingw implements. MINGW64
and"
+ echo " UCRT64 are GCC. See the 'UCRT vs MSVCRT' section of the plan."
+ fi
else
- fail "MSYSTEM is $MSYSTEM_VAL, expected CLANG64" \
- "start the 'MSYS2 CLANG64' shell, not MINGW64/UCRT64/MSYS" CRITICAL
- echo
- echo " Why CLANG64 specifically: the tree needs __try/__except, __uuidof
and"
- echo " __declspec(uuid), none of which GCC-mingw implements. MINGW64 and"
- echo " UCRT64 are GCC. See the 'UCRT vs MSVCRT' section of the plan."
+ # The clang-cl build wants the POSIX host layer only. A mingw prefix on
PATH
+ # is worse than useless here: its clang/lld/llvm-ar shadow the MSVC tools
and
+ # emit GNU-ABI objects that fail much later and far less legibly.
+ if [ "$MSYSTEM_VAL" = "MSYS" ]; then
+ pass "MSYSTEM=MSYS" "the POSIX host layer, which is all this mode
wants"
+ else
+ warn "MSYSTEM is $MSYSTEM_VAL, expected MSYS" \
+ "the mingw prefixes are for GNU-ABI builds; this mode needs none
of them"
+ fi
+
+ SHADOW=""
+ case ":${PATH}:" in
+ *:/clang64/bin:*) SHADOW="/clang64/bin" ;;
+ *:/mingw64/bin:*) SHADOW="/mingw64/bin" ;;
+ *:/ucrt64/bin:*) SHADOW="/ucrt64/bin" ;;
+ esac
+ if [ -n "$SHADOW" ]; then
+ fail "$SHADOW is on PATH" \
+ "its clang/lld/llvm-ar shadow the MSVC tools and produce GNU-ABI
objects" CRITICAL
+ else
+ pass "no mingw prefix on PATH" "MSVC tools will not be shadowed"
+ fi
fi
ARCH="$(uname -m 2>/dev/null || echo unknown)"
@@ -178,9 +235,14 @@ else
head2 "installing base MSYS2 tools"
pacman -S --needed --noconfirm "${MSYS_PKGS[@]}" || \
warn "some base packages failed to install"
- head2 "installing CLANG64 toolchain"
- pacman -S --needed --noconfirm "${CLANG_PKGS[@]}" || \
- warn "some toolchain packages failed to install"
+ if [ "$MODE" = "gnu-abi" ]; then
+ head2 "installing CLANG64 toolchain"
+ pacman -S --needed --noconfirm "${CLANG_PKGS[@]}" || \
+ warn "some toolchain packages failed to install"
+ else
+ info "skipping the CLANG64 toolchain" \
+ "clang-cl mode uses MSVC's toolchain; the mingw one would
only shadow it"
+ fi
else
info "run with --install to install packages" "probing current state
only"
fi
@@ -194,20 +256,23 @@ else
fi
done
- head2 "toolchain present?"
- for t in clang clang++ lld llvm-ar llvm-strip windres widl; do
- if command -v "$t" >/dev/null 2>&1; then
- pass "$t" "$(command -v "$t")"
- else
- case "$t" in
- clang|clang++) sev=CRITICAL ;;
- *) sev=MEDIUM ;;
- esac
- fail "$t missing" "pacman -S mingw-w64-clang-x86_64-toolchain"
"$sev"
- fi
- done
+ if [ "$MODE" = "gnu-abi" ]; then
+ head2 "toolchain present?"
+ for t in clang clang++ lld llvm-ar llvm-strip windres widl; do
+ if command -v "$t" >/dev/null 2>&1; then
+ pass "$t" "$(command -v "$t")"
+ else
+ case "$t" in
+ clang|clang++) sev=CRITICAL ;;
+ *) sev=MEDIUM ;;
+ esac
+ fail "$t missing" "pacman -S mingw-w64-clang-x86_64-toolchain"
"$sev"
+ fi
+ done
+ fi
fi
+if [ "$MODE" = "gnu-abi" ]; then
# MSYSTEM alone does not settle which compiler PATH reaches: with the CLANG64
# toolchain absent, /clang64/bin is empty and every probe below silently
# measures the msys-namespace clang, which targets the Cygwin runtime instead.
@@ -491,6 +556,301 @@ struct Probe { CComPtr<IUnknown> p; CComBSTR s; };'
fi
fi
+fi # end gnu-abi-only sections 2-6
+
+# ============================================================== clang-cl mode
==
+
+if [ "$MODE" = "clang-cl" ]; then
+
+# Compile (and optionally link) with clang-cl. Separate from try_compile
because
+# the driver, flag syntax and output conventions all differ.
+cl_try() { # cl_try <name> <flags> <mode: compile|link> (source on stdin)
+ local name="$1" flags="$2" mode="${3:-compile}"
+ local src="$TMP/$name.cpp" log="$TMP/$name.log"
+ cat > "$src"
+ local out
+ if [ "$mode" = "link" ]; then out="-Fe$TMP/$name.exe"; else out="-c
-Fo$TMP/$name.obj"; fi
+ # shellcheck disable=SC2086
+ ( cd "$TMP" && clang-cl -nologo $flags "$src" $out ) > "$log" 2>&1
+}
+
+head1 "2. clang-cl toolchain"
+
+CLCL="$(command -v clang-cl 2>/dev/null || true)"
+if [ -z "$CLCL" ]; then
+ fail "clang-cl not found on PATH" \
+ "install VS Build Tools' 'C++ Clang tools for Windows', or LLVM's
Windows release" CRITICAL
+ echo
+ echo " MSYS2's CLANG64 clang is NOT a substitute -- it targets the GNU
triple."
+ echo " Everything below depends on this; skipping the rest of the
clang-cl probes."
+else
+ pass "clang-cl" "$CLCL"
+ info "version" "$(clang-cl --version 2>/dev/null | head -1)"
+
+ # Which clang-cl: VS-bundled and standalone-LLVM differ in version cadence
and
+ # in which MSVC they are tuned against.
+ case "$CLCL" in
+ */Microsoft\ Visual\ Studio/*|*/VC/Tools/Llvm/*)
+ info "provenance" "bundled with Visual Studio / Build Tools" ;;
+ */LLVM/*)
+ info "provenance" "standalone LLVM release" ;;
+ *) info "provenance" "unrecognised location -- confirm which install
this is" ;;
+ esac
+
+ TGT="$(clang-cl --version 2>/dev/null | sed -n 's/^ *Target: *//p' | head
-1)"
+ case "$TGT" in
+ x86_64-pc-windows-msvc)
+ pass "target triple $TGT" "MSVC ABI, as this plan requires" ;;
+ *msvc*)
+ warn "target triple $TGT" "MSVC ABI but not x86_64 -- check the
host/target arch" ;;
+ *gnu*)
+ fail "target triple $TGT" \
+ "this is the GNU ABI; clang-cl must target *-windows-msvc"
CRITICAL ;;
+ *) warn "target triple ${TGT:-<none>}" "could not read a target from
--version" ;;
+ esac
+
+ head2 "MSVC environment inherited from the Developer Command Prompt?"
+ for v in INCLUDE LIB LIBPATH; do
+ if [ -n "${!v:-}" ]; then
+ pass "$v is set" "$(echo "${!v}" | cut -c1-70)..."
+ else
+ fail "$v is not set" \
+ "launch via 'msys2_shell.cmd -use-full-path -msys' from an
x64 Native Tools prompt" CRITICAL
+ fi
+ done
+
+ head2 "MSVC tools reachable?"
+ for t in cl.exe link.exe lib.exe ml64.exe rc.exe mt.exe midl.exe; do
+ p="$(command -v "$t" 2>/dev/null || true)"
+ if [ -n "$p" ]; then
+ pass "$t" "$p"
+ else
+ case "$t" in
+ link.exe|lib.exe|ml64.exe) sev=CRITICAL ;;
+ midl.exe|rc.exe|mt.exe) sev=MEDIUM ;;
+ *) sev=LOW ;;
+ esac
+ fail "$t not on PATH" "expected from the Developer Command Prompt
environment" "$sev"
+ fi
+ done
+ if command -v cl.exe >/dev/null 2>&1; then
+ info "cl.exe version" "$(cl.exe 2>&1 </dev/null | head -1 | tr -d
'\r')"
+ fi
+
+ head2 "does clang-cl compile and link at all?"
+ if printf '#include <string>\n#include <windows.h>\nint main(){
std::string s("ok"); return (int)s.size()-2; }\n' | \
+ cl_try hello "" link; then
+ pass "clang-cl builds a C++/Win32 program" "MSVC headers, STL and
libraries all reachable"
+ else
+ fail "clang-cl cannot build a trivial program" \
+ "the MSVC environment is incomplete; nothing below is meaningful"
CRITICAL
+ show_log hello
+ fi
+fi
+
+# --------------------------------------------------------- ATL under clang-cl
--
+
+head1 "3. ATL under clang-cl (the premise of the whole estimate)"
+
+echo " The GNU-ABI probe established that ATL cannot be built there. This
plan's"
+echo " 1.5-3 person-month figure assumes it builds here, because clang-cl
supplies"
+echo " _M_X64 and uses MSVC's own headers, STL and ABI. Assumed is not
measured."
+
+if [ -z "$CLCL" ]; then
+ warn "skipped" "no clang-cl"
+else
+ CL_ATL_DIR=""
+ if [ -n "$ATL_INCLUDE_OVERRIDE" ]; then
+ CL_ATL_DIR="$ATL_INCLUDE_OVERRIDE"
+ else
+ for cand in \
+ /c/Program\ Files/Microsoft\ Visual\
Studio/*/*/VC/Tools/MSVC/*/atlmfc/include \
+ /c/Program\ Files\ \(x86\)/Microsoft\ Visual\
Studio/*/*/VC/Tools/MSVC/*/atlmfc/include ; do
+ [ -f "$cand/atlbase.h" ] && { CL_ATL_DIR="$cand"; break; }
+ done
+ fi
+
+ if [ -z "$CL_ATL_DIR" ]; then
+ fail "no ATL installation found" \
+ "install the 'C++ ATL for latest build tools' component" HIGH
+ else
+ info "ATL headers" "$CL_ATL_DIR"
+ CL_ATL_LIB=""
+ for l in "${CL_ATL_DIR%/include}/lib/x64"
"${CL_ATL_DIR%/include}/lib/amd64"; do
+ [ -f "$l/atls.lib" ] && { CL_ATL_LIB="$l"; break; }
+ done
+ if [ -n "$CL_ATL_LIB" ]; then
+ info "atls.lib" "$CL_ATL_LIB/atls.lib"
+ else
+ warn "atls.lib not found for x64" "header-only ATL use may still
link"
+ fi
+
+ # -I via a response file, and the lib dir via LIB: both paths contain
+ # spaces, and cl_try word-splits its flags.
+ CL_RSP="$TMP/atl_cl.rsp"
+ printf -- '-I"%s"\n' "$(cygpath -m "$CL_ATL_DIR" 2>/dev/null || echo
"$CL_ATL_DIR")" > "$CL_RSP"
+ CL_RSP_ARG="@$(cygpath -m "$CL_RSP" 2>/dev/null || echo "$CL_RSP")"
+ if [ -n "$CL_ATL_LIB" ]; then
+ LIB="$(cygpath -m "$CL_ATL_LIB" 2>/dev/null || echo
"$CL_ATL_LIB");${LIB:-}"
+ export LIB
+ fi
+
+ head2 "compile"
+ if printf '#include <atlbase.h>\n#include <atlcom.h>\nCComModule
_Module;\nstruct Probe { CComPtr<IUnknown> p; CComBSTR s; };\nint main(){
return 0; }\n' | \
+ cl_try atlcl "-EHsc $CL_RSP_ARG" compile; then
+ pass "ATL compiles under clang-cl" "the de-ATL port is genuinely
avoided"
+ else
+ fail "ATL does not compile under clang-cl" \
+ "this invalidates the clang-cl estimate -- de-ATL returns"
CRITICAL
+ show_log atlcl
+ fi
+
+ head2 "link (does atls.lib bind to a clang-cl object?)"
+ if printf '#include <atlbase.h>\n#include <atlcom.h>\nCComModule
_Module;\nint main(){ CComBSTR s("x"); CComPtr<IUnknown> p; return
s.Length()==1?0:1; }\n' | \
+ cl_try atlcl_link "-EHsc $CL_RSP_ARG" link; then
+ pass "ATL links under clang-cl" "same ABI as MSVC, as expected"
+ else
+ fail "ATL compiles but does not link" \
+ "atls.lib or the CRT pairing needs work; investigate before
trusting the estimate" HIGH
+ show_log atlcl_link
+ fi
+ fi
+fi
+
+# ------------------------------------------------------- tree flag
compatibility --
+
+head1 "4. Does clang-cl accept the tree's cl flags?"
+
+echo " Flags taken from solenv/gbuild/platform/windows.mk and
solenv/inc/wntmscx.mk."
+echo " clang-cl ignores what it does not implement rather than failing, so an"
+echo " ignored flag is a silent behaviour change, not a build break."
+
+if [ -z "$CLCL" ]; then
+ warn "skipped" "no clang-cl"
+else
+ TREE_FLAGS=(
+ -Zm500 -Zc:wchar_t- -GR -EHa -EHsc -GS -Gy -Gs -Ob1 -Od -O2
+ -W4 -WX -MD -MDd -MT -Zi -Gd -bigobj -utf-8 -FS -Zc:forScope
+ -Zc:inline -GF -Gm- -openmp- -analyze- -LD -showIncludes-
+ )
+ IGNORED=0; ACCEPTED=0
+ for f in "${TREE_FLAGS[@]}"; do
+ if printf 'int main(){return 0;}\n' | cl_try "flag_$(echo "$f" | tr
-dc 'A-Za-z0-9')" "$f" compile; then
+ L="$TMP/flag_$(echo "$f" | tr -dc 'A-Za-z0-9').log"
+ if grep -qi "unknown argument\|argument unused\|ignoring" "$L"
2>/dev/null; then
+ warn "$f ignored by clang-cl" "$(grep -im1 'unknown
argument\|argument unused\|ignoring' "$L" | tr -d '\r' | cut -c1-70)"
+ IGNORED=$((IGNORED+1))
+ else
+ ACCEPTED=$((ACCEPTED+1))
+ fi
+ else
+ fail "$f rejected by clang-cl" "needs a substitute in the platform
makefiles" MEDIUM
+ fi
+ done
+ info "flag survey" "$ACCEPTED accepted cleanly, $IGNORED accepted but
ignored"
+fi
+
+# ------------------------------------------------------------ assembler /
bridge --
+
+head1 "5. Win64 bridge assembly (ml64 on the tree's own call.asm)"
+
+echo " bridges/source/cpp_uno/msvc_win64_x86-64/call.asm is MASM, assembled
by"
+echo " gbuild's gb_AS with '-safeseh -Cp'. -safeseh is x86-only and must not"
+echo " reach ml64; assembling the real file settles both questions at once."
+
+CALL_ASM=""
+[ -n "$AOO_MAIN" ] &&
CALL_ASM="$AOO_MAIN/bridges/source/cpp_uno/msvc_win64_x86-64/call.asm"
+
+if [ -z "$CALL_ASM" ] || [ ! -f "$CALL_ASM" ]; then
+ warn "call.asm not found" "run this script from inside the AOO checkout to
test it"
+ info "looked for" "${CALL_ASM:-<no tree located>}"
+elif ! command -v ml64.exe >/dev/null 2>&1; then
+ fail "ml64.exe not on PATH" "required to assemble the Win64 bridge"
CRITICAL
+else
+ info "assembling" "$CALL_ASM"
+ if ( cd "$TMP" && ml64.exe -c -Cp -Fo call.obj "$(cygpath -m "$CALL_ASM")"
) > "$TMP/ml64.log" 2>&1; then
+ pass "call.asm assembles with 'ml64 -c -Cp'" "the bridge's asm half is
sound"
+ else
+ fail "call.asm does not assemble" "the Win64 bridge cannot build
as-is" CRITICAL
+ sed -n '1,8p' "$TMP/ml64.log" | sed 's/^/ | /'
+ fi
+
+ # The flag gbuild would actually pass today.
+ if ( cd "$TMP" && ml64.exe -c -safeseh -Cp -Fo call_seh.obj "$(cygpath -m
"$CALL_ASM")" ) \
+ > "$TMP/ml64_safeseh.log" 2>&1; then
+ warn "ml64 also accepted -safeseh" "harmless here, but it is an x86
flag"
+ else
+ fail "gbuild's '-safeseh -Cp' is rejected by ml64" \
+ "solenv/gbuild/platform/windows.mk must drop -safeseh for x64"
HIGH
+ sed -n '1,4p' "$TMP/ml64_safeseh.log" | sed 's/^/ | /'
+ fi
+fi
+
+# --------------------------------------------------------------- host shell --
+
+head1 "6. MSYS2 host layer (the part replacing Cygwin)"
+
+head2 "perl"
+if command -v perl >/dev/null 2>&1; then
+ PERL_PATH="$(command -v perl)"
+ PERL_OS="$(perl -e 'print $^O' 2>/dev/null)"
+ info "perl" "$PERL_PATH ($PERL_OS)"
+ case "$PERL_OS" in
+ msys|cygwin) pass "POSIX perl" "the closest analogue to the Cygwin
perl used today" ;;
+ MSWin32) warn "native Windows perl is first on PATH" \
+ "AOO's build scripts assume POSIX path semantics;
verify early" ;;
+ *) warn "unrecognised perl flavour: $PERL_OS" ;;
+ esac
+ # A native perl is worth knowing about either way: some Windows toolchains
need it.
+ for p in /c/Strawberry/perl/bin/perl.exe /c/Perl64/bin/perl.exe; do
+ [ -x "$p" ] && info "native perl also present" "$p"
+ done
+else
+ fail "perl not found" "pacman -S perl" CRITICAL
+fi
+
+head2 "MSYS2 path translation (the guw.pl risk area)"
+if command -v cygpath >/dev/null 2>&1; then
+ pass "cygpath present" "$(cygpath -m "$TMP" 2>/dev/null)"
+else
+ fail "cygpath missing" "set_soenv.in and the installer Perl modules need
it" CRITICAL
+fi
+
+# The question that matters: when the build hands a native tool a POSIX path,
+# does the tool receive something it can open? Test it rather than assume.
+if [ -n "$CLCL" ]; then
+ mkdir -p "$TMP/pconv"
+ printf 'int main(){return 0;}\n' > "$TMP/pconv/src.cpp"
+ if ( cd / && clang-cl -nologo -c "$TMP/pconv/src.cpp"
"-Fo$TMP/pconv/src.obj" ) \
+ > "$TMP/pconv.log" 2>&1; then
+ pass "clang-cl opens a POSIX path argument" "MSYS2 auto-conversion is
working for plain paths"
+ else
+ fail "clang-cl cannot open a POSIX path argument" \
+ "every tool invocation will need cygpath or MSYS2_ARG_CONV_EXCL"
HIGH
+ sed -n '1,4p' "$TMP/pconv.log" | sed 's/^/ | /'
+ fi
+
+ # Paths behind a joined flag are the classic conversion failure: MSYS2 sees
+ # -I/c/... as a POSIX path list in some positions and not others.
+ if ( cd "$TMP/pconv" && clang-cl -nologo -c "-I$TMP/pconv" src.cpp
-Fosrc2.obj ) \
+ > "$TMP/pconv2.log" 2>&1; then
+ pass "a POSIX path inside -I survives conversion"
+ else
+ warn "a POSIX path inside -I did not survive" \
+ "expect MSYS2_ARG_CONV_EXCL work in the makefiles"
+ fi
+fi
+info "MSYS2_ARG_CONV_EXCL" "${MSYS2_ARG_CONV_EXCL:-<unset>} -- set where
auto-conversion mangles arguments"
+
+head2 "dmake bootstrap prerequisites"
+for t in make gcc cc; do
+ p="$(command -v "$t" 2>/dev/null || true)"
+ [ -n "$p" ] && info "$t" "$p"
+done
+info "note" "dmake builds from source in-tree; it needs a C compiler the MSYS
layer can run"
+
+fi # end clang-cl mode
+
# --------------------------------------------------------------- host tools --
head1 "7. Packaging and host tools"
@@ -563,7 +923,22 @@ echo " AOO exposes 37 --with-system-* options and none is
gated off on Windows,
echo " so every library MSYS2 can supply is one less bundled build to
maintain."
echo " system-python in particular avoids building bundled CPython under
mingw."
-if command -v pacman >/dev/null 2>&1; then
+if [ "$MODE" = "clang-cl" ]; then
+ echo
+ echo " Not applicable in clang-cl mode, and this is a real cost of that
plan."
+ echo " MSYS2's mingw-w64-clang-x86_64-* packages are GNU-ABI, built
against the"
+ echo " mingw runtime and shipping GNU-format import libraries. An
MSVC-ABI build"
+ echo " cannot link them: C++ packages differ in ABI and name mangling
outright,"
+ echo " and even the C ones give link.exe .dll.a rather than .lib."
+ echo
+ echo " So the bundled externals stay, exactly as in today's MSVC build.
vcpkg is"
+ echo " the MSVC-ABI equivalent worth evaluating if system libraries are
wanted."
+ if command -v vcpkg >/dev/null 2>&1; then
+ info "vcpkg present" "$(command -v vcpkg)"
+ else
+ info "vcpkg not on PATH" "not required; noted because it is the
alternative"
+ fi
+elif command -v pacman >/dev/null 2>&1; then
AVAILABLE=0; MISSING=""
for p in "${SYSLIB_PKGS[@]}"; do
full="mingw-w64-clang-x86_64-$p"
@@ -608,10 +983,21 @@ fi
echo " RESULT: no CRITICAL failures."
echo
-echo " Next, in order:"
-echo " 1. If the ATL probe failed or found nothing, settle that first -- it
is"
-echo " the difference between a ~3.5-6 and a ~5-9 person-month project."
-echo " 2. Prototype the Win64 GNU-ABI UNO bridge (plan section B1). That
is the"
-echo " real go/no-go gate and needs no working AOO build to start."
-echo " 3. Only then begin Phase 0 build-system work."
+if [ "$MODE" = "gnu-abi" ]; then
+ echo " Next, in order:"
+ echo " 1. Prototype the Win64 GNU-ABI UNO bridge (plan section B1).
That is the"
+ echo " real go/no-go gate and needs no working AOO build to start."
+ echo " 2. Scope the de-ATL port of winaccessibility,
extensions/source/ole and"
+ echo " embedserv -- measured as required, not optional (section B2)."
+ echo " 3. Only then begin Phase 0 build-system work."
+else
+ echo " Next, in order:"
+ echo " 1. If ATL failed to compile or link above, stop -- the 1.5-3
person-month"
+ echo " estimate rests entirely on it, and de-ATL would come back."
+ echo " 2. Establish how far './configure --enable-win64' gets with
plain cl.exe."
+ echo " That is the true starting line and belongs to the in-flight
Win64 work,"
+ echo " not to this plan."
+ echo " 3. Then C1 (clang-cl detection in configure) and C2 (MSYS2 host
layer),"
+ echo " which is where the bulk of this project's effort actually
sits."
+fi
exit 0