Huw Davies : winegcc: Add a @loader_path to help the macOS loader find ntdll.so.

Alexandre Julliard julliard at winehq.org
Mon Aug 23 16:24:13 CDT 2021


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon Aug 23 07:30:10 2021 +0100

winegcc: Add a @loader_path to help the macOS loader find ntdll.so.

On macOS unixlibs that link to ntdll.so currently fail to load.
It appears the macOS loader needs to be able to locate the file
even if the library is already loaded.

This patch changes the LC_ID_DYLIB name of ntdll.so to
"@loader_path/ntdll.so" so that when other unixlibs link against this
they will insert that name into their LC_LOAD_DYLIB entry for
ntdll.so.

While changing only ntdll.so is necessary, for simplicity this patch
changes all unixlibs.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51632
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/winegcc/winegcc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 426336e4536..710f6dc900d 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -492,6 +492,11 @@ static strarray *get_link_args( struct options *opts, const char *output_name )
             strarray_add( flags, opts->image_base );
         }
         if (opts->strip) strarray_add( flags, "-Wl,-x" );
+        if (opts->unix_lib)
+        {
+            strarray_add( flags, "-install_name" );
+            strarray_add( flags, strmake( "@loader_path/%s.so", output_name ) );
+        }
         strarray_addall( link_args, flags );
         return link_args;
 




More information about the wine-cvs mailing list