* GDB 6.5 RTEMS patch
@ 2006-07-13 20:41 Joel Sherrill
2006-07-24 20:28 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Joel Sherrill @ 2006-07-13 20:41 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1387 bytes --]
Hi,
Attached is the patch we are using with gdb 6.5 for RTEMS.
It is essentially the same patch we used with 6.4. It
primarily enables the erc32 simulator for sparc-rtems
and makes it compile. There were a couple of minor
Makefile glitches fixed to make packaging with RPM
work for us. It is one patch but touches code in
3 directories with ChangeLogs.
I am not subscribed to this list so please cc me on
any replies.
Thanks.
--Joel Sherrill
ChangeLog for gdb subdirectory
2006-07-13 Joel Sherrill <joel.sherrill@oarcorp.com>
* config/sparc/embedded.mt: New file which enables SPARC simulator.
* configure.tgt (sparc-*-rtems*) Use embedded simulator target.
=====================================================
ChangeLog for sim subdirectory
configure---> Regenerate!!! Not inpatch
2006-07-13 Joel Sherrill <joel.sherrill@oarcorp.com>
* configure.ac (sparc-*-rtems*|sparc-*-elf*) Enable erc32 simulator.
* configure: Regenerated.
* Makefile.in: Pass libdir to subdirectories.
=====================================================
ChangeLog for sim/erc32 subdirectory
2006-07-13 Joel Sherrill <joel.sherrill@oarcorp.com>
* exec.c: Add missing break statements that gcc complains about.
* Makefile.in: Honor DESTDIR override so RTEMS RPM builds OK.
=====================================================
[-- Attachment #2: gdb-6.5-rtems-20060713.diff --]
[-- Type: text/x-patch, Size: 3823 bytes --]
diff -uNr /home/joel/tools-original/gdb-6.5/bfd/sysdep.h gdb-6.5/bfd/sysdep.h
--- /home/joel/tools-original/gdb-6.5/bfd/sysdep.h 2005-05-05 13:51:14.000000000 -0500
+++ gdb-6.5/bfd/sysdep.h 2006-07-13 10:00:00.000000000 -0500
@@ -135,7 +135,7 @@
#endif
#if !HAVE_DECL_STRSTR
-extern char *strstr ();
+/* extern char *strstr (); */
#endif
#ifdef HAVE_FTELLO
diff -uNr /home/joel/tools-original/gdb-6.5/gdb/config/sparc/embedded.mt gdb-6.5/gdb/config/sparc/embedded.mt
--- /home/joel/tools-original/gdb-6.5/gdb/config/sparc/embedded.mt 1969-12-31 18:00:00.000000000 -0600
+++ gdb-6.5/gdb/config/sparc/embedded.mt 2006-07-13 10:00:00.000000000 -0500
@@ -0,0 +1,5 @@
+# Target: SPARC embedded with simulator
+TDEPFILES= sparc-tdep.o
+
+SIM_OBS = remote-sim.o
+SIM = ../sim/erc32/libsim.a
diff -uNr /home/joel/tools-original/gdb-6.5/gdb/configure.tgt gdb-6.5/gdb/configure.tgt
--- /home/joel/tools-original/gdb-6.5/gdb/configure.tgt 2006-04-20 18:18:48.000000000 -0500
+++ gdb-6.5/gdb/configure.tgt 2006-07-13 10:00:00.000000000 -0500
@@ -197,6 +197,7 @@
sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*)
gdb_target=sol2-64
;;
+sparc-*-rtems*) gdb_target=embedded ;;
sparc-*-*) gdb_target=sparc ;;
sparc64-*-*) gdb_target=sparc64 ;;
diff -uNr /home/joel/tools-original/gdb-6.5/sim/configure gdb-6.5/sim/configure
--- /home/joel/tools-original/gdb-6.5/sim/configure 2006-05-05 12:11:19.000000000 -0500
+++ gdb-6.5/sim/configure 2006-07-13 10:00:00.000000000 -0500
@@ -3525,6 +3525,14 @@
testsuite=yes
common=yes
;;
+ sparc-*-rtems*|sparc-*-elf*)
+
+
+subdirs="$subdirs erc32"
+
+ testsuite=yes
+ common=yes
+ ;;
powerpc*-*-* )
diff -uNr /home/joel/tools-original/gdb-6.5/sim/configure.ac gdb-6.5/sim/configure.ac
--- /home/joel/tools-original/gdb-6.5/sim/configure.ac 2006-05-05 12:11:19.000000000 -0500
+++ gdb-6.5/sim/configure.ac 2006-07-13 10:00:00.000000000 -0500
@@ -115,6 +115,11 @@
testsuite=yes
common=yes
;;
+ sparc-*-rtems*|sparc-*-elf*)
+ AC_CONFIG_SUBDIRS(erc32)
+ testsuite=yes
+ common=yes
+ ;;
powerpc*-*-* )
AC_CONFIG_SUBDIRS(ppc)
common=yes
diff -uNr /home/joel/tools-original/gdb-6.5/sim/erc32/exec.c gdb-6.5/sim/erc32/exec.c
--- /home/joel/tools-original/gdb-6.5/sim/erc32/exec.c 2005-03-07 05:09:05.000000000 -0600
+++ gdb-6.5/sim/erc32/exec.c 2006-07-13 10:00:00.000000000 -0500
@@ -1713,7 +1713,7 @@
sregs->fdp[rs2 | 1] = sregs->fs[rs2 & ~1];
sregs->fdp[rs2 & ~1] = sregs->fs[rs2 | 1];
default:
- ;
+ break;
}
#endif
@@ -1886,7 +1886,7 @@
sregs->fs[rd & ~1] = sregs->fdp[rd | 1];
sregs->fs[rd | 1] = sregs->fdp[rd & ~1];
default:
- ;
+ break;
}
#endif
if (sregs->fpstate == FP_EXC_PE) {
diff -uNr /home/joel/tools-original/gdb-6.5/sim/erc32/Makefile.in gdb-6.5/sim/erc32/Makefile.in
--- /home/joel/tools-original/gdb-6.5/sim/erc32/Makefile.in 2000-03-07 09:32:49.000000000 -0600
+++ gdb-6.5/sim/erc32/Makefile.in 2006-07-13 10:00:00.000000000 -0500
@@ -53,7 +53,7 @@
# Copy the files into directories where they will be run.
install-sis: installdirs
n=`echo sis | sed '$(program_transform_name)'`; \
- $(INSTALL_PROGRAM) sis$(EXEEXT) $(bindir)/$$n$(EXEEXT)
+ $(INSTALL_PROGRAM) sis$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
clean-sis:
rm -f sis end end.h
diff -uNr /home/joel/tools-original/gdb-6.5/sim/Makefile.in gdb-6.5/sim/Makefile.in
--- /home/joel/tools-original/gdb-6.5/sim/Makefile.in 2006-05-05 12:11:19.000000000 -0500
+++ gdb-6.5/sim/Makefile.in 2006-07-13 10:00:00.000000000 -0500
@@ -84,6 +84,7 @@
"exec_prefix=$(exec_prefix)" \
"bindir=$(bindir)" \
"mandir=$(mandir)" \
+ "libdir=$(libdir)" \
"against=$(against)" \
"AR=$(AR)" \
"AR_FLAGS=$(AR_FLAGS)" \
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB 6.5 RTEMS patch
2006-07-13 20:41 GDB 6.5 RTEMS patch Joel Sherrill
@ 2006-07-24 20:28 ` Daniel Jacobowitz
2006-07-24 20:40 ` Joel Sherrill
2006-08-14 15:43 ` Joel Sherrill
0 siblings, 2 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2006-07-24 20:28 UTC (permalink / raw)
To: Joel Sherrill; +Cc: gdb-patches
On Thu, Jul 13, 2006 at 03:41:19PM -0500, Joel Sherrill wrote:
> diff -uNr /home/joel/tools-original/gdb-6.5/bfd/sysdep.h gdb-6.5/bfd/sysdep.h
> --- /home/joel/tools-original/gdb-6.5/bfd/sysdep.h 2005-05-05 13:51:14.000000000 -0500
> +++ gdb-6.5/bfd/sysdep.h 2006-07-13 10:00:00.000000000 -0500
> @@ -135,7 +135,7 @@
> #endif
>
> #if !HAVE_DECL_STRSTR
> -extern char *strstr ();
> +/* extern char *strstr (); */
> #endif
>
> #ifdef HAVE_FTELLO
What's this for? Shouldn't be necessary, of course.
> diff -uNr /home/joel/tools-original/gdb-6.5/sim/erc32/exec.c gdb-6.5/sim/erc32/exec.c
> --- /home/joel/tools-original/gdb-6.5/sim/erc32/exec.c 2005-03-07 05:09:05.000000000 -0600
> +++ gdb-6.5/sim/erc32/exec.c 2006-07-13 10:00:00.000000000 -0500
> @@ -1713,7 +1713,7 @@
> sregs->fdp[rs2 | 1] = sregs->fs[rs2 & ~1];
> sregs->fdp[rs2 & ~1] = sregs->fs[rs2 | 1];
> default:
> - ;
> + break;
> }
> #endif
>
> @@ -1886,7 +1886,7 @@
> sregs->fs[rd & ~1] = sregs->fdp[rd | 1];
> sregs->fs[rd | 1] = sregs->fdp[rd & ~1];
> default:
> - ;
> + break;
> }
> #endif
> if (sregs->fpstate == FP_EXC_PE) {
Are you sure these are still needed? I thought that "default: }" was
bad, but "default: ;}" was fine.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB 6.5 RTEMS patch
2006-07-24 20:28 ` Daniel Jacobowitz
@ 2006-07-24 20:40 ` Joel Sherrill
2006-08-08 18:57 ` Daniel Jacobowitz
2006-08-14 15:43 ` Joel Sherrill
1 sibling, 1 reply; 6+ messages in thread
From: Joel Sherrill @ 2006-07-24 20:40 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz wrote:
>On Thu, Jul 13, 2006 at 03:41:19PM -0500, Joel Sherrill wrote:
>
>
>>diff -uNr /home/joel/tools-original/gdb-6.5/bfd/sysdep.h gdb-6.5/bfd/sysdep.h
>>--- /home/joel/tools-original/gdb-6.5/bfd/sysdep.h 2005-05-05 13:51:14.000000000 -0500
>>+++ gdb-6.5/bfd/sysdep.h 2006-07-13 10:00:00.000000000 -0500
>>@@ -135,7 +135,7 @@
>> #endif
>>
>> #if !HAVE_DECL_STRSTR
>>-extern char *strstr ();
>>+/* extern char *strstr (); */
>> #endif
>>
>> #ifdef HAVE_FTELLO
>>
>>
>
>What's this for? Shouldn't be necessary, of course.
>
>
>
Yep. That's looks like junk leftover.
I can tell you what used to be there. :) We build RPMs on RH73 so all
subsequent RH and
Fedora Core versions can use them. There are a lot of gcc versions
installed into /opt
in that environment and some gcc version wouldn't build gdb and failed
at that line for
reasons I could never explain. That is a leftover hack that should be
ignored. I am sorry for \
leaving it in there.
>>diff -uNr /home/joel/tools-original/gdb-6.5/sim/erc32/exec.c gdb-6.5/sim/erc32/exec.c
>>--- /home/joel/tools-original/gdb-6.5/sim/erc32/exec.c 2005-03-07 05:09:05.000000000 -0600
>>+++ gdb-6.5/sim/erc32/exec.c 2006-07-13 10:00:00.000000000 -0500
>>@@ -1713,7 +1713,7 @@
>> sregs->fdp[rs2 | 1] = sregs->fs[rs2 & ~1];
>> sregs->fdp[rs2 & ~1] = sregs->fs[rs2 | 1];
>> default:
>>- ;
>>+ break;
>> }
>> #endif
>>
>>@@ -1886,7 +1886,7 @@
>> sregs->fs[rd & ~1] = sregs->fdp[rd | 1];
>> sregs->fs[rd | 1] = sregs->fdp[rd & ~1];
>> default:
>>- ;
>>+ break;
>> }
>> #endif
>> if (sregs->fpstate == FP_EXC_PE) {
>>
>>
>
>Are you sure these are still needed? I thought that "default: }" was
>bad, but "default: ;}" was fine.
>
>
Checking all the gcc's I have installed, that does seem to be the case.
Adding the
";" let's gcc know default wasn't a label.
But why wouldn't you want an explicit break?
--joel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB 6.5 RTEMS patch
2006-07-24 20:40 ` Joel Sherrill
@ 2006-08-08 18:57 ` Daniel Jacobowitz
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2006-08-08 18:57 UTC (permalink / raw)
To: Joel Sherrill; +Cc: gdb-patches
On Mon, Jul 24, 2006 at 03:40:19PM -0500, Joel Sherrill wrote:
> But why wouldn't you want an explicit break?
*shrug* Doesn't really matter either way.
I checked in this version, with a few cleanups, including a parallel
build fix.
--
Daniel Jacobowitz
CodeSourcery
2006-08-08 Joel Sherrill <joel.sherrill@oarcorp.com>
* config/sparc/embed.mt: New file.
* configure.tgt (sparc-*-rtems*): Use embed.mt.
2006-08-08 Joel Sherrill <joel.sherrill@oarcorp.com>
* configure.ac (sparc-*-rtems*|sparc-*-elf*): Enable erc32 simulator.
* Makefile.in (FLAGS_TO_PASS): Include libdir.
* configure: Regenerated.
2006-08-08 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (func.o, help.o): Correct dependencies.
2006-08-08 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.in (install-sis): Honor DESTDIR.
Index: gdb/configure.tgt
===================================================================
RCS file: /cvs/src/src/gdb/configure.tgt,v
retrieving revision 1.176
diff -u -p -r1.176 configure.tgt
--- gdb/configure.tgt 23 Jul 2006 03:52:15 -0000 1.176
+++ gdb/configure.tgt 8 Aug 2006 18:31:09 -0000
@@ -204,6 +204,7 @@ sparc-*-solaris2.[0-6] | sparc-*-solaris
sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*)
gdb_target=sol2-64
;;
+sparc-*-rtems*) gdb_target=embed ;;
sparc-*-*) gdb_target=sparc ;;
sparc64-*-*) gdb_target=sparc64 ;;
Index: gdb/config/sparc/embed.mt
===================================================================
RCS file: gdb/config/sparc/embed.mt
diff -N gdb/config/sparc/embed.mt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdb/config/sparc/embed.mt 8 Aug 2006 18:31:09 -0000
@@ -0,0 +1,5 @@
+# Target: SPARC embedded with simulator
+TDEPFILES= sparc-tdep.o
+
+SIM_OBS = remote-sim.o
+SIM = ../sim/erc32/libsim.a
Index: sim/Makefile.in
===================================================================
RCS file: /cvs/src/src/sim/Makefile.in,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile.in
--- sim/Makefile.in 5 May 2006 17:11:19 -0000 1.7
+++ sim/Makefile.in 8 Aug 2006 18:31:10 -0000
@@ -84,6 +84,7 @@ FLAGS_TO_PASS = \
"exec_prefix=$(exec_prefix)" \
"bindir=$(bindir)" \
"mandir=$(mandir)" \
+ "libdir=$(libdir)" \
"against=$(against)" \
"AR=$(AR)" \
"AR_FLAGS=$(AR_FLAGS)" \
Index: sim/configure.ac
===================================================================
RCS file: /cvs/src/src/sim/configure.ac,v
retrieving revision 1.9
diff -u -p -r1.9 configure.ac
--- sim/configure.ac 5 May 2006 17:11:19 -0000 1.9
+++ sim/configure.ac 8 Aug 2006 18:31:10 -0000
@@ -115,6 +115,11 @@ if test "${enable_sim}" != no; then
testsuite=yes
common=yes
;;
+ sparc-*-rtems*|sparc-*-elf*)
+ AC_CONFIG_SUBDIRS(erc32)
+ testsuite=yes
+ common=yes
+ ;;
powerpc*-*-* )
AC_CONFIG_SUBDIRS(ppc)
common=yes
Index: sim/erc32/Makefile.in
===================================================================
RCS file: /cvs/src/src/sim/erc32/Makefile.in,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile.in
--- sim/erc32/Makefile.in 7 Mar 2000 15:32:49 -0000 1.2
+++ sim/erc32/Makefile.in 8 Aug 2006 18:31:11 -0000
@@ -53,7 +53,7 @@ end.h: end
# Copy the files into directories where they will be run.
install-sis: installdirs
n=`echo sis | sed '$(program_transform_name)'`; \
- $(INSTALL_PROGRAM) sis$(EXEEXT) $(bindir)/$$n$(EXEEXT)
+ $(INSTALL_PROGRAM) sis$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
clean-sis:
rm -f sis end end.h
@@ -69,7 +69,7 @@ configure:
erc32.o: erc32.c sis.h end.h
exec.o: exec.c sis.h end.h
float.o: float.c sis.h end.h
-func.o: func.c
-help.o: help.c
+func.o: func.c sis.h end.h
+help.o: help.c sis.h end.h
interf.o: interf.c sis.h end.h
sis.o: sis.c sis.h end.h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB 6.5 RTEMS patch
2006-07-24 20:28 ` Daniel Jacobowitz
2006-07-24 20:40 ` Joel Sherrill
@ 2006-08-14 15:43 ` Joel Sherrill
2006-10-09 19:11 ` Daniel Jacobowitz
1 sibling, 1 reply; 6+ messages in thread
From: Joel Sherrill @ 2006-08-14 15:43 UTC (permalink / raw)
To: Daniel Jacobowitz, gdb-patches
Daniel Jacobowitz wrote:
> On Thu, Jul 13, 2006 at 03:41:19PM -0500, Joel Sherrill wrote:
>
>> diff -uNr /home/joel/tools-original/gdb-6.5/bfd/sysdep.h gdb-6.5/bfd/sysdep.h
>> --- /home/joel/tools-original/gdb-6.5/bfd/sysdep.h 2005-05-05 13:51:14.000000000 -0500
>> +++ gdb-6.5/bfd/sysdep.h 2006-07-13 10:00:00.000000000 -0500
>> @@ -135,7 +135,7 @@
>> #endif
>>
>> #if !HAVE_DECL_STRSTR
>> -extern char *strstr ();
>> +/* extern char *strstr (); */
>> #endif
>>
>> #ifdef HAVE_FTELLO
>>
>
> What's this for? Shouldn't be necessary, of course.
>
I just ran into a configuration tripping the need for this again. I am
in a chroot'ed
RH73 environment building RPMs. gcc is from the RPM gcc-2.96-113. Apparently
strstr is a macro on this configuration. When compiling the interp.c
file from some
of the simulators, you get this error.
../../../gdb-6.5/bfd/sysdep.h:138:22: macro "strstr" requires 2
arguments, but only 1 given
I think this is the macro is in /usr/include/bits/string2.h causing this:
/* Find the first occurrence of NEEDLE in HAYSTACK. Newer gcc versions
do this itself. */
#if !defined _HAVE_STRING_ARCH_strstr && !__GNUC_PREREQ (2, 97)
# define strstr(haystack, needle) \
(__extension__ (__builtin_constant_p (needle) && __string2_1bptr_p
(needle) \
? (((__const char *) (needle))[0] == '\0' \
? (char *) (size_t) (haystack) \
: (((__const char *) (needle))[1] == '\0' \
? strchr (haystack, \
((__const char *) (needle))[0]) \
: strstr (haystack, needle))) \
: strstr (haystack, needle)))
#endif
Any thoughts now that I have finally reproduced the odd case that made
me want to comment
that originally. :)
Thanks.
--joel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB 6.5 RTEMS patch
2006-08-14 15:43 ` Joel Sherrill
@ 2006-10-09 19:11 ` Daniel Jacobowitz
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2006-10-09 19:11 UTC (permalink / raw)
To: Joel Sherrill; +Cc: gdb-patches
Sorry about dropping the ball on this again. This was about this
change:
> >> #if !HAVE_DECL_STRSTR
> >>-extern char *strstr ();
> >>+/* extern char *strstr (); */
> >> #endif
On Fri, Aug 11, 2006 at 04:13:20PM -0500, Joel Sherrill wrote:
> I just ran into a configuration tripping the need for this again. I am
> in a chroot'ed
> RH73 environment building RPMs. gcc is from the RPM gcc-2.96-113. Apparently
> strstr is a macro on this configuration. When compiling the interp.c
> file from some
> of the simulators, you get this error.
>
> ../../../gdb-6.5/bfd/sysdep.h:138:22: macro "strstr" requires 2
> arguments, but only 1 given
>
> I think this is the macro is in /usr/include/bits/string2.h causing this:
The macro itself isn't a problem. The problem is that we didn't find
the prototype for the actual function, or the macro, during configure.
I would recommend taking a look at the config.log for the gdb
subdirectory, and searching for the strstr test. There should be a
failed program logged; maybe it's not included some header that it
ought to have.
A guess: does adding ACX_HEADER_STRING to gdb/configure.ac and
regenerating configure help?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-10-09 19:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-13 20:41 GDB 6.5 RTEMS patch Joel Sherrill
2006-07-24 20:28 ` Daniel Jacobowitz
2006-07-24 20:40 ` Joel Sherrill
2006-08-08 18:57 ` Daniel Jacobowitz
2006-08-14 15:43 ` Joel Sherrill
2006-10-09 19:11 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox