[PATCH 0/3] Further build cleanups

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 0/3] Further build cleanups

Jon TURNEY
Jon Turney (3):
  Drop libgmon.a build dependency on gcrt0.o
  Use standard CXXFLAGS when compiling localtime_wrapper.c
  Have cygmagic not create output if an error occurs

 winsup/cygwin/Makefile.in |  4 ++--
 winsup/cygwin/cygmagic    | 17 ++++++++++++++---
 2 files changed, 16 insertions(+), 5 deletions(-)

--
2.29.2

Reply | Threaded
Open this post in threaded view
|

[PATCH 1/3] Drop libgmon.a build dependency on gcrt0.o

Jon TURNEY
libgmon.a depends on gcrt0.o, but doesn't include it.
---
 winsup/cygwin/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index ec5d1efed..874aaa05d 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -679,7 +679,7 @@ ${cygserver_blddir}/Makefile:
 
 dll_ofiles: $(DLL_OFILES)
 
-$(LIBGMON_A): $(GMON_OFILES) $(GMON_START)
+$(LIBGMON_A): $(GMON_OFILES)
  $(AR) rcv $(LIBGMON_A) $(GMON_OFILES)
 
 globals.h: mkglobals_h globals.cc
--
2.29.2

Reply | Threaded
Open this post in threaded view
|

[PATCH 2/3] Use standard CXXFLAGS when compiling localtime_wrapper.c

Jon TURNEY
In reply to this post by Jon TURNEY
This has an separate, explicit compilation rule which omits CXXFLAGS, so
expected flags like '-g -O2' aren't being used.
---
 winsup/cygwin/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index 874aaa05d..ce3100531 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -703,7 +703,7 @@ localtime.patched.c: tzcode/localtime.c tzcode/localtime.c.patch
     $(srcdir)/tzcode/localtime.c.patch
 
 localtime.o: tzcode/localtime_wrapper.c localtime.patched.c
- $(CC) ${COMMON_CFLAGS} ${localtime_CFLAGS} \
+ $(CC) $(CXXFLAGS) ${COMMON_CFLAGS} ${localtime_CFLAGS} \
  -I$(target_builddir)/winsup/cygwin \
  -I$(srcdir) -I$(srcdir)/tzcode -c -o $@ $<
 
--
2.29.2

Reply | Threaded
Open this post in threaded view
|

[PATCH 3/3] Have cygmagic not create output if an error occurs

Jon TURNEY
In reply to this post by Jon TURNEY
Improve cygmagic so it doesn't create the output file if an error
occurs, even in one of the backtick-enclosed pipelines it runs.
---
 winsup/cygwin/cygmagic | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/cygmagic b/winsup/cygwin/cygmagic
index c80ca9f96..eee4a3b73 100755
--- a/winsup/cygwin/cygmagic
+++ b/winsup/cygwin/cygmagic
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # cygmagic - Generate "magic numbers" from a structure.
 #
 # This file is part of Cygwin.
@@ -7,14 +7,22 @@
 # Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 # details.
 
+set -e
+shopt -s -o pipefail
+shopt -s inherit_errexit
+
 file_magic=$1; shift
 gcc=$1; shift
 file=$1; shift
+
+tmpfile=/tmp/$$.magic
 trap "rm -f /tmp/$$.magic" 0 1 2 15
-cat <<EOF > $file_magic
+
+cat <<EOF > $tmpfile
 /* autogenerated - do not edit */
 #include "$file"
 EOF
+
 sumit() {
     cksum $*
 }
@@ -28,5 +36,8 @@ while [ -n "$1" ]; do
     [ "$curr" != "$sum" ] && echo "*** WARNING WARNING WARNING WARNING WARNING ***
 *** $file: magic number for $define changed old $curr != new $sum
 *** WARNING WARNING WARNING WARNING WARNING ***" 1>&2
-done >> $file_magic
+done >> $tmpfile
+
+mv $tmpfile $file_magic
+
 exit 0
--
2.29.2

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 0/3] Further build cleanups

Corinna Vinschen-2
In reply to this post by Jon TURNEY
On Nov 20 14:08, Jon Turney wrote:

> Jon Turney (3):
>   Drop libgmon.a build dependency on gcrt0.o
>   Use standard CXXFLAGS when compiling localtime_wrapper.c
>   Have cygmagic not create output if an error occurs
>
>  winsup/cygwin/Makefile.in |  4 ++--
>  winsup/cygwin/cygmagic    | 17 ++++++++++++++---
>  2 files changed, 16 insertions(+), 5 deletions(-)
>
> --
> 2.29.2

GTG


Thanks,
Corinna