This is an automated email from the ASF dual-hosted git repository. leginee pushed a commit to branch mac-vcl-button-contrast in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 81568a60dcfaa76e7c2dff9d906eb58542be629b Author: peter kovacs <[email protected]> AuthorDate: Thu Sep 3 07:15:02 2026 +0200 Apple Silicon: whole tree compiles; fixes toward the .dmg Full arm64 build of trunk on macOS (M2, macOS 26.3 / Xcode 16.4 / Apple clang 17, native arm64 JDK 8 = Corretto) now compiles all 166 modules with zero errors -- VCL Cocoa backend, the arm64 UNO bridge, sw/sc/sd, the bundled externals. Only instsetoo_native (.dmg assembly) still fails. Changes: - main/mac-silicon-build.sh (new): full-build wrapper. Puts GNU awk (gawk gnubin) first on PATH -- bundled hyphen-2.8.8's Makefile calls `awk` and uses gensub(), which BSD awk lacks. Sets the CA bundle, sources the env, runs build.pl --all -P4 --stoponerror (args pass through). - main/mac-silicon-configure.sh: JDK 8 (JDK 11+ javac rejects the source/target 1.3/1.5 used by bundled apache-commons etc.) -- must be native arm64 (Corretto 8; Temurin has no arm64 8). Add --without-system-libxml --without-system-libxslt: the macOS SDK's xml2-config was being picked as "system libxml" but the SDK ships only .tbd stubs (no static/dylib), and its libxml2 is too old for bundled xmlsec1. Building them bundled is also right for a self-contained .dmg (cf. --without-system-curl). - main/libxml2/makefile.mk: on macOS the bundled libxml2 builds --enable-shared=no, so libtool links xmllint directly at the build root, not .libs/xmllint. Fix the OUT2BIN path (libxslt/makefile.mk already does this for xsltproc). - main/scp2/source/ooo/file_library_ooo.scp: SCP2_URE_DL_VER emits Linux-style libNAME.dylib.V; main/openssl (openssl-3.0.20) delivers macOS-style libNAME.V.dylib. Add a MACOSX branch for gid_File_Lib_Openssl / gid_File_Lib_Crypto -> libssl.3.dylib / libcrypto.3.dylib. Still open (see .agent/mac-silicon-port.md): scp2/source/python/*.scp expects the old macOS Python framework (OOoPython.framework.zip); the Python-3 migration made python/makefile.mk build a plain --enable-shared Unix install on macOS too. Co-Authored-By: Claude Sonnet 5 <[email protected]> --- .agent/mac-silicon-port.md | 93 ++++++++++++++++++++++++++++--- main/libxml2/makefile.mk | 5 +- main/mac-silicon-build.sh | 44 +++++++++++++++ main/mac-silicon-configure.sh | 17 ++++-- main/scp2/source/ooo/file_library_ooo.scp | 7 +++ 5 files changed, 153 insertions(+), 13 deletions(-) diff --git a/.agent/mac-silicon-port.md b/.agent/mac-silicon-port.md index e1b9241a78..43d42c03af 100644 --- a/.agent/mac-silicon-port.md +++ b/.agent/mac-silicon-port.md @@ -188,13 +188,92 @@ Non-blocking notes: before packaging. - Disk: user freed space — 37 GiB free at bootstrap time. +## Milestone 2 — `build.pl --all` (in progress, 2026-09-03) + +- Installed **Temurin 11.0.32.1 (arm64)**, re-ran configure (JDK 11.0.32.1, `JDK=sun`), + re-ran bootstrap, started `build.pl --all -P4 --stoponerror`. +- **~4 min in: `apache-commons/commons-logging` failed** — Temurin 11's `javac` rejects + the bundled `build.xml` `source="1.3"` / `target="1.5"` ("Source option 1.5 is no + longer supported. Use 1.6 or later."). This is the classic JDK-11+ vs old-Java-build + wall; `solenv/inc/antsettings.mk:90` sets `-Dant.build.javac.source/target=1.8` but + commons-logging's build.xml overrides it with explicit `<javac source target>`. +- **Decision: build with JDK 8 instead** (AOO historically targets JDK 7–9). Switching + the JDK sidesteps this whole class of failures rather than patching each bundled + Java build. Need an **arm64** JDK 8 — the installed AdoptOpenJDK 8 is x86_64. + `main/mac-silicon-configure.sh` default JAVA_HOME → `.../temurin-8.jdk/...`. +- Build process stopped; `logging.patch` reverted to pristine. + +### JDK 8 must be native arm64 (no Rosetta) + +User is disabling Rosetta, so the x86_64 Temurin 8 / AdoptOpenJDK 8 are out. +`temurin@8` has **no** macOS arm64 build. **Amazon Corretto 8 does** +(`corretto@8` cask → `amazon-corretto-8.504.01.1-macosx-aarch64.pkg`). Azul Zulu 8 +arm64 also exists as an alternative. Everything else in the toolchain is already +native arm64 (clang, dmake, epm, gpatch, gawk; `/usr/bin/perl` is universal). + +### `build.pl --all` failures seen so far + +| Module | Failure | Fix | +| --- | --- | --- | +| `apache-commons/commons-logging` | javac `source 1.5` rejected | switch to JDK 8 (done) | +| `hyphen` | `awk: calling undefined function gensub` — the bundled `hyphen-2.8.8` Makefile calls `awk`; macOS `awk` is BSD, `gensub` is gawk-only | `brew install gawk` (done); `mac-silicon-build.sh` puts `/opt/homebrew/opt/gawk/libexec/gnubin` (exposes gawk as `awk`) first on PATH | +| `apache-commons/commons-logging` (2nd) | `servlet-api.jar ... class file has wrong version 55.0, should be 52.0` — the earlier JDK 11 run had delivered Java-11 `servlet-api.jar` / `saxon.jar` / `hsqldb.jar` into `solver/` | wiped all 21 `*/unxmaccr.pro` dirs + `main/solver`, re-bootstrapped, full clean rebuild under arm64 Corretto 8 | + +**Full clean rebuild started under arm64 Corretto 8** (build-all-4.log). Prior partial +builds were a JDK-11/JDK-8/x86_64 mix — not trustworthy for a production build. + +| `xmlsecurity` (~149 modules in, run 4) | `clang++: error: no such file or directory: '.../MacOSX15.5.sdk/usr/lib/libxml2.a'` — `xmlsecurity/util/makefile.mk:179` links `$(LIBXML_PREFIX)/lib/libxml2.{dylib,a}`; configure had picked the SDK's `/usr/bin/xml2-config` as "system libxml", but the SDK ships only `.tbd` stubs (and its libxml2 is too old for bundled xmlsec1 per the makefile's own comments) | `--without-system-libxml --without-system-libxslt` in `mac-silicon-configure.sh` → buil [...] + +vcl (native aqua backend), the arm64 UNO bridge (jvmfwk/bridges), svx, sfx2, framework, +editeng all built clean before this — the arm64 C++ port is largely sound. + +New wrapper: **`main/mac-silicon-build.sh`** — prepends the gawk gnubin dir, sets the +CA bundle, sources `MacOSXAARCH64Env.Set.sh`, runs `build.pl --all -P4 --stoponerror` +(passes through any args, e.g. `--from hyphen`). + +## Milestone 2 — RESULT: whole codebase compiles on Apple Silicon ✅ (2026-09-03) + +`./mac-silicon-build.sh` (build-all-6.log): **166 modules built, zero compile errors**, +under native arm64 Corretto 8 / clang 17 / macOS 15.5 SDK / deployment target 11.0. +Includes VCL (native Cocoa/aqua backend), the arm64 UNO C++ bridge (`bridges`, +`jvmfwk`), `sal`/`cppu`, `svx`, `sfx2`, `framework`, `editeng`, `sw` (Writer), +`sc` (Calc), `sd` (Impress), `chart2`, `dbaccess`, `reportdesign`, `xmlsecurity`, +bundled `python`/`curl`/`libxml2`/`libxslt`/`openssl`/`nss`/`hunspell`/`icu`/`coinmp`. + +**The `.dmg` assembly (`instsetoo_native`) is the only thing still failing**, on +install-manifest (`scp2`) vs build-output mismatches: + +| Missing file (per `remove_Files_Without_Sourcedirectory`) | Cause | Status | +| --- | --- | --- | +| `libcrypto.dylib.3`, `libssl.dylib.3` | `scp2/inc/macros.inc:548` `SCP2_URE_DL_VER` emits Linux-style `libNAME.dylib.V`; `main/openssl` (openssl-3.0.20) delivers macOS-style `libNAME.V.dylib` | **fixed** — `MACOSX` branch in `scp2/source/ooo/file_library_ooo.scp` (`gid_File_Lib_Openssl`, `gid_File_Lib_Crypto`) → `libssl.3.dylib` / `libcrypto.3.dylib` | +| `OOoPython.framework.zip` | `scp2/source/python/*.scp` still expects the old macOS **framework** layout (`OOoPython.framework`, `Python.app` symlinks, `PYTHONHOME` rel to framework). The Python-3 migration made `python/makefile.mk` build a **plain `--enable-shared` Unix install** on all UNX incl. macOS — no `--enable-framework`, no `.zip`. | **OPEN — next work item** | + +### Next work item: macOS bundled-Python packaging + +Pick one: +- **(a)** `python/makefile.mk` macOS branch: `./configure --enable-framework=<path>/OOoPython.framework` + + produce `OOoPython.framework.zip`; keep `scp2/source/python/*.scp` as-is. (Closest to + what scp2 already wants; risk is `--enable-framework` on arm64 CPython 3.10 + AOO patches.) +- **(b)** Rewrite `scp2/source/python/{file,profileitem,makefile,module}_python.scp` for the + Unix layout on macOS (mirror the Linux `#else` paths: `python-core-3.10.zip`, + `libpython3.10.dylib`, `program/python-core-3.10/lib/python3.10/...`), and fix pyuno's + runtime path resolution accordingly. + +After that: rerun `./mac-silicon-build.sh`; if the DMG builds, smoke-test +`instsetoo_native/.../Apache_OpenOffice.app` (launch Writer, run a Basic macro, try a +`pyuno` script). Then: code-signing / notarization for distribution (not done on this +branch). + ## Status / Next -**Milestone (configure + bootstrap) DONE.** Committed on `mac-silicon-minimal`: -`main/mac-silicon-configure.sh`, `main/mac-silicon-bootstrap.sh`, `main/.gitignore` -(`/macos_c11`), this doc. (`unowinreg.dll` is gitignored, present locally only.) +**Milestone 2 committed** on `mac-silicon-minimal`: `mac-silicon-build.sh`, +`libxml2/makefile.mk` (`xmllint` deliver path), `scp2/.../file_library_ooo.scp` (openssl +dylib names), configure-wrapper flags (`--without-system-{curl,libxml,libxslt}`, JDK 8), +`mac-silicon-bootstrap.sh` (CA bundle), this doc. + +**Next:** the macOS bundled-Python packaging item above → then a building `.dmg`. +Other known gaps: NSS 3.39 age (compiled OK here, watch at runtime); code-signing. -**Next (new milestone — reassess with user first):** -`cd main && . ./MacOSXAARCH64Env.Set.sh && cd instsetoo_native && ../solenv/bin/build.pl --all` -— expect real C++/clang-17 port work (NSS 3.39 too old for arm64; bundled curl/python/ -hunspell under clang 17; Java build under JDK 25 vs 11). ~20 GB, hours. +**Milestone 1 (configure + bootstrap) DONE** — committed on `mac-silicon-minimal` +(`503d3e75c9`): `main/mac-silicon-configure.sh`, `main/mac-silicon-bootstrap.sh`, +`main/.gitignore` (`/macos_c11`), this doc. (`unowinreg.dll` gitignored, local only.) diff --git a/main/libxml2/makefile.mk b/main/libxml2/makefile.mk index 8f5a105406..3716ac0fbf 100644 --- a/main/libxml2/makefile.mk +++ b/main/libxml2/makefile.mk @@ -118,7 +118,10 @@ OUTDIR2INC=include$/libxml .IF "$(OS)"=="MACOSX" EXTRPATH=URELIB OUT2LIB+=.libs$/libxml2.a -OUT2BIN+=.libs$/xmllint +# With --enable-shared=no (see CONFIGURE_FLAGS above), libtool links xmllint +# directly against the static lib -- no .libs/ wrapper copy -- so the binary +# lands at the build root. (Cf. libxslt/makefile.mk's xsltproc handling.) +OUT2BIN+=xmllint OUT2BIN+=xml2-config .ELIF "$(OS)"=="WNT" .IF "$(COM)"=="GCC" diff --git a/main/mac-silicon-build.sh b/main/mac-silicon-build.sh new file mode 100755 index 0000000000..b2a70d04e6 --- /dev/null +++ b/main/mac-silicon-build.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# +# Apache OpenOffice - Apple Silicon (arm64) full-build wrapper. +# +# See ../.agent/mac-silicon-port.md for the full porting notes. +# +# Run from main/ after ./mac-silicon-configure.sh && ./mac-silicon-bootstrap.sh: +# ./mac-silicon-build.sh # build.pl --all -P4 --stoponerror +# ./mac-silicon-build.sh --from hyphen # pass through any build.pl args +# +# Everything here must run WITHOUT Rosetta - native arm64 only. + +set -e + +SRCDIR=$(cd "$(dirname "$0")" && pwd) +cd "$SRCDIR" + +# GNU awk: the bundled hyphen-2.8.8 Makefile calls `awk` and uses gensub(), +# a gawk-only function. Homebrew gawk's gnubin dir exposes it as `awk`. +GAWK_GNUBIN=/opt/homebrew/opt/gawk/libexec/gnubin +if [ -x "$GAWK_GNUBIN/awk" ]; then + PATH="$GAWK_GNUBIN:$PATH" + export PATH +fi + +# CA bundle for any perl LWP fetches that still happen during the build +# (Apple perl has no Mozilla::CA). +export SSL_CERT_FILE=/etc/ssl/cert.pem +export PERL_LWP_SSL_CA_FILE=/etc/ssl/cert.pem +export CURL_CA_BUNDLE=/etc/ssl/cert.pem + +. ./MacOSXAARCH64Env.Set.sh + +# re-assert the gawk gnubin dir in case the env script reordered PATH +case ":$PATH:" in + *":$GAWK_GNUBIN:"*) : ;; + *) [ -x "$GAWK_GNUBIN/awk" ] && PATH="$GAWK_GNUBIN:$PATH" && export PATH ;; +esac + +cd instsetoo_native +if [ "$#" -eq 0 ]; then + set -- --all -P4 --stoponerror +fi +exec ../solenv/bin/build.pl "$@" diff --git a/main/mac-silicon-configure.sh b/main/mac-silicon-configure.sh index 5d59300475..5da9ec7a2a 100755 --- a/main/mac-silicon-configure.sh +++ b/main/mac-silicon-configure.sh @@ -18,12 +18,17 @@ cd "$SRCDIR" # --- toolchain selection ----------------------------------------------------- -# JDK. Temurin 11 (arm64) is the intended production JDK, but installing the -# Homebrew cask needs an admin password. OpenJDK 25 (arm64, already installed) -# passes configure's checks and is fine for the configure/bootstrap milestone. -# Override by exporting JAVA_HOME before running this script. -: "${JAVA_HOME:=/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home}" +# JDK. AOO's build (bundled apache-commons, saxon, lucene, hsqldb, ...) uses +# javac source/target levels that JDK 11+ rejects ("Source option 1.5 is no +# longer supported"), so this port builds with JDK 8 - and it must be a native +# arm64 JDK 8 (no Rosetta). Amazon Corretto 8 ships macOS aarch64; +# `brew install --cask corretto@8`. Override by exporting JAVA_HOME. +: "${JAVA_HOME:=/Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home}" export JAVA_HOME +if [ ! -x "$JAVA_HOME/bin/javac" ]; then + echo "mac-silicon-configure: JAVA_HOME has no bin/javac: $JAVA_HOME" >&2 + exit 1 +fi # Apple's system perl has every module configure requires (Archive::Zip, # LWP::UserAgent, LWP::Protocol::https, XML::Parser, Digest::*). Homebrew perl @@ -45,6 +50,8 @@ autoconf --with-macosx-target=11.0 \ --without-system-python \ --without-system-curl \ + --without-system-libxml \ + --without-system-libxslt \ --with-gnu-patch=/opt/homebrew/opt/gpatch/bin/gpatch \ --without-junit \ --without-stlport \ diff --git a/main/scp2/source/ooo/file_library_ooo.scp b/main/scp2/source/ooo/file_library_ooo.scp index bae968b757..922e0f73d1 100644 --- a/main/scp2/source/ooo/file_library_ooo.scp +++ b/main/scp2/source/ooo/file_library_ooo.scp @@ -1791,6 +1791,10 @@ File gid_File_Lib_Openssl Name = "libssl-3.dll"; #elif defined(WNT) && defined(X86_64) Name = "libssl-3-x64.dll"; + #elif defined(MACOSX) + /* macOS versions dylibs as libNAME.V.dylib, not SCP2_URE_DL_VER's + libNAME.dylib.V; match what main/openssl delivers. */ + Name = "libssl.3.dylib"; #else Name = SCP2_URE_DL_VER("ssl", "3"); #endif @@ -1806,6 +1810,9 @@ File gid_File_Lib_Crypto Name = "libcrypto-3.dll"; #elif defined(WNT) && defined(X86_64) Name = "libcrypto-3-x64.dll"; + #elif defined(MACOSX) + /* see gid_File_Lib_Openssl above */ + Name = "libcrypto.3.dylib"; #else Name = SCP2_URE_DL_VER("crypto", "3"); #endif
