Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] sim: make sure to include strsignal prototype
@ 2012-03-23  4:23 Mike Frysinger
  2012-03-23  4:35 ` Mike Frysinger
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Mike Frysinger @ 2012-03-23  4:23 UTC (permalink / raw)
  To: gdb-patches

Before POSIX standardized strsignal(), old systems would hide the
prototype unless the normal extension defines were enabled.  So use
the AC_USE_SYSTEM_EXTENSIONS helper for that.

Then make sure we include string.h ourselves in nrun.c rather than
relying on implicit includes via other sim headers.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

sim/common/:
2012-03-23  Mike Frysinger  <vapier@gentoo.org>

	* acinclude.m4 (SIM_AC_COMMON): Call AC_USE_SYSTEM_EXTENSIONS.
	* nrun.c: Include string.h/strings.h.
	* aclocal.m4, config.in, configure: Regenerate.

sim/arm:
sim/bfin:
sim/avr:
sim/d10v:
sim/cr16:
sim/cris:
sim/erc32:
sim/frv:
sim/h8300:
sim/iq2000:
sim/m32c:
sim/m32r:
sim/lm32:
sim/m68hc11:
sim/microblaze:
sim/mcore:
sim/mips:
sim/mn10300:
sim/moxie:
sim/rl78:
sim/rx:
sim/sh64:
sim/sh:
sim/v850:
2012-03-23  Mike Frysinger  <vapier@gentoo.org>

	* aclocal.m4, config.in, configure: Regenerate.

sim/igen:
sim/ppc:
sim/testsuite:
2012-03-23  Mike Frysinger  <vapier@gentoo.org>

	* configure: Regenerate.

---
 sim/common/acinclude.m4 |    1 +
 sim/common/nrun.c       |   10 ++++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4
index 2833d8e..ef42775 100644
--- a/sim/common/acinclude.m4
+++ b/sim/common/acinclude.m4
@@ -29,6 +29,7 @@ AC_REQUIRE([AC_PROG_CC])
 # autoconf.info says this should be called right after AC_INIT.
 AC_CONFIG_HEADER(ifelse([$1],,config.h,[$1]):config.in)
 AC_CANONICAL_SYSTEM
+AC_USE_SYSTEM_EXTENSIONS
 AC_ARG_PROGRAM
 AC_PROG_INSTALL
 
diff --git a/sim/common/nrun.c b/sim/common/nrun.c
index a50ae06..8e92879 100644
--- a/sim/common/nrun.c
+++ b/sim/common/nrun.c
@@ -15,6 +15,16 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <signal.h>
+
+/* For strsignal.  */
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+
 #include "sim-main.h"
 
 #include "bfd.h"
-- 
1.7.8.5


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] sim: make sure to include strsignal prototype
  2012-03-23  4:23 [PATCH] sim: make sure to include strsignal prototype Mike Frysinger
@ 2012-03-23  4:35 ` Mike Frysinger
  2012-03-23  5:24 ` Hans-Peter Nilsson
  2012-03-24  5:39 ` [PATCH] sim: make sure to include strsignal prototype Mike Frysinger
  2 siblings, 0 replies; 21+ messages in thread
From: Mike Frysinger @ 2012-03-23  4:35 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: Text/Plain, Size: 392 bytes --]

On Friday 23 March 2012 00:23:12 Mike Frysinger wrote:
> sim/ppc:
> sim/testsuite:
> 2012-03-23  Mike Frysinger  <vapier@gentoo.org>
> 
> 	* configure: Regenerate.

hmm, those two dirs aren't needed for this change.  the testsuite dir gets 
regenerated for a change made a while (committed now) while the ppc one 
appears to be just autoconf/comment noise which i'll ignore.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] sim: make sure to include strsignal prototype
  2012-03-23  4:23 [PATCH] sim: make sure to include strsignal prototype Mike Frysinger
  2012-03-23  4:35 ` Mike Frysinger
@ 2012-03-23  5:24 ` Hans-Peter Nilsson
  2012-03-23 15:43   ` Mike Frysinger
                     ` (2 more replies)
  2012-03-24  5:39 ` [PATCH] sim: make sure to include strsignal prototype Mike Frysinger
  2 siblings, 3 replies; 21+ messages in thread
From: Hans-Peter Nilsson @ 2012-03-23  5:24 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

On Fri, 23 Mar 2012, Mike Frysinger wrote:
> Before POSIX standardized strsignal(), old systems would hide the
> prototype unless the normal extension defines were enabled.  So use
> the AC_USE_SYSTEM_EXTENSIONS helper for that.
>
> Then make sure we include string.h ourselves in nrun.c rather than
> relying on implicit includes via other sim headers.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>
> sim/common/:
> 2012-03-23  Mike Frysinger  <vapier@gentoo.org>
>
> 	* acinclude.m4 (SIM_AC_COMMON): Call AC_USE_SYSTEM_EXTENSIONS.
> 	* nrun.c: Include string.h/strings.h.
> 	* aclocal.m4, config.in, configure: Regenerate.
>
> sim/arm:
> sim/bfin:
> sim/avr:
> sim/d10v:
> sim/cr16:
> sim/cris:
> sim/erc32:
> sim/frv:
> sim/h8300:
> sim/iq2000:
> sim/m32c:
> sim/m32r:
> sim/lm32:
> sim/m68hc11:
> sim/microblaze:
> sim/mcore:
> sim/mips:
> sim/mn10300:
> sim/moxie:
> sim/rl78:
> sim/rx:
> sim/sh64:
> sim/sh:
> sim/v850:
> 2012-03-23  Mike Frysinger  <vapier@gentoo.org>
>
> 	* aclocal.m4, config.in, configure: Regenerate.
>
> sim/igen:
> sim/ppc:
> sim/testsuite:
> 2012-03-23  Mike Frysinger  <vapier@gentoo.org>
>
> 	* configure: Regenerate.

Ok thanks.  I noticed your later comments regarding ppc/ and
testsuite/, but better regenerated now even if it's because of
earlier changes than noise later. (And the "regenerate" is still
true even it the reason wasn't your changes.)

Another thing I noticed: could you please adjust the
sim/testsuite/sim/cris/c/ tests too?  Lots of "program stopped
with signal" there; your earlier fixes seems to have been just
to the asm/ subdir.  I'm not putting it on you to assemble a
cris-elf toolchain to verify it (not that it shouldn't be
obvious :) just do the same transformation as in asm/.

Thanks.

brgds, H-P


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] sim: make sure to include strsignal prototype
  2012-03-23  5:24 ` Hans-Peter Nilsson
@ 2012-03-23 15:43   ` Mike Frysinger
  2012-03-23 22:12     ` Hans-Peter Nilsson
  2012-03-24  5:34     ` Mike Frysinger
  2012-03-24  4:12   ` Mike Frysinger
  2012-03-24 10:55   ` Finalizing fix committed for "[PATCH] sim: make sure to include strsignal prototype" Hans-Peter Nilsson
  2 siblings, 2 replies; 21+ messages in thread
From: Mike Frysinger @ 2012-03-23 15:43 UTC (permalink / raw)
  To: gdb-patches; +Cc: Hans-Peter Nilsson

[-- Attachment #1: Type: Text/Plain, Size: 671 bytes --]

On Friday 23 March 2012 01:24:07 Hans-Peter Nilsson wrote:
> Another thing I noticed: could you please adjust the
> sim/testsuite/sim/cris/c/ tests too?  Lots of "program stopped
> with signal" there; your earlier fixes seems to have been just
> to the asm/ subdir.

i fixed the ones that failed when i did `make check-sim`.  wasn't ignoring the 
other ones, just didn't notice.  i can fix them up too.

> I'm not putting it on you to assemble a
> cris-elf toolchain to verify it (not that it shouldn't be
> obvious :) just do the same transformation as in asm/.

i think last time i tried to build a cris toolchain it failed horribly so i 
gave up
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] sim: make sure to include strsignal prototype
  2012-03-23 15:43   ` Mike Frysinger
