[gcc r14-8241] Darwin: Suppress adding embedded rpaths for earlier OS versions.

Iain D Sandoe iains@gcc.gnu.org
Thu Jan 18 14:24:25 GMT 2024


https://gcc.gnu.org/g:49478485f23d1b1645201ba4d3fc83a6c2852a3d

commit r14-8241-g49478485f23d1b1645201ba4d3fc83a6c2852a3d
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Mon Jan 8 17:00:18 2024 +0000

    Darwin: Suppress adding embedded rpaths for earlier OS versions.
    
    When we have @rpath support by virtue of the OS version we're hosting on
    we still need to omit those rpath entries when targeting < 10.5 (or the
    linker will complain).  To do this we (maybe ab-)use a property of the
    spec function expansion that a non-null return value can be used as the
    true input to a second spec (whereas, unfortunately, we cannot pass specs
    to the version function at present).
    
    gcc/ChangeLog:
    
            * config/darwin.h (DARWIN_RPATH_SPEC): Arrange for the %P spec
            to be conditional on macosx-version-min.
    
    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

Diff:
---
 gcc/config/darwin.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index e94a29c639c..cb96d67b3b1 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -612,8 +612,7 @@ extern GTY(()) int darwin_ms_struct;
    director as one being loaded.  */
 #define DARWIN_RPATH_SPEC \
   "%:version-compare(>= 10.5 mmacosx-version-min= -rpath) \
-   %:version-compare(>= 10.5 mmacosx-version-min= @loader_path) \
-   %P "
+   %{%:version-compare(>= 10.5 mmacosx-version-min= @loader_path): %P }"
 #else
 #define DARWIN_RPATH_SPEC ""
 #endif


More information about the Gcc-cvs mailing list