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

jimjag pushed a commit to branch AOO50X
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/AOO50X by this push:
     new e99d1e41aa macOS: rewrite install names of gbuild executables
e99d1e41aa is described below

commit e99d1e41aac24a867ad422d381c438a420556e77
Author: Jim Jagielski <[email protected]>
AuthorDate: Thu Sep 10 13:01:40 2026 -0400

    macOS: rewrite install names of gbuild executables
    
    gbuild ran macosx-change-install-names.pl only for libraries, so uno.bin and
    regcomp.bin shipped @_______ load paths that resolve only via 
DYLD_LIBRARY_PATH.
    
    (cherry picked from commit 5b69b91256f59140d943c8d465c9d695d23f560d)
---
 main/solenv/bin/macosx-change-install-names.pl |  4 ++++
 main/solenv/bin/macosx-check-load-commands.sh  | 10 ++++------
 main/solenv/gbuild/platform/macosx.mk          |  2 ++
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/main/solenv/bin/macosx-change-install-names.pl 
b/main/solenv/bin/macosx-change-install-names.pl
index eaaea58373..1aee940926 100644
--- a/main/solenv/bin/macosx-change-install-names.pl
+++ b/main/solenv/bin/macosx-change-install-names.pl
@@ -37,6 +37,10 @@ sub action($$$)
          # while the libraries are installed in Contents/program.
          'app/BRANDBIN/URELIB' => '@executable_path/../program',
          'app/BRANDBIN/OOO' => '@executable_path/../program',
+         # gbuild calls its SDK and build-tool executable layers SDKBIN and 
NONEBIN.
+         'app/SDKBIN/URELIB' => '@executable_path',
+         'app/NONEBIN/URELIB' => '@__VIA_LIBRARY_PATH__',
+         'app/NONEBIN/OOO' => '@__VIA_LIBRARY_PATH__',
          'app/NONE/URELIB' => '@__VIA_LIBRARY_PATH__',
          'app/NONE/OOO' => '@__VIA_LIBRARY_PATH__',
          'app/NONE/NONE' => '@__VIA_LIBRARY_PATH__',
diff --git a/main/solenv/bin/macosx-check-load-commands.sh 
b/main/solenv/bin/macosx-check-load-commands.sh
index 5f71606388..d28a462fc3 100755
--- a/main/solenv/bin/macosx-check-load-commands.sh
+++ b/main/solenv/bin/macosx-check-load-commands.sh
@@ -20,13 +20,11 @@
 #
 #**************************************************************
 #
-# Fail when a Mach-O under the given paths still loads from or searches the
-# CPython staging prefix, which does not exist outside the build tree.
+# Fail when a Mach-O under the given paths still loads from or searches a
+# build-time location: the CPython staging prefix or an unresolved @_______
+# placeholder that macosx-change-install-names.pl should have rewritten.
 #
 #   ./solenv/bin/macosx-check-load-commands.sh <bundle-or-file> ...
-#
-# Unresolved @_______ placeholders are not rejected: gbuild executables such as
-# uno.bin and regcomp.bin still ship them and load only via DYLD_LIBRARY_PATH.
 
 set -euo pipefail
 
@@ -42,7 +40,7 @@ done < <(find "$@" -type f -print0 | xargs -0 file --no-pad 
--print0 -- 2>/dev/n
 bad=$(printf '%s\0' "${machos[@]}" | xargs -0 otool -l | awk '
        /^[^[:space:]].*:$/ { file = $0; next }
        $1 == "cmd" { cmd = $2; next }
-       cmd != "LC_ID_DYLIB" && ($1 == "name" || $1 == "path") && /python-inst/ 
{
+       cmd != "LC_ID_DYLIB" && ($1 == "name" || $1 == "path") && 
/python-inst|@_______/ {
                print file " " cmd " " $2
        }')
 if [ -n "$bad" ]; then
diff --git a/main/solenv/gbuild/platform/macosx.mk 
b/main/solenv/gbuild/platform/macosx.mk
index dbce1906a7..a2fa3183a7 100644
--- a/main/solenv/gbuild/platform/macosx.mk
+++ b/main/solenv/gbuild/platform/macosx.mk
@@ -342,6 +342,8 @@ $(call gb_Helper_abbreviate_dirs,\
        $(if $(filter Library,$(TARGETTYPE)),\
                $(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl Library 
$(LAYER) $(1) && \
                $(if $(filter %.dylib,$(1)),ln -shf $(1) $(patsubst 
%.dylib,%.jnilib,$(1)) &&)) \
+       $(if $(and $(filter Executable,$(TARGETTYPE)),$(LAYER)),\
+               $(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl 
Executable $(LAYER) $(1) &&) \
        rm -f $${DYLIB_FILE})
 endef
 

Reply via email to