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

Dean Greer gcenx83 at gmail.com
Tue Mar 8 12:40:03 CST 2022


Gijs and myself also tested and confirmed this resolves this long standing
issue.

On Mon, Mar 7, 2022 at 3:59 PM Brendan Shanks <bshanks at codeweavers.com>
wrote:

> 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>
> ---
>  configure.ac            | 2 +-
>  tools/winegcc/winegcc.c | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index ab3490b21cd..d408b1f344b 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;
> --
> 2.32.0 (Apple Git-132)
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20220308/b29f9df6/attachment.htm>


More information about the wine-devel mailing list