config_host.mk.in                 |    1 +
 configure.ac                      |   12 ++++++++++++
 desktop/Executable_soffice_bin.mk |   12 +++++++-----
 3 files changed, 20 insertions(+), 5 deletions(-)

New commits:
commit b7fd89100d8653dc73955780358fe31d38b68ebf
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Fri Feb 14 15:23:15 2020 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Fri Feb 14 17:29:45 2020 +0100

    tdf#122218: Baseline Xcode 9.3 ld presumably doesn't support 
-platform_version
    
    ...according to <https://github.com/llvm/llvm-project/commit/
    25ce33a6e4f3b13732c0f851e68390dc2acb9123> "[driver][darwin] Pass
    -platform_version flag to the linker instead of the -<platform>_version_min
    flag":  "In Xcode 11, ld added a new flag called -platform_version [...] 
This
    patch adopts the new -platform_version flag in Clang, and starts using it by
    default, unless a linker version < 520 is passed to the driver."
    
    So detect new HAVE_MACOS_LD_PLATFORMVERSION and adapt
    645fe53be0dc36535dba0ed684e21ca4cda80d70 "tdf#122218: Hack to avoid blurry 
text
    with macOS SDK 10.15" accordingly.
    
    (This also changes the passed -platform_verion sdk value from 0.0 to 0.0.0, 
for
    cosmetic consistency with the default Clang behavior cited above.  Also, 
after
    f67e5ef9a5c71f3b35b1c67eb72794e44cc15410 "Drop broken filter-out of
    -bind_at_load for Executable_soffice_bin on macOS" got included in the 
meantime,
    the surrounding ifeq in desktop/Executable_soffice_bin.mk can be combined 
now.)
    
    Change-Id: Ie1ddf2d618e2f1232c6b4e17ce17665851f3bd38
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88717
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/config_host.mk.in b/config_host.mk.in
index 88a529da664a..9dd4b72c421c 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -266,6 +266,7 @@ export 
HAVE_GCC_STACK_CLASH_PROTECTION=@HAVE_GCC_STACK_CLASH_PROTECTION@
 export HAVE_GNUMAKE_FILE_FUNC=@HAVE_GNUMAKE_FILE_FUNC@
 export HAVE_LD_BSYMBOLIC_FUNCTIONS=@HAVE_LD_BSYMBOLIC_FUNCTIONS@
 export HAVE_LD_HASH_STYLE=@HAVE_LD_HASH_STYLE@
+export HAVE_MACOS_LD_PLATFORMVERSION=@HAVE_MACOS_LD_PLATFORMVERSION@
 export HAVE_POSIX_FALLOCATE=@HAVE_POSIX_FALLOCATE@
 export HAVE_WDEPRECATED_COPY_DTOR=@HAVE_WDEPRECATED_COPY_DTOR@
 export HELP_ONLINE=@HELP_ONLINE@
diff --git a/configure.ac b/configure.ac
index 631a4a9709f1..3fa8fc760e3f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2792,6 +2792,7 @@ dnl 
===================================================================
 dnl Check macOS SDK and compiler
 dnl ===================================================================
 
+HAVE_MACOS_LD_PLATFORMVERSION=
 if test $_os = Darwin; then
 
     # If no --with-macosx-sdk option is given, look for one
@@ -3027,6 +3028,16 @@ if test $_os = Darwin; then
     AC_MSG_CHECKING([what macOS app bundle identifier to use])
     MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
     AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
+
+    AC_MSG_CHECKING([whether the linker supports -platform_version])
+    save_LDFLAGS=$LDFLAGS
+    LDFLAGS="$LDFLAGS -Xlinker -platform_version -Xlinker macos \
+        -Xlinker $MAC_OS_X_VERSION_MIN_REQUIRED_DOTS -Xlinker 0.0.0"
+    AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+        [AC_MSG_RESULT([yes])
+         HAVE_MACOS_LD_PLATFORMVERSION=TRUE],
+        [AC_MSG_RESULT([no])])
+    LDFLAGS=$save_LDFLAGS
 fi
 AC_SUBST(MACOSX_SDK_PATH)
 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
@@ -3039,6 +3050,7 @@ AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
 AC_SUBST(ENABLE_MACOSX_SANDBOX)
 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
+AC_SUBST(HAVE_MACOS_LD_PLATFORMVERSION)
 
 dnl ===================================================================
 dnl Check iOS SDK and compiler
diff --git a/desktop/Executable_soffice_bin.mk 
b/desktop/Executable_soffice_bin.mk
index f9be897ffa1f..0d9646c78563 100644
--- a/desktop/Executable_soffice_bin.mk
+++ b/desktop/Executable_soffice_bin.mk
@@ -23,15 +23,17 @@ $(eval $(call gb_Executable_add_cobjects,soffice_bin,\
     desktop/source/app/main \
 ))
 
-ifeq ($(OS),MACOSX)
-
+ifeq ($(OS)-$(HAVE_MACOS_LD_PLATFORMVERSION),MACOSX-TRUE)
 # At least when building against SDK 10.15, changing the LC_VERSION_MIN_MACOSX 
load command's sdk
-# value from 10.15 to "n/a" (i.e., 0.0) is necessary to avoid blurry text in 
the LO UI:
+# value from 10.15 to "n/a" (i.e., 0.0.0) is necessary to avoid blurry text in 
the LO UI (see
+# 
<https://github.com/llvm/llvm-project/commit/25ce33a6e4f3b13732c0f851e68390dc2acb9123>
+# "[driver][darwin] Pass -platform_version flag to the linker instead of the
+# -<platform>_version_min flag", 
clang/test/Driver/darwin-ld-platform-version-macos.c in particular,
+# for the -platform_version that Clang passes by default to new-enough ld):
 $(eval $(call gb_Executable_add_ldflags,soffice_bin, \
     -Xlinker -platform_version -Xlinker macos -Xlinker 
$(MAC_OS_X_VERSION_MIN_REQUIRED_DOTS) \
-        -Xlinker 0.0 \
+        -Xlinker 0.0.0 \
 ))
-
 endif
 
 ifeq ($(OS),WNT)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to