@ 2012-03-23 22:12     ` Hans-Peter Nilsson
  2012-03-23 22:43       ` Mike Frysinger
  2012-03-24  5:34     ` Mike Frysinger
  1 sibling, 1 reply; 21+ messages in thread
From: Hans-Peter Nilsson @ 2012-03-23 22:12 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

On Fri, 23 Mar 2012, Mike Frysinger wrote:
> On Friday 23 March 2012 01:24:07 Hans-Peter Nilsson wrote:
> > Another thing I noticed: could you please adjust the
> > sim/testsuite/sim/cris/c/ tests too?  Lots of "program stopped
> > with signal" there; your earlier fixes seems to have been just
> > to the asm/ subdir.
>
> i fixed the ones that failed when i did `make check-sim`.  wasn't ignoring the
> other ones, just didn't notice.  i can fix them up too.

Yes; a grep will find them.  Thanks.

> > I'm not putting it on you to assemble a
> > cris-elf toolchain to verify it (not that it shouldn't be
> > obvious :) just do the same transformation as in asm/.
>
> i think last time i tried to build a cris toolchain it failed horribly so i
> gave up

Ok, I'll bite:

FWIW, my autotester for cris-elf+cris-sim is humming along with
*no* test-suite regressions for the gcc-4.7 branch@185744.  For
gcc trunk@185744 there are *three* regressions since about 2007,
but all general, PR's open.  Updates of sim, binutils newlib
happen automatically when there are no gcc regressions and
there's a clean update.

Then again, there are some general newbie obstacles when you
build a *-elf + *-sim toolchain from scratch for simulator
testing, though generally none target-specific...  Well ok,
there's one caveat: you need dejagnu-1.5 or a debian-derived
dist (has all submitted baseboard files including the needed
cris-sim.exp) if you don't want to mess with local dejagnu
baseboard files.

brgds, H-P


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] sim: make sure to include strsignal prototype
  2012-03-23 22:12     ` Hans-Peter Nilsson
@ 2012-03-23 22:43       ` Mike Frysinger
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Frysinger @ 2012-03-23 22:43 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: gdb-patches

[-- Attachment #1: Type: Text/Plain, Size: 666 bytes --]

On Friday 23 March 2012 18:12:36 Hans-Peter Nilsson wrote:
> On Fri, 23 Mar 2012, Mike Frysinger wrote:
> > On Friday 23 March 2012 01:24:07 Hans-Peter Nilsson wrote:
> > > I'm not putting it on you to assemble a
> > > cris-elf toolchain to verify it (not that it shouldn't be
> > > obvious :) just do the same transformation as in asm/.
> > 
> > i think last time i tried to build a cris toolchain it failed horribly so
> > i gave up
> 
> FWIW, my autotester for cris-elf+cris-sim is humming along with

i was attempting cris-linux targets in an effort to build uClibc/glibc.  never 
tried cris-elf.  i'll give that a spin and see how it goes.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] sim: make sure to include strsignal prototype
  2012-03-23  5:24 ` Hans-Peter Nilsson
  2012-03-23 15:43   ` Mike Frysinger
@ 2012-03-24  4:12   ` Mike Frysinger
  2012-03-24  5:53     ` Hans-Peter Nilsson
  2012-03-24 10:55   ` Finalizing fix committed for "[PATCH] sim: make sure to include strsignal prototype" Hans-Peter Nilsson
  2 siblings, 1 reply; 21+ messages in thread
From: Mike Frysinger @ 2012-03-24  4:12 UTC (permalink / raw)
  To: gdb-patches; +Cc: Hans-Peter Nilsson

