Module: wine Branch: master Commit: 4e9f855be55fadf42627cd303841462aa2d80824 URL: https://source.winehq.org/git/wine.git/?a=commit;h=4e9f855be55fadf42627cd303...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Dec 8 18:44:33 2020 +0100
winegcc: Look for ntdll.so instead of libwine.so to find the library directory.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
tools/winegcc/winegcc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 6decb02ee04..0a45cb7a0d5 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -638,7 +638,7 @@ static const char *get_multiarch_dir( enum target_cpu cpu ) static char *get_lib_dir( struct options *opts ) { const char *stdlibpath[] = { libdir, LIBDIR, "/usr/lib", "/usr/local/lib", "/lib" }; - static const char libwine[] = "/libwine.so"; + static const char ntdll[] = "/wine/ntdll.so"; const char *bit_suffix, *other_bit_suffix, *build_multiarch, *target_multiarch; const char *root = opts->sysroot ? opts->sysroot : ""; unsigned int i; @@ -658,31 +658,31 @@ static char *get_lib_dir( struct options *opts )
if (!stdlibpath[i]) continue; buffer = xmalloc( strlen(root) + strlen(stdlibpath[i]) + - strlen("/arm-linux-gnueabi") + strlen(libwine) + 1 ); + strlen("/arm-linux-gnueabi") + strlen(ntdll) + 1 ); strcpy( buffer, root ); strcat( buffer, stdlibpath[i] ); p = buffer + strlen(buffer); while (p > buffer && p[-1] == '/') p--; - strcpy( p, libwine ); + strcpy( p, ntdll ); if (check_platform( opts, buffer )) goto found; if (p > buffer + 2 && (!memcmp( p - 2, "32", 2 ) || !memcmp( p - 2, "64", 2 ))) { p -= 2; - strcpy( p, libwine ); + strcpy( p, ntdll ); if (check_platform( opts, buffer )) goto found; } strcpy( p, bit_suffix ); - strcat( p, libwine ); + strcat( p, ntdll ); if (check_platform( opts, buffer )) goto found; strcpy( p, target_multiarch ); - strcat( p, libwine ); + strcat( p, ntdll ); if (check_platform( opts, buffer )) goto found;
strcpy( buffer, root ); strcat( buffer, stdlibpath[i] ); p = buffer + strlen(buffer); while (p > buffer && p[-1] == '/') p--; - strcpy( p, libwine ); + strcpy( p, ntdll );
/* try to fixup each parent dirs named lib, lib32 or lib64 with target bitness suffix */ while (p > buffer) @@ -724,7 +724,7 @@ static char *get_lib_dir( struct options *opts ) continue;
found: - buffer[strlen(buffer) - strlen(libwine)] = 0; + buffer[strlen(buffer) - strlen(ntdll)] = 0; return buffer; } return strmake( "%s%s", root, LIBDIR );