This seems strange to me as I don't get this issue. Could this be related to a newer version of Apple cctools/Xcode?, could you give an example of what you attempt to run and get an issue with not finding ntdll.so?
The following make sense to keep for general usage on macOS, this would save the macOS specific step of fixing the libraries install_name.
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 426336e4536..0a72e6fbe49 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( "@rpath/%s.so", output_name ) );
+ }
strarray_addall( link_args, flags );
return link_args;
For the injecting LDFLAGS it would be better to add for example UNIX_LDFLAGS so any specific linker flags can be passed only for the unix libraries.