[-- Attachment #1: Type: Text/Plain, Size: 3683 bytes --]

On Friday 23 March 2012 01:24:07 Hans-Peter Nilsson wrote:
> Another thing I noticed: could you please adjust the
> sim/testsuite/sim/cris/c/ tests too?  Lots of "program stopped
> with signal" there; your earlier fixes seems to have been just
> to the asm/ subdir.  I'm not putting it on you to assemble a
> cris-elf toolchain to verify it (not that it shouldn't be
> obvious :) just do the same transformation as in asm/.

the cris sim gets into an infinite loop for me.  from the log:

Executing on host: cris-elf-gcc ../../../../sim/testsuite/sim/cris/c/append1.c  -O2  -lm   -o append1.c.x    (timeout = 300)
/usr/lib/gcc/cris-elf/4.5.3/../../../../cris-elf/lib/libc.a(lib_a-closer.o): In function `_close_r':
.../newlib-1.20.0/newlib/libc/reent/closer.c:53: warning: _close is not implemented and will always fail
/usr/lib/gcc/cris-elf/4.5.3/../../../../cris-elf/lib/libc.a(lib_a-fstatr.o): In function `_fstat_r':
.../newlib-1.20.0/newlib/libc/reent/fstatr.c:62: warning: _fstat is not implemented and will always fail
/usr/lib/gcc/cris-elf/4.5.3/../../../../cris-elf/lib/libc.a(lib_a-isattyr.o): In function `_isatty_r':
.../newlib-1.20.0/newlib/libc/reent/isattyr.c:58: warning: _isatty is not implemented and will always fail
/usr/lib/gcc/cris-elf/4.5.3/../../../../cris-elf/lib/libc.a(lib_a-lseekr.o): In function `_lseek_r':
.../newlib-1.20.0/newlib/libc/reent/lseekr.c:58: warning: _lseek is not implemented and will always fail
/usr/lib/gcc/cris-elf/4.5.3/../../../../cris-elf/lib/libc.a(lib_a-openr.o): In function `_open_r':
.../newlib-1.20.0/newlib/libc/reent/openr.c:59: warning: _open is not implemented and will always fail
/usr/lib/gcc/cris-elf/4.5.3/../../../../cris-elf/lib/libc.a(lib_a-readr.o): In function `_read_r':
.../newlib-1.20.0/newlib/libc/reent/readr.c:58: warning: _read is not implemented and will always fail
/usr/lib/gcc/cris-elf/4.5.3/../../../../cris-elf/lib/libc.a(lib_a-writer.o): In function `_write_r':
.../newlib-1.20.0/newlib/libc/reent/writer.c:58: warning: _write is not implemented and will always fail

Simulating .../sim/testsuite/sim/cris/c/append1.c with 
.../sim/cris/run    append1.c.x 
spawn .../sim/testsuite/../cris/run append1.c.x
WARNING: program timed out.
FAIL: crisv10 append1.c (execution)

running it by hand:
$ ./sim/cris/run -t ./sim/testsuite/append1.c.x
...
0x00167e #56   _fwalk          jump [sp+]        - sr <- 0x1680, gr <- 0x3dfffdb0, pc <- 0x9ba, xbit <- 0x0, insn-prefixed-p <- 0x0
0x0009ba #167  _cleanup_r      jump [sp+]        - sr <- 0x9bc, gr <- 0x3dfffdb4, pc <- 0x6ce, xbit <- 0x0, insn-prefixed-p <- 0x0
0x0006ce #65   exit            move.d r0,r10     - gr <- 0x1, nbit <- 0x0, zbit <- 0x0, xbit <- 0x0, insn-prefixed-p <- 0x0
0x0006d0 #65   exit            jsr 0x0000000000003582 - sr <- 0x6d6, pc <- 0x3582, xbit <- 0x0, insn-prefixed-p <- 0x0
0x003582 #11   _exit           ba 0x0000000000003582 - xbit <- 0x0, insn-prefixed-p <- 0x0, pc <- 0x3582
0x003584 #11   _exit           nop               - xbit <- 0x0, insn-prefixed-p <- 0x0
0x003582 #11   _exit           ba 0x0000000000003582 - xbit <- 0x0, insn-prefixed-p <- 0x0, pc <- 0x3582
0x003584 #11   _exit           nop               - xbit <- 0x0, insn-prefixed-p <- 0x0
0x003582 #11   _exit           ba 0x0000000000003582 - xbit <- 0x0, insn-prefixed-p <- 0x0, pc <- 0x3582
0x003584 #11   _exit           nop               - xbit <- 0x0, insn-prefixed-p <- 0x0
0x003582 #11   _exit           ba 0x0000000000003582 - xbit <- 0x0, insn-prefixed-p <- 0x0, pc <- 0x3582
0x003584 #11   _exit           nop               - xbit <- 0x0, insn-prefixed-p <- 0x0
... loops here forever ...
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] sim: make sure to include strsignal prototype
  2012-03-23 15:43   ` Mike Frysinger
  2012-03-23 22:12     ` Hans-Peter Nilsson
@ 2012-03-24  5:34     ` Mike Frysinger
  1 sibling, 0 replies; 21+ messages in thread
From: Mike Frysinger @ 2012-03-24  5:34 UTC (permalink / raw)
  To: gdb-patches; +Cc: Hans-Peter Nilsson

[-- Attachment #1: Type: Text/Plain, Size: 8798 bytes --]

On Friday 23 March 2012 11:43:17 Mike Frysinger wrote:
> On Friday 23 March 2012 01:24:07 Hans-Peter Nilsson wrote:
> > Another thing I noticed: could you please adjust the
> > sim/testsuite/sim/cris/c/ tests too?  Lots of "program stopped
> > with signal" there; your earlier fixes seems to have been just
> > to the asm/ subdir.
> 
> i fixed the ones that failed when i did `make check-sim`.  wasn't ignoring
> the other ones, just didn't notice.  i can fix them up too.

committed the patch below
-mike

2012-03-24  Mike Frysinger  <vapier@gentoo.org>

	* c/clone5.c: Update output to ignore decoded signal string.
	* c/fcntl1.c, c/kill2.c, c/kill3.c, c/mprotect1.c, c/pipe5.c,
	c/readlink5.c, c/rtsigprocmask1.c, c/rtsigsuspend1.c, c/sig10.c,
	c/sig11.c, c/sig3.c, c/sig4.c, c/sig5.c, c/sig6.c, c/sig7.c,
	c/sig8.c, c/sigreturn1.c, c/sigreturn2.c, c/syscall1.c,
	c/syscall2.c, c/syscall3.c, c/syscall4.c, c/sysctl2.c: Likewise.

--- sim/testsuite/sim/cris/c/clone5.c
+++ sim/testsuite/sim/cris/c/clone5.c
@@ -2,7 +2,7 @@
 #notarget: cris*-*-elf
 #xerror:
 #output: Unimplemented clone syscall *
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 
 #include <stddef.h>
--- sim/testsuite/sim/cris/c/fcntl1.c
+++ sim/testsuite/sim/cris/c/fcntl1.c
@@ -2,7 +2,7 @@
 #notarget: cris*-*-elf
 #xerror:
 #output: Unimplemented fcntl*
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 #include <fcntl.h>
 #include <stdio.h>
--- sim/testsuite/sim/cris/c/kill2.c
+++ sim/testsuite/sim/cris/c/kill2.c
@@ -1,6 +1,6 @@
 /* Basic kill functionality test; suicide.
 #xerror:
-#output: program stopped with signal 6.\n
+#output: program stopped with signal 6 (*).\n
 */
 
 #include <stdio.h>
--- sim/testsuite/sim/cris/c/kill3.c
+++ sim/testsuite/sim/cris/c/kill3.c
@@ -1,6 +1,6 @@
 /* Basic kill functionality test; suicide.
 #xerror:
-#output: program stopped with signal 6.\n
+#output: program stopped with signal 6 (*).\n
 */
 
 #include <stdio.h>
--- sim/testsuite/sim/cris/c/mprotect1.c
+++ sim/testsuite/sim/cris/c/mprotect1.c
@@ -2,7 +2,7 @@
 #notarget: cris*-*-elf
 #xerror:
 #output: Unimplemented mprotect call (0x0, 0x2001, 0x4)\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
  */
 #include <stdlib.h>
 #include <stdio.h>
--- sim/testsuite/sim/cris/c/pipe5.c
+++ sim/testsuite/sim/cris/c/pipe5.c
@@ -2,7 +2,7 @@
 #notarget: cris*-*-elf
 #xerror:
 #output: Terminating simulation due to writing pipe * from one single thread\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 #include <stddef.h>
 #include <signal.h>
--- sim/testsuite/sim/cris/c/readlink5.c
+++ sim/testsuite/sim/cris/c/readlink5.c
@@ -3,6 +3,6 @@
 #dest: ./readlink5.c.x
 #xerror:
 #output: Unimplemented readlink syscall (*)\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 #include "readlink2.c"
--- sim/testsuite/sim/cris/c/rtsigprocmask1.c
+++ sim/testsuite/sim/cris/c/rtsigprocmask1.c
@@ -3,7 +3,7 @@
 #cc: additional_flags=-pthread
 #xerror:
 #output: Unimplemented rt_sigprocmask syscall (0x3, 0x0, 0x3dff*\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 
    Testing a signal handler corner case.  */
 
--- sim/testsuite/sim/cris/c/rtsigsuspend1.c
+++ sim/testsuite/sim/cris/c/rtsigsuspend1.c
@@ -2,7 +2,7 @@
 #notarget: cris*-*-elf
 #xerror:
 #output: Unimplemented rt_sigsuspend syscall arguments (0x1, 0x2)\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 
 #include <unistd.h>
--- sim/testsuite/sim/cris/c/sig10.c
+++ sim/testsuite/sim/cris/c/sig10.c
@@ -3,7 +3,7 @@
 #cc: additional_flags=-pthread
 #xerror:
 #output: Exiting pid 42 due to signal 9\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 
 #include <stdlib.h>
--- sim/testsuite/sim/cris/c/sig11.c
+++ sim/testsuite/sim/cris/c/sig11.c
@@ -3,7 +3,7 @@
 #cc: additional_flags=-pthread
 #xerror:
 #output: Unimplemented signal: 77\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 
 #include <stdlib.h>
--- sim/testsuite/sim/cris/c/sig3.c
+++ sim/testsuite/sim/cris/c/sig3.c
@@ -1,6 +1,6 @@
 /* Check that TRT happens at an abort (3) call, single thread.
 #xerror:
-#output: program stopped with signal 6.\n
+#output: program stopped with signal 6 (*).\n
 */
 
 #include <stdlib.h>
--- sim/testsuite/sim/cris/c/sig4.c
+++ sim/testsuite/sim/cris/c/sig4.c
@@ -3,7 +3,7 @@
 #cc: additional_flags=-pthread
 #xerror:
 #output: Exiting pid 42 due to signal 6\n
-#output: program stopped with signal 6.\n
+#output: program stopped with signal 6 (*).\n
 */
 
 #include <stdlib.h>
--- sim/testsuite/sim/cris/c/sig5.c
+++ sim/testsuite/sim/cris/c/sig5.c
@@ -1,7 +1,7 @@
 /* Check that TRT happens for an uncaught non-abort signal, single thread.
 #xerror:
 #output: Unimplemented signal: 7\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 
 #include <stdlib.h>
--- sim/testsuite/sim/cris/c/sig6.c
+++ sim/testsuite/sim/cris/c/sig6.c
@@ -3,7 +3,7 @@
 #cc: additional_flags=-pthread
 #xerror:
 #output: Exiting pid 42 due to signal 7\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 
 #include <stdlib.h>
--- sim/testsuite/sim/cris/c/sig7.c
+++ sim/testsuite/sim/cris/c/sig7.c
@@ -2,7 +2,7 @@
 #notarget: cris*-*-elf
 #xerror:
 #output: Unimplemented rt_sigaction syscall (0x8, 0x3df*\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 #include <stdio.h>
 #include <signal.h>
--- sim/testsuite/sim/cris/c/sig8.c
+++ sim/testsuite/sim/cris/c/sig8.c
@@ -1,7 +1,7 @@
 /* Check that TRT happens for an ignored catchable signal, single thread.
 #xerror:
 #output: Unimplemented signal: 14\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 
    Sure, it'd probably be better to support signals in single-thread too,
    but that's on an as-need basis, and I don't have a need for it yet.  */
--- sim/testsuite/sim/cris/c/sigreturn1.c
+++ sim/testsuite/sim/cris/c/sigreturn1.c
@@ -2,7 +2,7 @@
 #notarget: cris*-*-elf
 #xerror:
 #output: Invalid sigreturn syscall: no signal handler active (0x1, 0x2, 0x3, 0x4, 0x5, 0x6)\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 
 #include <unistd.h>
--- sim/testsuite/sim/cris/c/sigreturn2.c
+++ sim/testsuite/sim/cris/c/sigreturn2.c
@@ -3,7 +3,7 @@
 #cc: additional_flags=-pthread
 #xerror:
 #output: Invalid sigreturn syscall: no signal handler active (0x1, 0x2, 0x3, 0x4, 0x5, 0x6)\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 
 #include <stdlib.h>
--- sim/testsuite/sim/cris/c/syscall1.c
+++ sim/testsuite/sim/cris/c/syscall1.c
@@ -2,7 +2,7 @@
 #notarget: cris*-*-elf
 #xerror:
 #output: Unimplemented syscall: 166 (0x1, 0x2, 0x3, 0x4, 0x5, 0x6)\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 
 #include <unistd.h>
--- sim/testsuite/sim/cris/c/syscall2.c
+++ sim/testsuite/sim/cris/c/syscall2.c
@@ -2,7 +2,7 @@
 #notarget: cris*-*-elf
 #xerror:
 #output: Unimplemented syscall: 0 (0x3, 0x2, 0x1, 0x4, 0x6, 0x5)\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 
 #include <unistd.h>
--- sim/testsuite/sim/cris/c/syscall3.c
+++ sim/testsuite/sim/cris/c/syscall3.c
@@ -3,7 +3,7 @@
 #sim: --cris-unknown-syscall=stop
 #xerror:
 #output: Unimplemented syscall: 166 (0x1, 0x2, 0x3, 0x4, 0x5, 0x6)\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 
 #include "syscall1.c"
--- sim/testsuite/sim/cris/c/syscall4.c
+++ sim/testsuite/sim/cris/c/syscall4.c
@@ -3,7 +3,7 @@
 #sim: --cris-unknown-syscall=stop
 #xerror:
 #output: Unimplemented syscall: 0 (0x3, 0x2, 0x1, 0x4, 0x6, 0x5)\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 */
 
 #include "syscall2.c"
--- sim/testsuite/sim/cris/c/sysctl2.c
+++ sim/testsuite/sim/cris/c/sysctl2.c
@@ -1,7 +1,7 @@
 /* Check error message for invalid sysctl call.
 #xerror:
 #output: Unimplemented _sysctl syscall *\n
-#output: program stopped with signal 4.\n
+#output: program stopped with signal 4 (*).\n
 #notarget: cris*-*-elf
 */
 

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] sim: make sure to include strsignal prototype
  2012-03-23  4:23 [PATCH] sim: make sure to include strsignal prototype Mike Frysinger
  2012-03-23  4:35 ` Mike Frysinger
  2012-03-23  5:24 ` Hans-Peter Nilsson
@ 2012-03-24  5:39 ` Mike Frysinger
  2 siblings, 0 replies; 21+ messages in thread
From: Mike Frysinger @ 2012-03-24  5:39 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: Text/Plain, Size: 394 bytes --]

On Friday 23 March 2012 00:23:12 Mike Frysinger wrote:
> Before POSIX standardized strsignal(), old systems would hide the
> prototype unless the normal extension defines were enabled.  So use
> the AC_USE_SYSTEM_EXTENSIONS helper for that.
> 
> Then make sure we include string.h ourselves in nrun.c rather than
> relying on implicit includes via other sim headers.

committed
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] sim: make sure to include strsignal prototype
  2012-03-24  4:12   ` Mike Frysinger
@ 2012-03-24  5:53     ` Hans-Peter Nilsson
  2012-03-24  6:12       ` Mike Frysinger
  0 siblings, 1 reply; 21+ messages in thread
From: Hans-Peter Nilsson @ 2012-03-24  5:53 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

On Sat, 24 Mar 2012, Mike Frysinger wrote:
> On Friday 23 March 2012 01:24:07 Hans-Peter Nilsson wrote:
> > Another thing I noticed: could you please adjust the
> > sim/testsuite/sim/cris/c/ tests too?  Lots of "program stopped
> > with signal" there; your earlier fixes seems to have been just
> > to the asm/ subdir.  I'm not putting it on you to assemble a
> > cris-elf toolchain to verify it (not that it shouldn't be
> > obvious :) just do the same transformation as in asm/.
>
> the cris sim gets into an infinite loop for me.  from the log:
>
> Executing on host: cris-elf-gcc ../../../../sim/testsuite/sim/cris/c/append1.c  -O2  -lm   -o append1.c.x    (timeout = 300)
> /usr/lib/gcc/cris-elf/4.5.3/../../../../cris-elf/lib/libc.a(lib_a-closer.o): In function `_close_r':
> .../newlib-1.20.0/newlib/libc/reent/closer.c:53: warning: _close is not implemented and will always fail

Did you "make check-sim RUNTESTFLAGS=--target_board=cris-sim"?
The warning message indicates the absence of that option or the
wrong baseboard.

(Arguably the *sim* test-suite should know set that option by
itself, but at least it's consistent with other runnable
dejagnu-based test-suites.)

brgds, H-P


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] sim: make sure to include strsignal prototype
  2012-03-24  5:53     ` Hans-Peter Nilsson
@ 2012-03-24  6:12       ` Mike Frysinger
  2012-03-24  6:49         ` Hans-Peter Nilsson
  0 siblings, 1 reply; 21+ messages in thread
From: Mike Frysinger @ 2012-03-24  6:12 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: gdb-patches

[-- Attachment #1: Type: Text/Plain, Size: 3809 bytes --]

On Saturday 24 March 2012 01:53:42 Hans-Peter Nilsson wrote:
> On Sat, 24 Mar 2012, Mike Frysinger wrote:
> > On Friday 23 March 2012 01:24:07 Hans-Peter Nilsson wrote:
> > > Another thing I noticed: could you please adjust the
> > > sim/testsuite/sim/cris/c/ tests too?  Lots of "program stopped
> > > with signal" there; your earlier fixes seems to have been just
> > > to the asm/ subdir.  I'm not putting it on you to assemble a
> > > cris-elf toolchain to verify it (not that it shouldn't be
> > > obvious :) just do the same transformation as in asm/.
> > 
> > the cris sim gets into an infinite loop for me.  from the log:
> > 
> > Executing on host: cris-elf-gcc
> > ../../../../sim/testsuite/sim/cris/c/append1.c  -O2  -lm   -o
> > append1.c.x    (timeout = 300)
> > /usr/lib/gcc/cris-elf/4.5.3/../../../../cris-elf/lib/libc.a(lib_a-closer
> > .o): In function `_close_r':
> > .../newlib-1.20.0/newlib/libc/reent/closer.c:53: warning: _close is not
> > implemented and will always fail
> 
> Did you "make check-sim RUNTESTFLAGS=--target_board=cris-sim"?
> The warning message indicates the absence of that option or the
> wrong baseboard.

using those flags makes most run.  the linker segfaults when working on
helloaout.c, so that can't be good:

$ cris-elf-gcc ../../sim/testsuite/sim/cris/c/helloaout.c \
	-O2 -L/usr/local/src/gnu/sourceware/build/build-cris/ld -sim3 \
	-Wl,-mcrisaout -sim -Ttext=0 -lm -o helloaout.c.x -Bld
collect2: ld terminated with signal 11 [Segmentation fault], core dumped

$ gdb ld/ld core
Reading symbols from /usr/local/src/gnu/sourceware/build/build-cris/ld/ld...done.
[New LWP 20813]

warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `ld/ld -mcriself --gc-sections -o helloaout.c.x /usr/lib/gcc/cris-elf/4.5.3/../.'.
Program terminated with signal 11, Segmentation fault.
#0  aout_get_external_symbols (abfd=0x1b4fd30) at ../../../bfd/aoutx.h:1300
1300          count = exec_hdr (abfd)->a_syms / EXTERNAL_NLIST_SIZE;
(gdb) bt
#0  aout_get_external_symbols (abfd=0x1b4fd30) at ../../../bfd/aoutx.h:1300
#1  0x0000000000441ef0 in aout_link_check_archive_element (abfd=0x1b4fd30, info=0x702c40, pneeded=0x7fffc8306b2c) at 
../../../bfd/aoutx.h:3410
#2  0x00000000004356aa in _bfd_generic_link_add_archive_symbols (abfd=0x1b4efd0, info=0x702c40, checkfn=0x441ed0 
<aout_link_check_archive_element>) at ../../../bfd/linker.c:1131
#3  0x00000000004119da in load_symbols (place=<optimized out>, entry=0x1af5320) at ../../../ld/ldlang.c:2807
#4  load_symbols (entry=0x1af5320, place=<optimized out>) at ../../../ld/ldlang.c:2672
#5  0x00000000004126b3 in open_input_bfds (s=0x1af5320, mode=OPEN_BFD_FORCE) at ../../../ld/ldlang.c:3267
#6  0x000000000041257e in open_input_bfds (s=0x1af5300, mode=OPEN_BFD_NORMAL) at ../../../ld/ldlang.c:3219
#7  0x0000000000414b2a in lang_process () at ../../../ld/ldlang.c:6541
#8  0x0000000000403c6f in main (argc=0x19, argv=0x7fffc8306e38) at ../../../ld/ldmain.c:393

> (Arguably the *sim* test-suite should know set that option by
> itself, but at least it's consistent with other runnable
> dejagnu-based test-suites.)

no other target needs this.  i did some work about two years ago specifically
to avoid having to mess with dejagnu just to run `make check-sim`.

looks like the difference are just compiler flags ?  you can specify those on a
test-specific basis using the "cc:" field:
$ head -5 testsuite/sim/argc.c 
/* Basic argc/argv tests.
# mach: bfin
# cc: -msim
# progopts: a bb ccc dddd
*/
$ head -5 testsuite/sim/mdma-32bit-1d.c 
/* Basic MDMA device tests.
# mach: bfin
# cc: -mcpu=bf537 -nostdlib -lc
# sim: --env operating --model bf537
*/
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] sim: make sure to include strsignal prototype
  2012-03-24  6:12       ` Mike Frysinger
@ 2012-03-24  6:49         ` Hans-Peter Nilsson
  2012-03-24 18:18           ` Mike Frysinger
  0 siblings, 1 reply; 21+ messages in thread
From: Hans-Peter Nilsson @ 2012-03-24  6:49 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

On Sat, 24 Mar 2012, Mike Frysinger wrote:
> > Did you "make check-sim RUNTESTFLAGS=--target_board=cris-sim"?
> > The warning message indicates the absence of that option or the
> > wrong baseboard.
>
> using those flags makes most run.  the linker segfaults when working on
> helloaout.c, so that can't be good:
>
> $ cris-elf-gcc ../../sim/testsuite/sim/cris/c/helloaout.c \
> 	-O2 -L/usr/local/src/gnu/sourceware/build/build-cris/ld -sim3 \
> 	-Wl,-mcrisaout -sim -Ttext=0 -lm -o helloaout.c.x -Bld
> collect2: ld terminated with signal 11 [Segmentation fault], core dumped

Ouch.  I'd be happy to process a ld PR for this, or I'll get to
it eventually.  Not that supporting a.out is of any particular
interest, but it shouldn't pollute the test-results.

> > (Arguably the *sim* test-suite should know set that option by
> > itself, but at least it's consistent with other runnable
> > dejagnu-based test-suites.)
>
> no other target needs this.

You mean "when you run the test-suite with a target compiler,
the only other sim target with C test-cases doesn't need this". :)
I see bfin had a few C test-cases added the last year, nice.

>  i did some work about two years ago specifically
> to avoid having to mess with dejagnu just to run `make check-sim`.

I guess you missed fixing CRIS then. :)
I'm not overexcited about the crusade making "sim" a special
case, when it works using the same dejagnu spell as anything
else.  So _no_ adding compiler flags to the individual
test-cases for the globally needed options.

> looks like the difference are just compiler flags ?

Linker flags, pointing to the right library, stuff like that...
See the baseboard file.  Different options for *-linux-gnu than
for *-elf though.  (Yes, the sim can run trivial cris*-linux-gnu
-static programs.)

brgds, H-P


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Finalizing fix committed for "[PATCH] sim: make sure to include strsignal prototype"
  2012-03-23  5:24 ` Hans-Peter Nilsson
  2012-03-23 15:43   ` Mike Frysinger
  2012-03-24  4:12   ` Mike Frysinger
