This is an automated email from the ASF dual-hosted git repository.
jimjag pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new 8c537dee59 Don't force MAC_OS_X_VERSION_MAX_ALLOWED (breaks on macOS
11+ SDKs)
8c537dee59 is described below
commit 8c537dee592d6af715b13414815e3c9b980ab315
Author: Jim Jagielski <[email protected]>
AuthorDate: Thu Jun 11 17:15:06 2026 -0400
Don't force MAC_OS_X_VERSION_MAX_ALLOWED (breaks on macOS 11+ SDKs)
Building sal on a modern SDK fails:
AvailabilityMacros.h:128: error: MAC_OS_X_VERSION_MAX_ALLOWED must be
>= MAC_OS_X_VERSION_MIN_REQUIRED
Both build systems passed
-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_<deployment-target>
(unxmacc.mk for dmake, gbuild/platform/macosx.mk for gbuild). Apple renamed
the SDK version constants at macOS 11: the old MAC_OS_X_VERSION_<v> family
stops at 10_15, and 11+ uses MAC_OS_VERSION_<v> (no "_X_"). With our 11.0
Apple Silicon deployment baseline this generates MAC_OS_X_VERSION_11_0,
which
is undefined -> the preprocessor treats it as 0 -> MAX_ALLOWED(0) <
MIN_REQUIRED(110000) -> #error.
Drop the -D in both places and let the SDK auto-derive MAX_ALLOWED as
max(14.0, MIN_REQUIRED), which is what a modern SDK wants. Verified by
compiling <AvailabilityMacros.h> with -mmacosx-version-min=11.0: fails with
the forced -D, compiles cleanly without it. Nothing in the tree reads this
macro -- the only consumer (vcl PictToBmpFlt.cxx) checks the distinct
__MAC_OS_X_VERSION_MAX_ALLOWED -- so removal is safe on old SDKs too.
---
main/solenv/gbuild/platform/macosx.mk | 9 ++++++---
main/solenv/inc/unxmacc.mk | 13 ++++++++++---
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/main/solenv/gbuild/platform/macosx.mk
b/main/solenv/gbuild/platform/macosx.mk
index b9501be453..cd4953fcd3 100644
--- a/main/solenv/gbuild/platform/macosx.mk
+++ b/main/solenv/gbuild/platform/macosx.mk
@@ -110,9 +110,12 @@ endif
gb_OBJCFLAGS := -x objective-c -fobjc-exceptions
gb_OBJCXXFLAGS := -x objective-c++ -fobjc-exceptions
-ifneq ($(MACOSX_DEPLOYMENT_TARGET),)
- gb_CXXFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_$(subst
.,_,$(MACOSX_DEPLOYMENT_TARGET))
-endif
+# Do NOT force MAC_OS_X_VERSION_MAX_ALLOWED. Apple renamed the constants at
+# macOS 11: the old MAC_OS_X_VERSION_<v> family stops at 10_15, and 11+ uses
+# MAC_OS_VERSION_<v> (no "_X_"). Forcing MAC_OS_X_VERSION_11_0 references an
+# undefined macro (expands to 0) and trips AvailabilityMacros.h's
+# "MAX_ALLOWED must be >= MIN_REQUIRED" #error. Letting it default makes the
+# SDK derive max(14.0, MIN_REQUIRED). (Mirrors solenv/inc/unxmacc.mk.)
ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
gb_CFLAGS_WERROR := -Werror -Wno-error=deprecated
diff --git a/main/solenv/inc/unxmacc.mk b/main/solenv/inc/unxmacc.mk
index 5171a6be45..5f2d00fbda 100644
--- a/main/solenv/inc/unxmacc.mk
+++ b/main/solenv/inc/unxmacc.mk
@@ -36,9 +36,16 @@ LINKOUTPUT_FILTER=
# compiling STLport sources too, either internally or externally.
CDEFS+=-DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNO_PTHREAD_PRIORITY
$(PROCESSOR_DEFINES) -D_USE_NAMESPACE=1
-.IF "$(MACOSX_DEPLOYMENT_TARGET)" != ""
- CDEFS += -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_$(subst,.,_
$(MACOSX_DEPLOYMENT_TARGET))
-.ENDIF
+# Do NOT force MAC_OS_X_VERSION_MAX_ALLOWED. Apple renamed the constants at
+# macOS 11: the old MAC_OS_X_VERSION_<v> family stops at 10_15, and 11+ uses
+# MAC_OS_VERSION_<v> (no "_X_"). The old code emitted
+# -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_$(target), which for an 11.0+
+# deployment target references an undefined macro (expands to 0) and trips
+# AvailabilityMacros.h's "MAC_OS_X_VERSION_MAX_ALLOWED must be >=
+# MAC_OS_X_VERSION_MIN_REQUIRED" #error. Leaving it unset lets the SDK derive
+# the correct value, max(14.0, MIN_REQUIRED). Nothing in the tree reads this
+# macro (the lone consumer, vcl PictToBmpFlt.cxx, checks the distinct
+# __MAC_OS_X_VERSION_MAX_ALLOWED), so dropping the -D is safe on old SDKs too.
CDEFS+=-DQUARTZ
EXTRA_CDEFS*=-isysroot $(MACOSX_SDK_PATH)