* [PATCH 0/3] Further build cleanups
@ 2020-11-20 14:08 Jon Turney
2020-11-20 14:08 ` [PATCH 1/3] Drop libgmon.a build dependency on gcrt0.o Jon Turney
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Jon Turney @ 2020-11-20 14:08 UTC (permalink / raw)
To: cygwin-patches; +Cc: 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] Drop libgmon.a build dependency on gcrt0.o
2020-11-20 14:08 [PATCH 0/3] Further build cleanups Jon Turney
@ 2020-11-20 14:08 ` Jon Turney
2020-11-20 14:09 ` [PATCH 2/3] Use standard CXXFLAGS when compiling localtime_wrapper.c Jon Turney
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Jon Turney @ 2020-11-20 14:08 UTC (permalink / raw)
To: cygwin-patches; +Cc: 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/3] Use standard CXXFLAGS when compiling localtime_wrapper.c
2020-11-20 14:08 [PATCH 0/3] Further build cleanups Jon Turney
2020-11-20 14:08 ` [PATCH 1/3] Drop libgmon.a build dependency on gcrt0.o Jon Turney
@ 2020-11-20 14:09 ` Jon Turney
2020-11-20 14:09 ` [PATCH 3/3] Have cygmagic not create output if an error occurs Jon Turney
2020-11-23 8:46 ` [PATCH 0/3] Further build cleanups Corinna Vinschen
3 siblings, 0 replies; 5+ messages in thread
From: Jon Turney @ 2020-11-20 14:09 UTC (permalink / raw)
To: cygwin-patches; +Cc: 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/3] Have cygmagic not create output if an error occurs
2020-11-20 14:08 [PATCH 0/3] Further build cleanups Jon Turney
2020-11-20 14:08 ` [PATCH 1/3] Drop libgmon.a build dependency on gcrt0.o Jon Turney
2020-11-20 14:09 ` [PATCH 2/3] Use standard CXXFLAGS when compiling localtime_wrapper.c Jon Turney
@ 2020-11-20 14:09 ` Jon Turney
2020-11-23 8:46 ` [PATCH 0/3] Further build cleanups Corinna Vinschen
3 siblings, 0 replies; 5+ messages in thread
From: Jon Turney @ 2020-11-20 14:09 UTC (permalink / raw)
To: cygwin-patches; +Cc: 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] Further build cleanups
2020-11-20 14:08 [PATCH 0/3] Further build cleanups Jon Turney
` (2 preceding siblings ...)
2020-11-20 14:09 ` [PATCH 3/3] Have cygmagic not create output if an error occurs Jon Turney
@ 2020-11-23 8:46 ` Corinna Vinschen
3 siblings, 0 replies; 5+ messages in thread
From: Corinna Vinschen @ 2020-11-23 8:46 UTC (permalink / raw)
To: cygwin-patches
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-11-23 8:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-20 14:08 [PATCH 0/3] Further build cleanups Jon Turney
2020-11-20 14:08 ` [PATCH 1/3] Drop libgmon.a build dependency on gcrt0.o Jon Turney
2020-11-20 14:09 ` [PATCH 2/3] Use standard CXXFLAGS when compiling localtime_wrapper.c Jon Turney
2020-11-20 14:09 ` [PATCH 3/3] Have cygmagic not create output if an error occurs Jon Turney
2020-11-23 8:46 ` [PATCH 0/3] Further build cleanups 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).