public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* RE: Problem building 5.2 for m68k-elf on Solaris
@ 2002-06-10 14:02 Rude, Randy [Cont]
  2002-06-26 20:38 ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Rude, Randy [Cont] @ 2002-06-10 14:02 UTC (permalink / raw)
  To: gdb

> Has anyone else seen this?
> 
> $ ../gdb-5.2/config.guess
> sparc-sun-solaris2.8
> 
> $ ../gdb-5.2/configure --target=m68k-elf
> [snip]
> 
> $ make
> [snip]
> gcc -c -g -O2  -I/usr/include/v9  -I. -I../../gdb-5.2/gdb
> -I../../gdb-5.2/gdb/config -DHAVE_CONFIG_H
> -I../../gdb-5.2/gdb/../include/opcode 
> -I../../gdb-5.2/gdb/../readline/..
> -I../bfd -I../../gdb-5.2/gdb/../bfd  -I../../gdb-5.2/gdb/../include
> -I../intl -I../../gdb-5.2/gdb/../intl  -DMI_OUT=1 -DUI_OUT=1 
> -Wimplicit
> -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses 
> -Wpointer-arith
> -Wuninitialized  ../../gdb-5.2/gdb/ser-unix.c
> In file included from /usr/include/netinet/in.h:41,
>                  from /usr/include/sys/socket.h:200,
>                  from ../../gdb-5.2/gdb/ser-unix.c:29:
> /usr/include/sys/stream.h:327: redefinition of `struct bcache'
> gmake[1]: *** [ser-unix.o] Error 1
> 
> Randy
> 

This is a namespace conflict.  The Solaris stream.h defines struct bcache
which is also defined by GDB in bcache.h; the latter is being included
unnecessarily in the files ser-unix.c, ser-pipe.c, and ser-tcp.c.

I was able to get the m68k-elf target to build by adding:

#define BCACHE_H 1

at the top of each of these files.  Not that I'd submit that as a patch ;-)
but this allows me to build native Solaris and m68k-elf targets.

Hopefully someone more familiar with the code can come up with a more
elegant solution?

	Randy

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

* Re: Problem building 5.2 for m68k-elf on Solaris
  2002-06-10 14:02 Problem building 5.2 for m68k-elf on Solaris Rude, Randy [Cont]
@ 2002-06-26 20:38 ` Andrew Cagney
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Cagney @ 2002-06-26 20:38 UTC (permalink / raw)
  To: Rude, Randy [Cont]; +Cc: gdb

> $ ../gdb-5.2/configure --target=m68k-elf
>> [snip]
>> 
>> $ make
>> [snip]
>> gcc -c -g -O2  -I/usr/include/v9  -I. -I../../gdb-5.2/gdb
>> -I../../gdb-5.2/gdb/config -DHAVE_CONFIG_H
>> -I../../gdb-5.2/gdb/../include/opcode 
>> -I../../gdb-5.2/gdb/../readline/..
>> -I../bfd -I../../gdb-5.2/gdb/../bfd  -I../../gdb-5.2/gdb/../include
>> -I../intl -I../../gdb-5.2/gdb/../intl  -DMI_OUT=1 -DUI_OUT=1 
>> -Wimplicit
>> -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses 
>> -Wpointer-arith
>> -Wuninitialized  ../../gdb-5.2/gdb/ser-unix.c
>> In file included from /usr/include/netinet/in.h:41,
>>                  from /usr/include/sys/socket.h:200,
>>                  from ../../gdb-5.2/gdb/ser-unix.c:29:
>> /usr/include/sys/stream.h:327: redefinition of `struct bcache'
>> gmake[1]: *** [ser-unix.o] Error 1
>> 
>> Randy
>> 
> 
> 
> This is a namespace conflict.  The Solaris stream.h defines struct bcache
> which is also defined by GDB in bcache.h; the latter is being included
> unnecessarily in the files ser-unix.c, ser-pipe.c, and ser-tcp.c.
> 
> I was able to get the m68k-elf target to build by adding:
> 
> #define BCACHE_H 1
> 
> at the top of each of these files.  Not that I'd submit that as a patch ;-)
> but this allows me to build native Solaris and m68k-elf targets.
> 
> Hopefully someone more familiar with the code can come up with a more
> elegant solution?

Would you be able to determine/explain exactly how "bcache.h" came to be 
included?  Looking at ser-*.c, nothing obvious jumped out.

Andrew


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

* Re: Problem building 5.2 for m68k-elf on Solaris
  2002-06-27 14:56 Rude, Randy [Cont]
@ 2002-06-28 14:04 ` Andrew Cagney
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Cagney @ 2002-06-28 14:04 UTC (permalink / raw)
  To: Rude, Randy [Cont]; +Cc: gdb

