[PATCH 3/6] gendef generates sigfe.s and cygwin.def

Jon Turney jon.turney@dronecode.org.uk
Wed Oct 21 14:31:37 GMT 2020


On 20/10/2020 14:43, Jon Turney wrote:
> Express that gendef generates sigfe.s and cygwin.def in a slightly less
> nutty way.
> ---
>   winsup/cygwin/Makefile.in | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
> index a56a311b8..9d05b17b3 100644
> --- a/winsup/cygwin/Makefile.in
> +++ b/winsup/cygwin/Makefile.in
> @@ -785,16 +785,13 @@ $(VERSION_OFILES): version.cc
>   Makefile: ${srcdir}/Makefile.in
>   	/bin/sh ./config.status
>   
> -$(DEF_FILE): gendef $(srcdir)/$(TLSOFFSETS_H) $(DIN_FILE)
> +$(DEF_FILE) sigfe.s: gendef $(srcdir)/$(TLSOFFSETS_H) $(DIN_FILE)
>   	$(word 1,$^) --cpu=${target_cpu} --output-def=$@  --tlsoffsets=$(word 2,$^) $(wordlist 3,99,$^)

Using $@ is wrong if make decides to build sigfe.s first, and $^ will 
contain an unwanted $(DEF_FILE) from the dependency below.

So please try the attached instead.

But maybe I need to do a bit more staring at [1].

[1] 
https://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html

>   
>   $(srcdir)/$(TLSOFFSETS_H): gentls_offsets cygtls.h
>   	$^ $@ $(target_cpu) $(COMPILE.cc) -c || rm $@
>   
>   sigfe.s: $(DEF_FILE)
> -	@[ -s $@ ] || \
> -	{ rm -f $(DEF_FILE); $(MAKE) -s -j1 $(DEF_FILE); }; \
> -	[ -s $@ ] && touch $@
>   
>   sigfe.o: sigfe.s $(srcdir)/$(TLSOFFSETS_H)
>   	$(CC) ${CFLAGS} -c -o $@ $<
> 
-------------- next part --------------
From 15f8cc0f7cd273f1d10a7483399403487b2c2eb2 Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Mon, 12 Oct 2020 16:59:02 +0100
Subject: [PATCH 3/6] gendef generates sigfe.s and cygwin.def

Express that gendef generates sigfe.s and cygwin.def in a slightly less
nutty way.
---
 winsup/cygwin/Makefile.in | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index a56a311b8..70e38ead6 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -785,16 +785,13 @@ $(VERSION_OFILES): version.cc
 Makefile: ${srcdir}/Makefile.in
 	/bin/sh ./config.status
 
-$(DEF_FILE): gendef $(srcdir)/$(TLSOFFSETS_H) $(DIN_FILE)
-	$(word 1,$^) --cpu=${target_cpu} --output-def=$@  --tlsoffsets=$(word 2,$^) $(wordlist 3,99,$^)
+$(DEF_FILE) sigfe.s: gendef $(srcdir)/$(TLSOFFSETS_H) $(DIN_FILE)
+	$(word 1,$^) --cpu=${target_cpu} --output-def=$(DEF_FILE) --tlsoffsets=$(word 2,$^) $(wordlist 3,4,$^)
 
 $(srcdir)/$(TLSOFFSETS_H): gentls_offsets cygtls.h
 	$^ $@ $(target_cpu) $(COMPILE.cc) -c || rm $@
 
 sigfe.s: $(DEF_FILE)
-	@[ -s $@ ] || \
-	{ rm -f $(DEF_FILE); $(MAKE) -s -j1 $(DEF_FILE); }; \
-	[ -s $@ ] && touch $@
 
 sigfe.o: sigfe.s $(srcdir)/$(TLSOFFSETS_H)
 	$(CC) ${CFLAGS} -c -o $@ $<
-- 
2.28.0



More information about the Cygwin-patches mailing list