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@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Brendan Shanks 2022-03-07 12:59:02 -08:00 committed by Alexandre Julliard
parent d8937c0719
commit 7b27e60e67
3 changed files with 4 additions and 3 deletions

2
configure vendored
View File

@ -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,@loader_path\/"
LIBWINE_SHAREDLIB="libwine.$libwine_version.dylib"
LIBWINE_LDFLAGS="-dynamiclib -install_name @rpath/libwine.$libwine_soversion.dylib -Wl,-rpath,@loader_path/ -compatibility_version $libwine_soversion -current_version $libwine_version"

View File

@ -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,@loader_path\/"
AC_SUBST(LIBWINE_SHAREDLIB,"libwine.$libwine_version.dylib")
AC_SUBST(LIBWINE_LDFLAGS,["-dynamiclib -install_name @rpath/libwine.$libwine_soversion.dylib -Wl,-rpath,@loader_path/ -compatibility_version $libwine_soversion -current_version $libwine_version"])
AC_SUBST(WINELOADER_DEPENDS,"wine_info.plist")

View File

@ -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,@loader_path/" );
}
strarray_addall( &link_args, flags );
return link_args;