Commit a7074ea2 authored by Alexandre Julliard's avatar Alexandre Julliard

winegcc: Don't link directly to ntdll or ntoskrnl import libraries.

parent b65ef71f
...@@ -1408,13 +1408,15 @@ static void build(struct options* opts) ...@@ -1408,13 +1408,15 @@ static void build(struct options* opts)
strarray_add(&link_args, name); strarray_add(&link_args, name);
break; break;
case 'a': case 'a':
if (is_pe && !opts->use_msvcrt && !opts->lib_suffix && strchr(name, '/')) if (!opts->use_msvcrt && !opts->lib_suffix && strchr(name, '/'))
{ {
/* turn the path back into -Ldir -lfoo options /* turn the path back into -Ldir -lfoo options
* this makes sure that we use the specified libs even * this makes sure that we use the specified libs even
* when mingw adds its own import libs to the link */ * when mingw adds its own import libs to the link */
const char *p = get_basename( name ); const char *p = get_basename( name );
if (is_pe)
{
if (!strncmp( p, "lib", 3 ) && strcmp( p, "libmsvcrt.a" )) if (!strncmp( p, "lib", 3 ) && strcmp( p, "libmsvcrt.a" ))
{ {
strarray_add(&link_args, strmake("-L%s", get_dirname(name) )); strarray_add(&link_args, strmake("-L%s", get_dirname(name) ));
...@@ -1422,6 +1424,14 @@ static void build(struct options* opts) ...@@ -1422,6 +1424,14 @@ static void build(struct options* opts)
break; break;
} }
} }
else
{
/* don't link to ntdll or ntoskrnl in non-msvcrt mode
* since they export CRT functions */
if (!strcmp( p, "libntdll.a" )) break;
if (!strcmp( p, "libntoskrnl.a" )) break;
}
}
strarray_add(&link_args, name); strarray_add(&link_args, name);
break; break;
case 'W': case 'W':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment