From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 94E4C385AC33; Wed, 2 Feb 2022 20:44:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94E4C385AC33 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: Makefile.am: fix DLL build rule X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 8622002ffc71ff5777a7221232ba02c7a7e7d004 X-Git-Newrev: ba02fef995ac3fef5c67260015c2ef754943643a Message-Id: <20220202204444.94E4C385AC33@sourceware.org> Date: Wed, 2 Feb 2022 20:44:44 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Feb 2022 20:44:44 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dba02fef995a= c3fef5c67260015c2ef754943643a commit ba02fef995ac3fef5c67260015c2ef754943643a Author: Corinna Vinschen Date: Wed Feb 2 21:16:35 2022 +0100 Cygwin: Makefile.am: fix DLL build rule =20 A single Makefile rule creates three files in three steps, the second and third one never showing up in dependencies. The next step creating the link lib only depends on the first of these files. Even if the second or third step in the DLL build rule fails, the next make invocation never picks up on this and just goes ahead creating the link lib. =20 Fix this by splitting the DLL build rule into three rules, with every step on the way depending on the previous rule. Also fix up the names, TEST_DLL_NAME just doesn't cut it. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/Makefile.am | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/winsup/cygwin/Makefile.am b/winsup/cygwin/Makefile.am index 8d55e1693..28c143434 100644 --- a/winsup/cygwin/Makefile.am +++ b/winsup/cygwin/Makefile.am @@ -40,7 +40,9 @@ toolincludedir=3D$(tooldir)/include # Parameters used in building the cygwin.dll. =20 DLL_NAME=3Dcygwin1.dll -TEST_DLL_NAME=3Dcygwin0.dll +PRE_DLL_NAME=3Dcygwin0.dll +DBG_DLL_NAME=3Dcygwin1.dbg +NEW_DLL_NAME=3Dnew-cygwin1.dll DIN_FILE=3D@DIN_FILE@ DEF_FILE=3Dcygwin.def TLSOFFSETS_H=3D@TLSOFFSETS_H@ @@ -623,7 +625,7 @@ $(LDSCRIPT): $(LDSCRIPT).in $(AM_V_GEN)$(CC) -E - -P < $^ -o $@ =20 # cygwin dll -$(TEST_DLL_NAME): $(LDSCRIPT) dllfixdbg libdll.a $(VERSION_OFILES) $(LIBSE= RVER)\ +$(PRE_DLL_NAME): $(LDSCRIPT) dllfixdbg libdll.a $(VERSION_OFILES) $(LIBSER= VER)\ $(newlib_build)/libm/libm.a $(newlib_build)/libc/libc.a $(AM_V_CXXLD)$(CXX) $(CXXFLAGS) \ -mno-use-libstdc-wrappers \ @@ -636,8 +638,12 @@ $(TEST_DLL_NAME): $(LDSCRIPT) dllfixdbg libdll.a $(VER= SION_OFILES) $(LIBSERVER)\ $(newlib_build)/libm/libm.a \ $(newlib_build)/libc/libc.a \ -lgcc -lkernel32 -lntdll -Wl,-Map,cygwin.map - @$(srcdir)/dllfixdbg $(OBJDUMP) $(OBJCOPY) $@ cygwin1.dbg - @ln -f $@ new-cygwin1.dll + +$(DBG_DLL_NAME): $(PRE_DLL_NAME) + $(AM_V_GEN)$(srcdir)/dllfixdbg $(OBJDUMP) $(OBJCOPY) $(PRE_DLL_NAME) $(DB= G_DLL_NAME) + +$(NEW_DLL_NAME): $(PRE_DLL_NAME) $(DBG_DLL_NAME) + $(AM_V_GEN)ln -f $(PRE_DLL_NAME) $@ =20 # cygwin import library toolopts=3D--cpu=3D@target_cpu@ --ar=3D@AR@ --as=3D@AS@ --nm=3D@NM@ --objc= opy=3D@OBJCOPY@ @@ -651,7 +657,7 @@ sigfe.s: $(DEF_FILE) [ -s $@ ] && touch $@ =20 LIBCOS=3D$(addsuffix .o,$(basename $(LIB_FILES))) -$(LIB_NAME): $(DEF_FILE) $(LIBCOS) | $(TEST_DLL_NAME) +$(LIB_NAME): $(DEF_FILE) $(LIBCOS) | $(NEW_DLL_NAME) $(AM_V_GEN)$(srcdir)/mkimport $(toolopts) $(NEW_FUNCTIONS) $@ cygdll.a $(= wordlist 2,99,$^) =20 # cygwin import library used by testsuite @@ -709,7 +715,8 @@ all-local: $(LIB_NAME) $(TEST_LIB_NAME) $(SUBLIBS) clean-local: -rm -f $(BUILT_SOURCES) -rm -f $(DEF_FILE) sigfe.s - -rm -f cygwin.sc cygdll.a cygwin.map $(TEST_DLL_NAME) cygwin1.dbg new-cyg= win1.dll + -rm -f cygwin.sc cygdll.a cygwin.map + -rm -f $(PRE_DLL_NAME) $(DBG_DLL_NAME) $(NEW_DLL_NAME) -rm -f $(LIB_NAME) $(TEST_LIB_NAME) $(SUBLIBS) -rm -f version.cc =20 @@ -727,7 +734,7 @@ install-data-local: install-headers install-ldif =20 install-libs: @$(MKDIR_P) $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) $(TEST_DLL_NAME) $(DESTDIR)$(bindir)/$(DLL_NAME) + $(INSTALL_PROGRAM) $(NEW_DLL_NAME) $(DESTDIR)$(bindir)/$(DLL_NAME) @$(MKDIR_P) $(DESTDIR)$(toollibdir) (cd $(DESTDIR)$(toollibdir) && ln -sf $(LIB_NAME) libg.a)