Jacek Caban : makedep: Link importlib object files into module only when it's explicitly imported.
Alexandre Julliard
julliard at winehq.org
Thu Jan 23 15:48:50 CST 2020
Module: wine
Branch: master
Commit: 3ad95e03b810906dce87231fd12aa9a1d8f4aad7
URL: https://source.winehq.org/git/wine.git/?a=commit;h=3ad95e03b810906dce87231fd12aa9a1d8f4aad7
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Jan 21 19:51:30 2020 +0100
makedep: Link importlib object files into module only when it's explicitly imported.
To prevent msvcrt linking its own importlib into DLL.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/dinput/Makefile.in | 2 +-
dlls/dinput8/Makefile.in | 2 +-
tools/makedep.c | 5 ++++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/dinput/Makefile.in b/dlls/dinput/Makefile.in
index 3b046d61d4..ae65fd4d93 100644
--- a/dlls/dinput/Makefile.in
+++ b/dlls/dinput/Makefile.in
@@ -1,6 +1,6 @@
MODULE = dinput.dll
IMPORTLIB = dinput
-IMPORTS = dxguid uuid comctl32 ole32 user32 advapi32
+IMPORTS = dinput dxguid uuid comctl32 ole32 user32 advapi32
EXTRADEFS = -DDIRECTINPUT_VERSION=0x0700
EXTRALIBS = $(IOKIT_LIBS) $(FORCEFEEDBACK_LIBS)
diff --git a/dlls/dinput8/Makefile.in b/dlls/dinput8/Makefile.in
index 0ede9f0fb1..5f0dce97ca 100644
--- a/dlls/dinput8/Makefile.in
+++ b/dlls/dinput8/Makefile.in
@@ -1,6 +1,6 @@
MODULE = dinput8.dll
IMPORTLIB = dinput8
-IMPORTS = dxguid uuid comctl32 ole32 user32 advapi32
+IMPORTS = dinput8 dxguid uuid comctl32 ole32 user32 advapi32
EXTRADEFS = -DDIRECTINPUT_VERSION=0x0800
EXTRALIBS = $(IOKIT_LIBS) $(FORCEFEEDBACK_LIBS)
PARENTSRC = ../dinput
diff --git a/tools/makedep.c b/tools/makedep.c
index 6d1500534d..4cc0e784c7 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -2193,6 +2193,9 @@ static struct strarray add_import_libs( const struct makefile *make, struct stra
const char *name = get_base_name( imports.str[i] );
const char *lib = NULL;
+ /* skip module's own importlib, its object files will be linked directly */
+ if (make->importlib && !strcmp( make->importlib, imports.str[i] )) continue;
+
for (j = 0; j < top_makefile->subdirs.count; j++)
{
const struct makefile *submake = top_makefile->submakes[j];
@@ -3070,7 +3073,7 @@ static void output_source_default( struct makefile *make, struct incl_file *sour
{
if ((source->file->flags & FLAG_C_UNIX) && *dll_ext)
strarray_add( &make->unixobj_files, strmake( "%s.o", obj ));
- else if (!is_dll_src)
+ else if (!is_dll_src && (!(source->file->flags & FLAG_C_IMPLIB) || (make->importlib && strarray_exists( &make->imports, make->importlib ))))
strarray_add( &make->object_files, strmake( "%s.o", obj ));
else
strarray_add( &make->clean_files, strmake( "%s.o", obj ));
More information about the wine-cvs
mailing list