@ 2012-03-24 10:55   ` Hans-Peter Nilsson
  2012-03-24 18:24     ` Mike Frysinger
  2 siblings, 1 reply; 21+ messages in thread
From: Hans-Peter Nilsson @ 2012-03-24 10:55 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

On Fri, 23 Mar 2012, Hans-Peter Nilsson wrote:
> On Fri, 23 Mar 2012, Mike Frysinger wrote:
> > Before POSIX standardized strsignal(), old systems would hide the
> > prototype unless the normal extension defines were enabled.  So use
> > the AC_USE_SYSTEM_EXTENSIONS helper for that.
> >
> > Then make sure we include string.h ourselves in nrun.c rather than
> > relying on implicit includes via other sim headers.
> >
> > Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> >
> > sim/common/:
> > 2012-03-23  Mike Frysinger  <vapier@gentoo.org>
> >
> > 	* acinclude.m4 (SIM_AC_COMMON): Call AC_USE_SYSTEM_EXTENSIONS.
> > 	* nrun.c: Include string.h/strings.h.
> > 	* aclocal.m4, config.in, configure: Regenerate.

This patch was missing the critical include of cconfig.h so you
should still have seen warnings about implicit declarations of
strsignal when testing.  On the other hand, I didn't notice the
missing piece when I reviewed, so as penance I tested and
committed the following for you.

