From: Davide Beatrici git@davidebeatrici.dev
--- loader/main.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/loader/main.c b/loader/main.c index 242ff15accd..e53ee5c2c8b 100644 --- a/loader/main.c +++ b/loader/main.c @@ -34,6 +34,8 @@ # include <sys/sysctl.h> #endif
+#include "wine/dir.h" + #include "main.h"
extern char **environ; @@ -126,17 +128,6 @@ static void *try_dlopen( const char *dir, const char *name )
static void *load_ntdll( char *argv0 ) { -#ifdef __i386__ -#define SO_DIR "i386-unix/" -#elif defined(__x86_64__) -#define SO_DIR "x86_64-unix/" -#elif defined(__arm__) -#define SO_DIR "arm-unix/" -#elif defined(__aarch64__) -#define SO_DIR "aarch64-unix/" -#else -#define SO_DIR "" -#endif const char *self = get_self_exe( argv0 ); char *path, *p; void *handle = NULL; @@ -148,7 +139,7 @@ static void *load_ntdll( char *argv0 ) handle = try_dlopen( p, "dlls/ntdll/ntdll.so" ); free( p ); } - else handle = try_dlopen( path, BIN_TO_DLLDIR "/" SO_DIR "ntdll.so" ); + else handle = try_dlopen( path, BIN_TO_DLLDIR "/" SO_DIR "/ntdll.so" ); free( path ); }
@@ -157,14 +148,14 @@ static void *load_ntdll( char *argv0 ) path = strdup( path ); for (p = strtok( path, ":" ); p; p = strtok( NULL, ":" )) { - handle = try_dlopen( p, SO_DIR "ntdll.so" ); + handle = try_dlopen( p, SO_DIR "/ntdll.so" ); if (!handle) handle = try_dlopen( p, "ntdll.so" ); if (handle) break; } free( path ); }
- if (!handle && !self) handle = try_dlopen( DLLDIR, SO_DIR "ntdll.so" ); + if (!handle && !self) handle = try_dlopen( DLLDIR, SO_DIR "/ntdll.so" );
return handle; }