> Can you try moving the #include "bcache.h" from symtab.h to 
>> objfiles.h?
> 
> 
> That fixes it.  Thanks Andrew!

Ok, thanks, I'll pull something into 5.2 branch.

Andrew




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

* RE: Problem building 5.2 for m68k-elf on Solaris
@ 2002-06-28  8:49 Rude, Randy [Cont]
  0 siblings, 0 replies; 8+ messages in thread
From: Rude, Randy [Cont] @ 2002-06-28  8:49 UTC (permalink / raw)
  To: ''Andrew Cagney' '; +Cc: 'gdb@sources.redhat.com '

> > 
> > Can you try moving the #include "bcache.h" from symtab.h to 
> > objfiles.h?
> 
> That fixes it.  Thanks Andrew!
> 
>  Randy
> 
>  <<bcache.patch>> 

I forgot to mention that I tested this patch for both a native Solaris 2.8 
build and a Solaris -> m68k-elf cross build.  The patch was applied against
the stock 5.2 release.

	Randy

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

* RE: Problem building 5.2 for m68k-elf on Solaris
@ 2002-06-27 14:56 Rude, Randy [Cont]
  2002-06-28 14:04 ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Rude, Randy [Cont] @ 2002-06-27 14:56 UTC (permalink / raw)
  To: 'Andrew Cagney'; +Cc: gdb