Tested no regressions (some errors present for some targets but
none the worse) on i686-linux cross to (target+board)
cris-elf+cris-sim, frv-elf+frv-sim, sh64-elf+sh64-sim,
m32r-elf+m32r-sim mips-elf+mips-sim, v850-elf+v850-sim,
sh-elf+sh-sim, arm-elf+arm-sim.

I built and and started testing for bfin-elf+unix but got a lot
of assembly errors for values out-of-range (HEAD binutils,
perhaps the assembler isn't tested on a 32-bit host?) for
assembly-code tests and also apparently a compiler is not
optional as for cris-sim, but required, causing spurious errors.

FWIW, all sim tests fail linking for cr16-elf+cr16-sim, maybe my
locally added baseboard is out of date.

My sim autotester is happy again after this change; thankfully
it's ignorant of the multitude of missing-declaration warnings
exposed lately.  BTW the next week I'm not available for
reviewing, but I'd prefer to have a look at further patches if
there's more to come, particularly changes of general nature.

	* nrun.c: Add #ifdef HAVE_CONFIG_H and associated includes stanza
	missing in last change.

Index: nrun.c
===================================================================
RCS file: /cvs/src/src/sim/common/nrun.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -p -u -r1.17 -r1.18
--- nrun.c	24 Mar 2012 05:38:35 -0000	1.17
+++ nrun.c	24 Mar 2012 09:31:09 -0000	1.18
@@ -14,6 +14,12 @@ GNU General Public License for more deta
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

+/* Need to be before general includes, to pick up e.g. _GNU_SOURCE.  */
+#ifdef HAVE_CONFIG_H
+#include "cconfig.h"
+#include "tconfig.h"
+#endif
+
 #include <signal.h>

 /* For strsignal.  */

brgds, H-P


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] sim: make sure to include strsignal prototype
  2012-03-24  6:49         ` Hans-Peter Nilsson
@ 2012-03-24 18:18           ` Mike Frysinger
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Frysinger @ 2012-03-24 18:18 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: gdb-patches

