Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit cd4f75f

Browse files
kbleeskasal
authored andcommitted
MSVC: link dynamically to the CRT
Dynamic linking is generally preferred over static linking, and MSVCRT.dll has been integral part of Windows for a long time. This also fixes linker warnings for _malloc and _free in zlib.lib, which seems to be compiled for MSVCRT.dll already. The DLL version also exports some of the CRT initialization functions, which are hidden in the static libcmt.lib (e.g. __wgetmainargs, required by subsequent Unicode patches). Signed-off-by: Karsten Blees <[email protected]> Signed-off-by: Stepan Kasal <[email protected]> Acked-by: Sebastian Schuberth <[email protected]> Acked-by: Marat Radchenko <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ea5f4e2 commit cd4f75f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

config.mak.uname

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,16 +358,16 @@ ifeq ($(uname_S),Windows)
358358
compat/win32/pthread.o compat/win32/syslog.o \
359359
compat/win32/dirent.o
360360
COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
361-
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib
361+
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE
362362
EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib invalidcontinue.obj
363363
PTHREAD_LIBS =
364364
lib =
365365
ifndef DEBUG
366-
BASIC_CFLAGS += -GL -Os -MT
366+
BASIC_CFLAGS += -GL -Os -MD
367367
BASIC_LDFLAGS += -LTCG
368368
AR += -LTCG
369369
else
370-
BASIC_CFLAGS += -Zi -MTd
370+
BASIC_CFLAGS += -Zi -MDd
371371
endif
372372
X = .exe
373373
endif

0 commit comments

Comments
 (0)