Index: win32/Makefile.sub =================================================================== --- win32/Makefile.sub (revision 22794) +++ win32/Makefile.sub (working copy) @@ -164,7 +164,7 @@ CXXFLAGS = $(CFLAGS) !endif !if !defined(LDFLAGS) -LDFLAGS = -link -incremental:no -debug -opt:ref -opt:icf +LDFLAGS = -incremental:no -debug -opt:ref -opt:icf !endif !if !defined(XLDFLAGS) XLDFLAGS = -stack:$(STACK) @@ -542,7 +542,7 @@ s,@CPPFLAGS@,$(CPPFLAGS),;t t s,@CXXFLAGS@,$(CXXFLAGS),;t t s,@FFLAGS@,$(FFLAGS),;t t -s,@LDFLAGS@,,;t t +s,@LDFLAGS@,$(LDFLAGS),;t t s,@LIBS@,$(LIBS),;t t s,@exec_prefix@,$${prefix},;t t s,@prefix@,$(prefix),;t t @@ -633,7 +633,7 @@ s,@LIBPATHFLAG@, -libpath:"%s",;t t s,@RPATHFLAG@,,;t t s,@LIBARG@,%s.lib,;t t -s,@LINK_SO@,$$(LDSHARED) -Fe$$(@) $$(OBJS) $$(LIBS) $$(LOCAL_LIBS) $$(DLDFLAGS) -implib:$$(*F:.so=)-$$(arch).lib -pdb:$$(*F:.so=)-$$(arch).pdb -def:$$(DEFFILE),;t t +s,@LINK_SO@,$$(LDSHARED) -Fe$$(@) $$(OBJS) $$(LIBS) $$(LOCAL_LIBS) -link $$(DLDFLAGS) -implib:$$(*F:.so=)-$$(arch).lib -pdb:$$(*F:.so=)-$$(arch).pdb -def:$$(DEFFILE),;t t !if $(MSC_VER) >= 1400 s,@LINK_SO@,@$$(RUBY) -run -e wait_writable -- -n 10 $$(@),;t t s,@LINK_SO@,$(MANIFESTTOOL) -manifest $$(@).manifest -outputresource:$$(@);2,;t t @@ -669,7 +669,7 @@ miniruby$(EXEEXT): @echo. $(LIBS) - $(PURIFY) $(CC) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(LIBS) -Fe$@ $(LDFLAGS) + $(PURIFY) $(CC) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(LIBS) -Fe$@ -link $(LDFLAGS) @$(RM) miniruby.lib miniruby.exp miniruby.exe -v $(LDSHARED_1) @@ -681,7 +681,7 @@ !if "$(PROGRAM)" != "" $(PROGRAM): $(MAINOBJ) $(LIBRUBY_SO) $(RUBY_INSTALL_NAME).res $(PURIFY) $(CC) $(MAINOBJ) $(RUBY_INSTALL_NAME).res \ - $(OUTFLAG)$@ $(LIBRUBYARG) $(LDFLAGS) $(XLDFLAGS) + $(OUTFLAG)$@ $(LIBRUBYARG) -link $(LDFLAGS) $(XLDFLAGS) $(LDSHARED_0) $(LDSHARED_1) $(LDSHARED_2) @@ -691,7 +691,7 @@ $(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $(RUBYW_INSTALL_NAME).res $(PURIFY) $(CC) $(MAINOBJ) $(WINMAINOBJ) \ $(RUBYW_INSTALL_NAME).res $(OUTFLAG)$@ $(LIBRUBYARG) \ - $(LDFLAGS) $(XLDFLAGS) -subsystem:Windows + -link $(LDFLAGS) $(XLDFLAGS) -subsystem:Windows $(LDSHARED_0) $(LDSHARED_1) $(LDSHARED_2) @@ -707,7 +707,7 @@ @echo. $(DLDOBJS) @-$(PRE_LIBRUBY_UPDATE) $(LDSHARED) $(MAINOBJ) $(DLDOBJS) $(LIBRUBY_A) \ - $(RUBY_SO_NAME).res $(LIBS) -Fe$@ $(LDFLAGS) \ + $(RUBY_SO_NAME).res $(LIBS) -Fe$@ -link $(LDFLAGS) \ $(LIBRUBY_DLDFLAGS) @$(RM) dummy.lib dummy.exp $(LDSHARED_0)