[-- Attachment #1: Type: text/plain, Size: 122 bytes --]

> 
> Can you try moving the #include "bcache.h" from symtab.h to 
> objfiles.h?

That fixes it.  Thanks Andrew!

	Randy



[-- Attachment #2: bcache.patch --]
[-- Type: application/octet-stream, Size: 947 bytes --]

diff -Nwupr gdb-5.2-orig/gdb/objfiles.h gdb-5.2/gdb/objfiles.h
--- gdb-5.2-orig/gdb/objfiles.h	Fri Oct 12 13:07:07 2001
+++ gdb-5.2/gdb/objfiles.h	Thu Jun 27 14:34:53 2002
@@ -22,6 +22,8 @@
 #if !defined (OBJFILES_H)
 #define OBJFILES_H
 
+#include "bcache.h"
+
 /* This structure maintains information on a per-objfile basis about the
    "entry point" of the objfile, and the scope within which the entry point
    exists.  It is possible that gdb will see more than one objfile that is
diff -Nwupr gdb-5.2-orig/gdb/symtab.h gdb-5.2/gdb/symtab.h
--- gdb-5.2-orig/gdb/symtab.h	Thu Feb 21 17:17:13 2002
+++ gdb-5.2/gdb/symtab.h	Thu Jun 27 15:01:49 2002
@@ -28,7 +28,6 @@
 #include "obstack.h"
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free xfree
-#include "bcache.h"
 
 /* Don't do this; it means that if some .o's are compiled with GNU C
    and some are not (easy to do accidentally the way we configure

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

* Re: Problem building 5.2 for m68k-elf on Solaris
  2002-06-27 10:48 Rude, Randy [Cont]
@ 2002-06-27 12:04 ` Andrew Cagney
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Cagney @ 2002-06-27 12:04 UTC (permalink / raw)
  To: Rude, Randy [Cont]; +Cc: gdb

> 
> bcache.h is:
>         included from ../../work/gdb/symtab.h:31,
>                  from ../../work/gdb/value.h:270,
>                  from ../../work/gdb/gdbarch.h:41,
>                  from ../../work/gdb/defs.h:1035,
>                  from ../../work/gdb/ser-unix.c:22:
> 
> Hope that helps.

Yes it does!

symtab.h: does but shouldn't
objfiles.h: doesn't but should (but really shouldn't need to)
macrotab.h: does but shouldn't

Can you try moving the #include "bcache.h" from symtab.h to objfiles.h?

Andrew


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

* RE: Problem building 5.2 for m68k-elf on Solaris
@ 2002-06-27 10:48 Rude, Randy [Cont]
  2002-06-27 12:04 ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Rude, Randy [Cont] @ 2002-06-27 10:48 UTC (permalink / raw)
  To: 'Andrew Cagney'; +Cc: gdb

> > $ ../gdb-5.2/configure --target=m68k-elf
> >> [snip]
> >> 
> >> $ make
> >> [snip]
> >> gcc -c -g -O2  -I/usr/include/v9  -I. -I../../gdb-5.2/gdb
> >> -I../../gdb-5.2/gdb/config -DHAVE_CONFIG_H
> >> -I../../gdb-5.2/gdb/../include/opcode 
> >> -I../../gdb-5.2/gdb/../readline/..
> >> -I../bfd -I../../gdb-5.2/gdb/../bfd  -I../../gdb-5.2/gdb/../include
> >> -I../intl -I../../gdb-5.2/gdb/../intl  -DMI_OUT=1 -DUI_OUT=1 
> >> -Wimplicit
> >> -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses 
> >> -Wpointer-arith
> >> -Wuninitialized  ../../gdb-5.2/gdb/ser-unix.c
> >> In file included from /usr/include/netinet/in.h:41,
> >>                  from /usr/include/sys/socket.h:200,
> >>                  from ../../gdb-5.2/gdb/ser-unix.c:29:
> >> /usr/include/sys/stream.h:327: redefinition of `struct bcache'
> >> gmake[1]: *** [ser-unix.o] Error 1
> >> 
> >> Randy
> >> 
> > 
> > 
> > This is a namespace conflict.  The Solaris stream.h defines 
> struct bcache
> > which is also defined by GDB in bcache.h; the latter is 
> being included
> > unnecessarily in the files ser-unix.c, ser-pipe.c, and ser-tcp.c.
> > 
> > I was able to get the m68k-elf target to build by adding:
> > 
> > #define BCACHE_H 1
> > 
> > at the top of each of these files.  Not that I'd submit 
> that as a patch ;-)
> > but this allows me to build native Solaris and m68k-elf targets.
> > 
> > Hopefully someone more familiar with the code can come up 
> with a more
> > elegant solution?
> 
> Would you be able to determine/explain exactly how "bcache.h" 
> came to be 
> included?  Looking at ser-*.c, nothing obvious jumped out.
> 

bcache.h is:
        included from ../../work/gdb/symtab.h:31,
                 from ../../work/gdb/value.h:270,
                 from ../../work/gdb/gdbarch.h:41,
                 from ../../work/gdb/defs.h:1035,
                 from ../../work/gdb/ser-unix.c:22:

Hope that helps.

	Randy

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

* Problem building 5.2 for m68k-elf on Solaris
@ 2002-06-10 10:13 Rude, Randy [Cont]
  0 siblings, 0 replies; 8+ messages in thread
From: Rude, Randy [Cont] @ 2002-06-10 10:13 UTC (permalink / raw)
  To: gdb

Has anyone else seen this?

$ ../gdb-5.2/config.guess
sparc-sun-solaris2.8

$ ../gdb-5.2/configure --target=m68k-elf
[snip]

$ make
[snip]
gcc -c -g -O2  -I/usr/include/v9  -I. -I../../gdb-5.2/gdb
-I../../gdb-5.2/gdb/config -DHAVE_CONFIG_H
-I../../gdb-5.2/gdb/../include/opcode -I../../gdb-5.2/gdb/../readline/..
-I../bfd -I../../gdb-5.2/gdb/../bfd  -I../../gdb-5.2/gdb/../include
-I../intl -I../../gdb-5.2/gdb/../intl  -DMI_OUT=1 -DUI_OUT=1 -Wimplicit
-Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith
-Wuninitialized  ../../gdb-5.2/gdb/ser-unix.c
In file included from /usr/include/netinet/in.h:41,
                 from /usr/include/sys/socket.h:200,
                 from ../../gdb-5.2/gdb/ser-unix.c:29:
/usr/include/sys/stream.h:327: redefinition of `struct bcache'
gmake[1]: *** [ser-unix.o] Error 1

Randy

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

end of thread, other threads:[~2002-06-28 21:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-10 14:02 Problem building 5.2 for m68k-elf on Solaris Rude, Randy [Cont]
2002-06-26 20:38 ` Andrew Cagney
  -- strict thread matches above, loose matches on Subject: below --
2002-06-28  8:49 Rude, Randy [Cont]
2002-06-27 14:56 Rude, Randy [Cont]
2002-06-28 14:04 ` Andrew Cagney
2002-06-27 10:48 Rude, Randy [Cont]
2002-06-27 12:04 ` Andrew Cagney
2002-06-10 10:13 Rude, Randy [Cont]

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).