* [PATCH] sim: common: simplify version script
@ 2021-01-17 11:19 Mike Frysinger via Gdb-patches
2021-01-18 9:57 ` Andrew Burgess
0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger via Gdb-patches @ 2021-01-17 11:19 UTC (permalink / raw)
To: gdb-patches
We don't the host & target aliases, so don't bother emitting them.
---
sim/common/Make-common.in | 4 ++--
sim/common/create-version.sh | 17 ++++++-----------
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 6e7193044305..7de7dabe646f 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -291,8 +291,8 @@ stamp-tvals: gentmap
touch stamp-tvals
version.c: Makefile $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcroot)/sim/common/create-version.sh
- $(SHELL) $(srcroot)/sim/common/create-version.sh $(srcroot)/gdb \
- $(host_alias) $(target_alias) version.c
+ $(SHELL) $(srcroot)/sim/common/create-version.sh $(srcroot)/gdb $@.tmp
+ $(SHELL) $(srcroot)/move-if-change $@.tmp $@
#
# Rules for building sim-* components. Triggered by listing the corresponding
diff --git a/sim/common/create-version.sh b/sim/common/create-version.sh
index 5252c3b8bd80..7b35e87e2150 100755
--- a/sim/common/create-version.sh
+++ b/sim/common/create-version.sh
@@ -23,16 +23,11 @@
# TARGET_ALIAS OUTPUT-FILE-NAME
srcdir="$1"
-host_alias="$2"
-target_alias="$3"
-output="$4"
+output="$2"
-rm -f version.c-tmp $output version.tmp
date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$/\1/p' $srcdir/../bfd/version.h`
-sed -e "s/DATE/$date/" < $srcdir/version.in > version.tmp
-echo '#include "version.h"' >> version.c-tmp
-echo 'const char version[] = "'"`sed q version.tmp`"'";' >> version.c-tmp
-echo 'const char host_name[] = "'"$host_alias"'";' >> version.c-tmp
-echo 'const char target_name[] = "'"$target_alias"'";' >> version.c-tmp
-mv version.c-tmp $output
-rm -f version.tmp
+ver=`sed -e "s/DATE/$date/;q" $srcdir/version.in`
+(
+echo '#include "version.h"'
+echo 'const char version[] = "'"${ver}"'";'
+) >"${output}"
--
2.28.0
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] sim: common: simplify version script
2021-01-17 11:19 [PATCH] sim: common: simplify version script Mike Frysinger via Gdb-patches
@ 2021-01-18 9:57 ` Andrew Burgess
2021-01-18 17:27 ` [PATCH/committed v2] " Mike Frysinger via Gdb-patches
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Burgess @ 2021-01-18 9:57 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches
* Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org> [2021-01-17 06:19:58 -0500]:
> We don't the host & target aliases, so don't bother emitting them.
Missing words here. I guess "We don't use the ..."
Also, those pesky ChangeLog things...
Thanks,
Andrew
> ---
> sim/common/Make-common.in | 4 ++--
> sim/common/create-version.sh | 17 ++++++-----------
> 2 files changed, 8 insertions(+), 13 deletions(-)
>
> diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
> index 6e7193044305..7de7dabe646f 100644
> --- a/sim/common/Make-common.in
> +++ b/sim/common/Make-common.in
> @@ -291,8 +291,8 @@ stamp-tvals: gentmap
> touch stamp-tvals
>
> version.c: Makefile $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcroot)/sim/common/create-version.sh
> - $(SHELL) $(srcroot)/sim/common/create-version.sh $(srcroot)/gdb \
> - $(host_alias) $(target_alias) version.c
> + $(SHELL) $(srcroot)/sim/common/create-version.sh $(srcroot)/gdb $@.tmp
> + $(SHELL) $(srcroot)/move-if-change $@.tmp $@
>
> #
> # Rules for building sim-* components. Triggered by listing the corresponding
> diff --git a/sim/common/create-version.sh b/sim/common/create-version.sh
> index 5252c3b8bd80..7b35e87e2150 100755
> --- a/sim/common/create-version.sh
> +++ b/sim/common/create-version.sh
> @@ -23,16 +23,11 @@
> # TARGET_ALIAS OUTPUT-FILE-NAME
>
> srcdir="$1"
> -host_alias="$2"
> -target_alias="$3"
> -output="$4"
> +output="$2"
>
> -rm -f version.c-tmp $output version.tmp
> date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$/\1/p' $srcdir/../bfd/version.h`
> -sed -e "s/DATE/$date/" < $srcdir/version.in > version.tmp
> -echo '#include "version.h"' >> version.c-tmp
> -echo 'const char version[] = "'"`sed q version.tmp`"'";' >> version.c-tmp
> -echo 'const char host_name[] = "'"$host_alias"'";' >> version.c-tmp
> -echo 'const char target_name[] = "'"$target_alias"'";' >> version.c-tmp
> -mv version.c-tmp $output
> -rm -f version.tmp
> +ver=`sed -e "s/DATE/$date/;q" $srcdir/version.in`
> +(
> +echo '#include "version.h"'
> +echo 'const char version[] = "'"${ver}"'";'
> +) >"${output}"
> --
> 2.28.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH/committed v2] sim: common: simplify version script
2021-01-18 9:57 ` Andrew Burgess
@ 2021-01-18 17:27 ` Mike Frysinger via Gdb-patches
2021-01-19 9:29 ` Sebastian Huber
0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger via Gdb-patches @ 2021-01-18 17:27 UTC (permalink / raw)
To: gdb-patches
We don't use the host & target aliases, so don't bother emitting them.
---
sim/common/ChangeLog | 6 ++++++
sim/common/Make-common.in | 5 +++--
sim/common/create-version.sh | 17 ++++++-----------
3 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index beca012b601f..8ab1c903fff5 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-18 Mike Frysinger <vapier@gentoo.org>
+
+ * Make-common.in (version.c): Simplifiy args and call move-if-change.
+ * create-version.sh: Delete host & target alias logic. Write to the
+ output directly.
+
2021-01-18 Mike Frysinger <vapier@gentoo.org>
* configure, configure.ac, Makefile.in: Delete.
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 6e7193044305..8740a4a079e7 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -291,8 +291,9 @@ stamp-tvals: gentmap
touch stamp-tvals
version.c: Makefile $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcroot)/sim/common/create-version.sh
- $(SHELL) $(srcroot)/sim/common/create-version.sh $(srcroot)/gdb \
- $(host_alias) $(target_alias) version.c
+ $(SHELL) $(srcroot)/sim/common/create-version.sh $(srcroot)/gdb $@.tmp
+ $(SHELL) $(srcroot)/move-if-change $@.tmp $@
+ touch $@
#
# Rules for building sim-* components. Triggered by listing the corresponding
diff --git a/sim/common/create-version.sh b/sim/common/create-version.sh
index 5252c3b8bd80..7b35e87e2150 100755
--- a/sim/common/create-version.sh
+++ b/sim/common/create-version.sh
@@ -23,16 +23,11 @@
# TARGET_ALIAS OUTPUT-FILE-NAME
srcdir="$1"
-host_alias="$2"
-target_alias="$3"
-output="$4"
+output="$2"
-rm -f version.c-tmp $output version.tmp
date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$/\1/p' $srcdir/../bfd/version.h`
-sed -e "s/DATE/$date/" < $srcdir/version.in > version.tmp
-echo '#include "version.h"' >> version.c-tmp
-echo 'const char version[] = "'"`sed q version.tmp`"'";' >> version.c-tmp
-echo 'const char host_name[] = "'"$host_alias"'";' >> version.c-tmp
-echo 'const char target_name[] = "'"$target_alias"'";' >> version.c-tmp
-mv version.c-tmp $output
-rm -f version.tmp
+ver=`sed -e "s/DATE/$date/;q" $srcdir/version.in`
+(
+echo '#include "version.h"'
+echo 'const char version[] = "'"${ver}"'";'
+) >"${output}"
--
2.28.0
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH/committed v2] sim: common: simplify version script
2021-01-18 17:27 ` [PATCH/committed v2] " Mike Frysinger via Gdb-patches
@ 2021-01-19 9:29 ` Sebastian Huber
2021-01-19 15:55 ` Mike Frysinger via Gdb-patches
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Huber @ 2021-01-19 9:29 UTC (permalink / raw)
To: Mike Frysinger, gdb-patches
Hello Mike,
maybe this broke the ppc simulator:
gcc -O2 -g -pipe
-I/home/EB/sebastian_h/src/rtems-source-builder/rtems/build/tmp/sb-21112/7/rtems-powerpc/tmp/sh/rtems/7/include
-c -g -O2 -DDEFAULT_INLINE=PSIM_INLINE_LOCALS
-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN -DWITH_SMP=5
-DHAVE_TERMIOS_STRUCTURE -DHAVE_TERMIOS_CLINE -DHAVE_DEVZERO -I.
-I../../../sourceware-mirror-binutils-gdb-a75a6a4/sim/ppc
-I../../../sourceware-mirror-binutils-gdb-a75a6a4/sim/ppc/../../include
-I../../bfd
-I../../../sourceware-mirror-binutils-gdb-a75a6a4/sim/ppc/../../bfd
-I../../gdb
-I../../../sourceware-mirror-binutils-gdb-a75a6a4/sim/ppc/../../gdb
-I../../../sourceware-mirror-binutils-gdb-a75a6a4/sim/ppc/../../gdb/config
-DHAVE_COMMON_FPU -I../common
-I../../../sourceware-mirror-binutils-gdb-a75a6a4/sim/ppc/../common
version.c
gcc: error: version.c: No such file or directory
--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax: +49-89-18 94 741 - 08
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH/committed v2] sim: common: simplify version script
2021-01-19 9:29 ` Sebastian Huber
@ 2021-01-19 15:55 ` Mike Frysinger via Gdb-patches
2021-01-20 5:22 ` Sebastian Huber
0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger via Gdb-patches @ 2021-01-19 15:55 UTC (permalink / raw)
To: Sebastian Huber; +Cc: gdb-patches
On 19 Jan 2021 10:29, Sebastian Huber wrote:
> maybe this broke the ppc simulator:
should be fixed by this commit i just pushed. lmk if it doesn't.
From e3611d5be9a11f31a145768fbaf9301e0cc0bb42 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Tue, 19 Jan 2021 10:52:33 -0500
Subject: [PATCH] sim: ppc: update version script usage
This matches the changes in the common code.
---
sim/ppc/ChangeLog | 4 ++++
sim/ppc/Makefile.in | 5 +++--
2 files changed, 7 insertions(+), 2 deletions(-)
2021-01-19 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (version.c): Simplifiy args and call move-if-change.
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 8ad76c6ed3b1..8c62f44297eb 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -549,8 +549,9 @@ $(TARGETLIB): tmp-igen tmp-dgen tmp-hw tmp-pk tmp-defines $(LIB_OBJ) $(GDB_OBJ)
$(RANLIB) $(TARGETLIB)
version.c: Makefile $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcroot)/sim/common/create-version.sh
- $(SHELL) $(srcroot)/sim/common/create-version.sh $(srcroot)/gdb \
- $(host_alias) $(target_alias) version.c
+ $(SHELL) $(srcroot)/sim/common/create-version.sh $(srcroot)/gdb $@.tmp
+ $(SHELL) $(srcroot)/move-if-change $@.tmp $@
+ touch $@
version.o: version.c $(version_h)
psim.o: psim.c $(CPU_H) $(IDECODE_H) $(OPTIONS_H) $(TREE_H) $(BFD_H)
--
2.28.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH/committed v2] sim: common: simplify version script
2021-01-19 15:55 ` Mike Frysinger via Gdb-patches
@ 2021-01-20 5:22 ` Sebastian Huber
0 siblings, 0 replies; 6+ messages in thread
From: Sebastian Huber @ 2021-01-20 5:22 UTC (permalink / raw)
To: gdb-patches
On 19/01/2021 16:55, Mike Frysinger wrote:
> On 19 Jan 2021 10:29, Sebastian Huber wrote:
>> maybe this broke the ppc simulator:
> should be fixed by this commit i just pushed. lmk if it doesn't.
Thanks, this fixed the problem.
--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax: +49-89-18 94 741 - 08
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-01-20 5:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-17 11:19 [PATCH] sim: common: simplify version script Mike Frysinger via Gdb-patches
2021-01-18 9:57 ` Andrew Burgess
2021-01-18 17:27 ` [PATCH/committed v2] " Mike Frysinger via Gdb-patches
2021-01-19 9:29 ` Sebastian Huber
2021-01-19 15:55 ` Mike Frysinger via Gdb-patches
2021-01-20 5:22 ` Sebastian Huber
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox