Brendan Shanks : makefiles: On macOS, use @rpath instead of @loader_path when building Unix libs.

Alexandre Julliard julliard at winehq.org
Tue Mar 8 16:10:47 CST 2022


Module: wine
Branch: master
Commit: 7b27e60e67d966a6db99dd2611310bc6e02a8e77
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=7b27e60e67d966a6db99dd2611310bc6e02a8e77

Author: Brendan Shanks <bshanks at codeweavers.com>
Date:   Mon Mar  7 12:59:02 2022 -0800

makefiles: On macOS, use @rpath instead of @loader_path when building Unix libs.

Fixes launching 32-bit EXEs from a WOW64 build dir.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52618
Signed-off-by: Brendan Shanks <bshanks at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 configure               | 2 +-
 configure.ac            | 2 +-
 tools/winegcc/winegcc.c | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 8cdee2b354a..990f1f9d610 100755
--- a/configure
+++ b/configure
@@ -10042,7 +10042,7 @@ fi
         LIBS="$ac_save_LIBS"
     fi
 
-    UNIXLDFLAGS="-dynamiclib -install_name @loader_path/\$(UNIXLIB)"
+    UNIXLDFLAGS="-dynamiclib -install_name @rpath/\$(UNIXLIB) -Wl,-rpath, at loader_path\/"
     LIBWINE_SHAREDLIB="libwine.$libwine_version.dylib"
 
     LIBWINE_LDFLAGS="-dynamiclib -install_name @rpath/libwine.$libwine_soversion.dylib -Wl,-rpath, at loader_path/ -compatibility_version $libwine_soversion -current_version $libwine_version"
diff --git a/configure.ac b/configure.ac
index 8fcdb15bbad..445d3048198 100644
--- a/configure.ac
+++ b/configure.ac
@@ -773,7 +773,7 @@ case $host_os in
         LIBS="$ac_save_LIBS"
     fi
 
-    UNIXLDFLAGS="-dynamiclib -install_name @loader_path/\$(UNIXLIB)"
+    UNIXLDFLAGS="-dynamiclib -install_name @rpath/\$(UNIXLIB) -Wl,-rpath, at loader_path\/"
     AC_SUBST(LIBWINE_SHAREDLIB,"libwine.$libwine_version.dylib")
     AC_SUBST(LIBWINE_LDFLAGS,["-dynamiclib -install_name @rpath/libwine.$libwine_soversion.dylib -Wl,-rpath, at loader_path/ -compatibility_version $libwine_soversion -current_version $libwine_version"])
     AC_SUBST(WINELOADER_DEPENDS,"wine_info.plist")
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index bcec3916843..ab26adb07e8 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -416,7 +416,8 @@ static struct strarray get_link_args( struct options *opts, const char *output_n
         if (opts->unix_lib)
         {
             strarray_add( &flags, "-install_name" );
-            strarray_add( &flags, strmake( "@loader_path/%s.so", output_name ) );
+            strarray_add( &flags, strmake( "@rpath/%s.so", output_name ) );
+            strarray_add( &flags, "-Wl,-rpath, at loader_path/" );
         }
         strarray_addall( &link_args, flags );
         return link_args;




More information about the wine-cvs mailing list