comparison src/Make_cyg_ming.mak @ 35802:91c0999849ee v9.1.0621

patch 9.1.0621: MS-Windows: startup code can be improved Commit: https://github.com/vim/vim/commit/b32d0a479d18512be551a3bca6366796c47d2633 Author: Ken Takata <kentkt@csc.jp> Date: Fri Jul 26 18:46:54 2024 +0200 patch 9.1.0621: MS-Windows: startup code can be improved Problem: MS-Windows: startup code can be improved Solution: Re-work and optimize win32 startup code (Ken Takata) * Revise the code and reduce #ifdefs. * For VIMDLL, stop using the default CRT startup code to reduce the file size. The file size becomes ~130 KB -> ~34 KB on MSVC. * Update comments. Make them consistent between os_w32dll.c and os_w32exe.c. closes: #15352 Signed-off-by: Ken Takata <kentkt@csc.jp> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Fri, 26 Jul 2024 19:00:02 +0200
parents 500731fe8161
children fd80fd70ee59
comparison
equal deleted inserted replaced
35801:b712ad7f9e45 35802:91c0999849ee
993 else 993 else
994 VIMDLLBASE := vim32$(DEBUG_SUFFIX) 994 VIMDLLBASE := vim32$(DEBUG_SUFFIX)
995 endif 995 endif
996 TARGET = $(VIMDLLBASE).dll 996 TARGET = $(VIMDLLBASE).dll
997 LFLAGS += -shared 997 LFLAGS += -shared
998 EXELFLAGS += -municode 998 EXELFLAGS += -municode -nostdlib
999 ifneq ($(DEBUG),yes) 999 ifneq ($(DEBUG),yes)
1000 EXELFLAGS += -s 1000 EXELFLAGS += -s
1001 endif 1001 endif
1002 ifeq ($(COVERAGE),yes) 1002 ifeq ($(COVERAGE),yes)
1003 EXELFLAGS += --coverage 1003 EXELFLAGS += --coverage
1120 $(EXEOBJG): | $(OUTDIR) 1120 $(EXEOBJG): | $(OUTDIR)
1121 1121
1122 $(EXEOBJC): | $(OUTDIR) 1122 $(EXEOBJC): | $(OUTDIR)
1123 1123
1124 ifeq ($(VIMDLL),yes) 1124 ifeq ($(VIMDLL),yes)
1125 ifeq ($(ARCH),x86-64)
1126 EXEENTRYC = -Wl,--entry=wmainCRTStartup
1127 EXEENTRYG = -Wl,--entry=wWinMainCRTStartup
1128 else ifeq ($(ARCH),i686)
1129 EXEENTRYC = -Wl,--entry=_wmainCRTStartup
1130 EXEENTRYG = -Wl,--entry=_wWinMainCRTStartup@0
1131 endif
1132
1125 $(TARGET): $(OBJ) 1133 $(TARGET): $(OBJ)
1126 $(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid -lgdi32 $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) $(SODIUMLIB) 1134 $(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid -lgdi32 $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) $(SODIUMLIB)
1127 1135
1128 $(GVIMEXE): $(EXEOBJG) $(VIMDLLBASE).dll 1136 $(GVIMEXE): $(EXEOBJG) $(VIMDLLBASE).dll
1129 $(CC) -L. $(EXELFLAGS) -mwindows -o $@ $(EXEOBJG) -l$(VIMDLLBASE) 1137 $(CC) -L. $(EXELFLAGS) -mwindows -o $@ $(EXEOBJG) -l$(VIMDLLBASE) $(EXEENTRYG)
1130 1138
1131 $(VIMEXE): $(EXEOBJC) $(VIMDLLBASE).dll 1139 $(VIMEXE): $(EXEOBJC) $(VIMDLLBASE).dll
1132 $(CC) -L. $(EXELFLAGS) -o $@ $(EXEOBJC) -l$(VIMDLLBASE) 1140 $(CC) -L. $(EXELFLAGS) -o $@ $(EXEOBJC) -l$(VIMDLLBASE) $(EXEENTRYC)
1133 else 1141 else
1134 $(TARGET): $(OBJ) 1142 $(TARGET): $(OBJ)
1135 $(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) $(SODIUMLIB) 1143 $(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) $(SODIUMLIB)
1136 endif 1144 endif
1137 1145
1328 1336
1329 $(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC) 1337 $(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
1330 $(CC) -c $(CFLAGS) netbeans.c -o $@ 1338 $(CC) -c $(CFLAGS) netbeans.c -o $@
1331 1339
1332 $(OUTDIR)/os_w32exec.o: os_w32exe.c $(INCL) 1340 $(OUTDIR)/os_w32exec.o: os_w32exe.c $(INCL)
1333 $(CC) -c $(CFLAGS) -UFEAT_GUI_MSWIN os_w32exe.c -o $@ 1341 $(CC) -c $(CFLAGS) -UFEAT_GUI_MSWIN -DUSE_OWNSTARTUP os_w32exe.c -o $@
1334 1342
1335 $(OUTDIR)/os_w32exeg.o: os_w32exe.c $(INCL) 1343 $(OUTDIR)/os_w32exeg.o: os_w32exe.c $(INCL)
1336 $(CC) -c $(CFLAGS) os_w32exe.c -o $@ 1344 $(CC) -c $(CFLAGS) -DUSE_OWNSTARTUP os_w32exe.c -o $@
1337 1345
1338 $(OUTDIR)/os_win32.o: os_win32.c $(INCL) $(MZSCHEME_INCL) 1346 $(OUTDIR)/os_win32.o: os_win32.c $(INCL) $(MZSCHEME_INCL)
1339 $(CC) -c $(CFLAGS) os_win32.c -o $@ 1347 $(CC) -c $(CFLAGS) os_win32.c -o $@
1340 1348
1341 $(OUTDIR)/regexp.o: regexp.c regexp_bt.c regexp_nfa.c $(INCL) 1349 $(OUTDIR)/regexp.o: regexp.c regexp_bt.c regexp_nfa.c $(INCL)