public inbox for
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: fix DLL build rule
@ 2022-02-02 20:44 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2022-02-02 20:44 UTC (permalink / raw)
  To: cygwin-cvs;h=ba02fef995ac3fef5c67260015c2ef754943643a

commit ba02fef995ac3fef5c67260015c2ef754943643a
Author: Corinna Vinschen <>
Date:   Wed Feb 2 21:16:35 2022 +0100

    Cygwin: fix DLL build rule
    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.
    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.
    Signed-off-by: Corinna Vinschen <>

 winsup/cygwin/ | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/winsup/cygwin/ b/winsup/cygwin/
index 8d55e1693..28c143434 100644
--- a/winsup/cygwin/
+++ b/winsup/cygwin/
@@ -40,7 +40,9 @@ toolincludedir=$(tooldir)/include
 # Parameters used in building the cygwin.dll.
@@ -623,7 +625,7 @@ $(LDSCRIPT): $(LDSCRIPT).in
 	$(AM_V_GEN)$(CC) -E - -P < $^ -o $@
 # cygwin dll
+$(PRE_DLL_NAME): $(LDSCRIPT) dllfixdbg libdll.a $(VERSION_OFILES) $(LIBSERVER)\
 		  $(newlib_build)/libm/libm.a $(newlib_build)/libc/libc.a
 	-mno-use-libstdc-wrappers \
@@ -636,8 +638,12 @@ $(TEST_DLL_NAME): $(LDSCRIPT) dllfixdbg libdll.a $(VERSION_OFILES) $(LIBSERVER)\
 	$(newlib_build)/libm/libm.a \
 	$(newlib_build)/libc/libc.a \
 	-lgcc -lkernel32 -lntdll -Wl,-Map,
-	@$(srcdir)/dllfixdbg $(OBJDUMP) $(OBJCOPY) $@ cygwin1.dbg
-	@ln -f $@ new-cygwin1.dll
+	$(AM_V_GEN)$(srcdir)/dllfixdbg $(OBJDUMP) $(OBJCOPY) $(PRE_DLL_NAME) $(DBG_DLL_NAME)
+	$(AM_V_GEN)ln -f $(PRE_DLL_NAME) $@
 # cygwin import library
 toolopts=--cpu=@target_cpu@ --ar=@AR@ --as=@AS@ --nm=@NM@ --objcopy=@OBJCOPY@
@@ -651,7 +657,7 @@ sigfe.s: $(DEF_FILE)
 	[ -s $@ ] && touch $@
 LIBCOS=$(addsuffix .o,$(basename $(LIB_FILES)))
 	$(AM_V_GEN)$(srcdir)/mkimport $(toolopts) $(NEW_FUNCTIONS) $@ cygdll.a $(wordlist 2,99,$^)
 # cygwin import library used by testsuite
@@ -709,7 +715,8 @@ all-local: $(LIB_NAME) $(TEST_LIB_NAME) $(SUBLIBS)
 	-rm -f $(BUILT_SOURCES)
 	-rm -f $(DEF_FILE) sigfe.s
-	-rm -f cygdll.a $(TEST_DLL_NAME) cygwin1.dbg new-cygwin1.dll
+	-rm -f cygdll.a
 	-rm -f
@@ -727,7 +734,7 @@ install-data-local: install-headers install-ldif
 	@$(MKDIR_P) $(DESTDIR)$(bindir)
 	@$(MKDIR_P) $(DESTDIR)$(toollibdir)
 	(cd $(DESTDIR)$(toollibdir) && ln -sf $(LIB_NAME) libg.a)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-02 20:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 20:44 [newlib-cygwin] Cygwin: fix DLL build rule Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).