[-- Attachment #1: Type: Text/Plain, Size: 2282 bytes --]

On Saturday 24 March 2012 02:48:45 Hans-Peter Nilsson wrote:
> On Sat, 24 Mar 2012, Mike Frysinger wrote:
> > > Did you "make check-sim RUNTESTFLAGS=--target_board=cris-sim"?
> > > The warning message indicates the absence of that option or the
> > > wrong baseboard.
> > 
> > using those flags makes most run.  the linker segfaults when working on
> > helloaout.c, so that can't be good:
> > 
> > $ cris-elf-gcc ../../sim/testsuite/sim/cris/c/helloaout.c \
> > 
> > 	-O2 -L/usr/local/src/gnu/sourceware/build/build-cris/ld -sim3 \
> > 	-Wl,-mcrisaout -sim -Ttext=0 -lm -o helloaout.c.x -Bld
> > 
> > collect2: ld terminated with signal 11 [Segmentation fault], core dumped
> 
> Ouch.  I'd be happy to process a ld PR for this, or I'll get to
> it eventually.  Not that supporting a.out is of any particular
> interest, but it shouldn't pollute the test-results.

http://sourceware.org/bugzilla/show_bug.cgi?id=13900

> >  i did some work about two years ago specifically
> > to avoid having to mess with dejagnu just to run `make check-sim`.
> 
> I guess you missed fixing CRIS then. :)

not really ... the code fixed up was common code to automatically select the 
locally compiled `run` binary if no sim was specified

> I'm not overexcited about the crusade making "sim" a special
> case, when it works using the same dejagnu spell as anything
> else.  So _no_ adding compiler flags to the individual
> test-cases for the globally needed options.

i don't know what you're referring to at all here

> > looks like the difference are just compiler flags ?
> 
> Linker flags, pointing to the right library, stuff like that...
> See the baseboard file.  Different options for *-linux-gnu than
> for *-elf though.

i don't think it's unreasonable for the cris sim exp to set up sane defaults 
based on the target.  you know if the sim was configured for *-elf or *-linux-
gnu by default.

> (Yes, the sim can run trivial cris*-linux-gnu -static programs.)

and the Blackfin sim can handle static or dynamic Linux userland code in 
addition to booting a Linux kernel or just running newlib/libgloss apps.

$ echo 'main(){puts("HI");}' | bfin-linux-uclibc-gcc -x c - -o a.out -static
$ bfin-elf-run --env user ./a.out 
HI
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Finalizing fix committed for "[PATCH] sim: make sure to include strsignal prototype"
  2012-03-24 10:55   ` Finalizing fix committed for "[PATCH] sim: make sure to include strsignal prototype" Hans-Peter Nilsson
@ 2012-03-24 18:24     ` Mike Frysinger
  2012-03-24 20:55       ` Hans-Peter Nilsson
  2012-03-25  7:40       ` Mike Frysinger
  0 siblings, 2 replies; 21+ messages in thread
From: Mike Frysinger @ 2012-03-24 18:24 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: gdb-patches

[-- Attachment #1: Type: Text/Plain, Size: 1267 bytes --]

On Saturday 24 March 2012 06:55:28 Hans-Peter Nilsson wrote:
> This patch was missing the critical include of cconfig.h so you
> should still have seen warnings about implicit declarations of
> strsignal when testing.

as i mentioned earlier, there are no warnings for me because my glibc conforms 
to the 2008 POSIX spec

> I built and and started testing for bfin-elf+unix but got a lot
> of assembly errors for values out-of-range (HEAD binutils,
> perhaps the assembler isn't tested on a 32-bit host?)

should work, but i'll build it up to see

> assembly-code tests and also apparently a compiler is not
> optional as for cris-sim, but required, causing spurious errors.

if i knew how to make it optional, i would have them auto-skipped ;)

> FWIW, all sim tests fail linking for cr16-elf+cr16-sim, maybe my
> locally added baseboard is out of date.

http://sourceware.org/bugzilla/show_bug.cgi?id=12385

> --- nrun.c	24 Mar 2012 05:38:35 -0000	1.17
> +++ nrun.c	24 Mar 2012 09:31:09 -0000	1.18
> 
> +/* Need to be before general includes, to pick up e.g. _GNU_SOURCE.  */
> +#ifdef HAVE_CONFIG_H
> +#include "cconfig.h"
> +#include "tconfig.h"
> +#endif

the cconfig.h makes sense, but i don't think the tconfig.h does
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Finalizing fix committed for "[PATCH] sim: make sure to include strsignal prototype"
  2012-03-24 18:24     ` Mike Frysinger
@ 2012-03-24 20:55       ` Hans-Peter Nilsson
  2012-03-25  8:14         ` Mike Frysinger
  2012-03-25  7:40       ` Mike Frysinger
  1 sibling, 1 reply; 21+ messages in thread
From: Hans-Peter Nilsson @ 2012-03-24 20:55 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

On Sat, 24 Mar 2012, Mike Frysinger wrote:

> On Saturday 24 March 2012 06:55:28 Hans-Peter Nilsson wrote:
> > This patch was missing the critical include of cconfig.h so you
> > should still have seen warnings about implicit declarations of
> > strsignal when testing.
>
> as i mentioned earlier, there are no warnings for me because my glibc conforms
> to the 2008 POSIX spec

I saw that, but that didn't apply: the include of string.h in
nrun.c after your patch was guarded by a macro that wasn't
defined, with no other include of string.h *when compiling
nrun.c for the CRIS sim* to which you were alerted.  Right, you
found there was another via sim-main.h or something for the MIPS
compilation, so just recompiling that wouldn't test anything.
Without describing how the patch was tested I assumed you did
so for cris-elf.  When compiling with a new enough glibc for
string.h-without-_GNU_SOURCE, but gcc that I think is older than
what you used (4.3.0, JFTR re the warnings) I got in my
build-log:
/home/hp/sim/src/sim/cris/../common/nrun.c: In function 'main':
/home/hp/sim/src/sim/cris/../common/nrun.c:216: warning: implicit declaration of function 'strsignal'
/home/hp/sim/src/sim/cris/../common/nrun.c:216: warning: format '%s' expects type 'char *', but argument 4 has type 'int'

> > assembly-code tests and also apparently a compiler is not
> > optional as for cris-sim, but required, causing spurious errors.
>
> if i knew how to make it optional, i would have them auto-skipped ;)

See top of sim/testsuite/sim/cris/c/c.exp.  Care taken to still
iterate over the C test-cases so the "untested" count gets right.

> > FWIW, all sim tests fail linking for cr16-elf+cr16-sim, maybe my
> > locally added baseboard is out of date.
>
> http://sourceware.org/bugzilla/show_bug.cgi?id=12385

That's what I saw, good.

> > --- nrun.c	24 Mar 2012 05:38:35 -0000	1.17
> > +++ nrun.c	24 Mar 2012 09:31:09 -0000	1.18
> >
> > +/* Need to be before general includes, to pick up e.g. _GNU_SOURCE.  */
> > +#ifdef HAVE_CONFIG_H
> > +#include "cconfig.h"
> > +#include "tconfig.h"
> > +#endif
>
> the cconfig.h makes sense, but i don't think the tconfig.h does

This is just a copy of the construct from run.c after checking
that there indeed was a tconfig.h generated; a symlink.  Never
looked into the why of it, feel free investigate whether it's
old cruft used nowhere.

brgds, H-P
PS. thanks for the ld report!


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Finalizing fix committed for "[PATCH] sim: make sure to include strsignal prototype"
  2012-03-24 18:24     ` Mike Frysinger
  2012-03-24 20:55       ` Hans-Peter Nilsson
@ 2012-03-25  7:40       ` Mike Frysinger
  2012-03-25  7:54         ` Mike Frysinger
  1 sibling, 1 reply; 21+ messages in thread
From: Mike Frysinger @ 2012-03-25  7:40 UTC (permalink / raw)
  To: gdb-patches; +Cc: Hans-Peter Nilsson

[-- Attachment #1: Type: Text/Plain, Size: 1635 bytes --]

On Saturday 24 March 2012 14:24:14 Mike Frysinger wrote:
> On Saturday 24 March 2012 06:55:28 Hans-Peter Nilsson wrote:
> > I built and and started testing for bfin-elf+unix but got a lot
> > of assembly errors for values out-of-range (HEAD binutils,
> > perhaps the assembler isn't tested on a 32-bit host?)
> 
> should work, but i'll build it up to see

for most tests, it was just old code with too many leading digits (which 
didn't matter as we only cared about the truncated value which got tested).  i 
manually tweaked the tests to use 32bit values only.

there is one test (fact.s) which is arguably not a bug in the test as the 
source code specifies the real answer (which is larger than 32bits).  as the 
test runs and things start to overflow, this is fine as only the high bits get 
truncated away.  so we compare the truncated right answer to the truncated 
computed answer and are good to go.

at any rate, seems to be a bug in common code that only shows up if you are on 
a 32bit system and don't specify --enable-64-bit-bfd.  simple test case which 
hits the same problem regardless of target:
$ cat test.s
.if 6227020800 & ~0x7fff
.endif
$ ./as-new test.s 
test.s: Assembler messages:
test.s:1: Warning: left operand is a bignum; integer 0 assumed

the BFD64 logic in gas' expr.c is fairly light.  i'm not even sure it makes 
sense to key off of BFD64 since this code doesn't use bfd for number 
processing.  it's just deciding whether to automatically upgrade bignum's into 
int64's.  i'll post a patch to just delete the BFD64 logic there and see what 
people have to say.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Finalizing fix committed for "[PATCH] sim: make sure to include strsignal prototype"
  2012-03-25  7:40       ` Mike Frysinger
@ 2012-03-25  7:54         ` Mike Frysinger
  2012-03-25 14:26           ` Hans-Peter Nilsson
  0 siblings, 1 reply; 21+ messages in thread
From: Mike Frysinger @ 2012-03-25  7:54 UTC (permalink / raw)
  To: gdb-patches; +Cc: Hans-Peter Nilsson

[-- Attachment #1: Type: Text/Plain, Size: 799 bytes --]

On Sunday 25 March 2012 03:40:20 Mike Frysinger wrote:
> the BFD64 logic in gas' expr.c is fairly light.  i'm not even sure it makes
> sense to key off of BFD64 since this code doesn't use bfd for number
> processing.  it's just deciding whether to automatically upgrade bignum's
> into int64's.  i'll post a patch to just delete the BFD64 logic there and
> see what people have to say.

ok, digging a bit more, that isn't going to work.  the gas parsing logic is 
tied too closely to the bfd_vma type which is directly tied to the 
aforementioned configure flag.

since the fact.s test already tests both values (full & truncated), and in 
reality the compiled code is the same for both (since gas does the 
truncation), i've commented out the test that is larger than 32bits.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Finalizing fix committed for "[PATCH] sim: make sure to include strsignal prototype"
  2012-03-24 20:55       ` Hans-Peter Nilsson
@ 2012-03-25  8:14         ` Mike Frysinger
  2012-03-25 14:03           ` Hans-Peter Nilsson
  0 siblings, 1 reply; 21+ messages in thread
From: Mike Frysinger @ 2012-03-25  8:14 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: gdb-patches

[-- Attachment #1: Type: Text/Plain, Size: 2148 bytes --]

On Saturday 24 March 2012 16:54:50 Hans-Peter Nilsson wrote:
> On Sat, 24 Mar 2012, Mike Frysinger wrote:
> > On Saturday 24 March 2012 06:55:28 Hans-Peter Nilsson wrote:
> > > This patch was missing the critical include of cconfig.h so you
> > > should still have seen warnings about implicit declarations of
> > > strsignal when testing.
> > 
> > as i mentioned earlier, there are no warnings for me because my glibc
> > conforms to the 2008 POSIX spec
> 
> I saw that, but that didn't apply

yes, it did.  because as i also explained previously, string.h is getting 
implicitly included by other files.  i never saw a warning related to this, nor 
crashes in the sim, and i still didn't after my change regardless of the 
config.h includes.  quoting behavior that *you* see on your outdated glibc has 
really no bearing whatsoever on my build system.

> > > assembly-code tests and also apparently a compiler is not
> > > optional as for cris-sim, but required, causing spurious errors.
> > 
> > if i knew how to make it optional, i would have them auto-skipped ;)
> 
> See top of sim/testsuite/sim/cris/c/c.exp.  Care taken to still
> iterate over the C test-cases so the "untested" count gets right.

i'll take a look, thanks

> > > --- nrun.c	24 Mar 2012 05:38:35 -0000	1.17
> > > +++ nrun.c	24 Mar 2012 09:31:09 -0000	1.18
> > > 
> > > +/* Need to be before general includes, to pick up e.g. _GNU_SOURCE. 
> > > */ +#ifdef HAVE_CONFIG_H
> > > +#include "cconfig.h"
> > > +#include "tconfig.h"
> > > +#endif
> > 
> > the cconfig.h makes sense, but i don't think the tconfig.h does
> 
> This is just a copy of the construct from run.c after checking
> that there indeed was a tconfig.h generated; a symlink.  Never
> looked into the why of it, feel free investigate whether it's
> old cruft used nowhere.

the tconfig.h isn't really cruft, just not related to what autoheader outputs.  
it's target specific knobs for sim internals which shouldn't apply to the 
nrun.c interface.  clean up would be good, but i'll leave nrun.c alone atm 
since it matches what run.c is doing as you said.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Finalizing fix committed for "[PATCH] sim: make sure to include strsignal prototype"
  2012-03-25  8:14         ` Mike Frysinger
@ 2012-03-25 14:03           ` Hans-Peter Nilsson
  0 siblings, 0 replies; 21+ messages in thread
From: Hans-Peter Nilsson @ 2012-03-25 14:03 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

On Sun, 25 Mar 2012, Mike Frysinger wrote:
> On Saturday 24 March 2012 16:54:50 Hans-Peter Nilsson wrote:
> > On Sat, 24 Mar 2012, Mike Frysinger wrote:
> > > On Saturday 24 March 2012 06:55:28 Hans-Peter Nilsson wrote:
> > > > This patch was missing the critical include of cconfig.h so you
> > > > should still have seen warnings about implicit declarations of
> > > > strsignal when testing.
> > >
> > > as i mentioned earlier, there are no warnings for me because my glibc
> > > conforms to the 2008 POSIX spec
> >
> > I saw that, but that didn't apply
>
> yes, it did.  because as i also explained previously, string.h is getting
> implicitly included by other files.

FWIW: not so on *this* non-outdated system, a system different
from my autotester which broke.  You qualified your observation
as for mips-elf only; "the mips' sim-main.h code eventually
includes string.h for me".  Hm, I see the identical warnings
output for mips-elf as for cris-elf here.

>  i never saw a warning related to this, nor
> crashes in the sim, and i still didn't after my change regardless of the
> config.h includes.  quoting behavior that *you* see on your outdated glibc has
> really no bearing whatsoever on my build system.

The lastest quote was from a different system, one with a glibc
that didn't need _GNU_SOURCE defined for strerror when including
string.h.  But apparently one where string.h also isn't included
elsewhere for neither mips-elf nor cris-elf, still different
from yours.

JFTR.  Moving on.

brgds, H-P


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Finalizing fix committed for "[PATCH] sim: make sure to include strsignal prototype"
  2012-03-25  7:54         ` Mike Frysinger
@ 2012-03-25 14:26           ` Hans-Peter Nilsson
  0 siblings, 0 replies; 21+ messages in thread
From: Hans-Peter Nilsson @ 2012-03-25 14:26 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

On Sun, 25 Mar 2012, Mike Frysinger wrote:
> On Sunday 25 March 2012 03:40:20 Mike Frysinger wrote:
> > the BFD64 logic in gas' expr.c is fairly light.  i'm not even sure it makes
> > sense to key off of BFD64 since this code doesn't use bfd for number
> > processing.  it's just deciding whether to automatically upgrade bignum's
> > into int64's.  i'll post a patch to just delete the BFD64 logic there and
> > see what people have to say.
>
> ok, digging a bit more, that isn't going to work.  the gas parsing logic is
> tied too closely to the bfd_vma type which is directly tied to the
> aforementioned configure flag.
>
> since the fact.s test already tests both values (full & truncated), and in
> reality the compiled code is the same for both (since gas does the
> truncation), i've commented out the test that is larger than 32bits.

For cris-elf there's a gas test I added (a loong time ago,
before 1.1) that I never pursued, one with IIRC a temporarily
overflowing expression; one of the temporaries truncated on
32-bit-bfd.  I xfailed the test (gas/cris/shexpr-1) which makes
it xpass on 64-bit-bfd. :/  Mea culpa.  Maybe the same bug maybe
slightly different, but the same 32-vs-64-bit-bfd basic reason.

It'd be nice to have gas PR's for whatever you can blame on gas
from the bfin sim tests.

brgds, H-P


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2012-03-25 14:26 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-23  4:23 [PATCH] sim: make sure to include strsignal prototype Mike Frysinger
2012-03-23  4:35 ` Mike Frysinger
2012-03-23  5:24 ` Hans-Peter Nilsson
2012-03-23 15:43   ` Mike Frysinger
2012-03-23 22:12     ` Hans-Peter Nilsson
2012-03-23 22:43       ` Mike Frysinger
2012-03-24  5:34     ` Mike Frysinger
2012-03-24  4:12   ` Mike Frysinger
2012-03-24  5:53     ` Hans-Peter Nilsson
2012-03-24  6:12       ` Mike Frysinger
2012-03-24  6:49         ` Hans-Peter Nilsson
2012-03-24 18:18           ` Mike Frysinger
2012-03-24 10:55   ` Finalizing fix committed for "[PATCH] sim: make sure to include strsignal prototype" Hans-Peter Nilsson
2012-03-24 18:24     ` Mike Frysinger
2012-03-24 20:55       ` Hans-Peter Nilsson
2012-03-25  8:14         ` Mike Frysinger
2012-03-25 14:03           ` Hans-Peter Nilsson
2012-03-25  7:40       ` Mike Frysinger
2012-03-25  7:54         ` Mike Frysinger
2012-03-25 14:26           ` Hans-Peter Nilsson
2012-03-24  5:39 ` [PATCH] sim: make sure to include strsignal prototype Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox