Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gnulib dependency in gdbserver
@ 2008-06-25 19:16 Joel Brobecker
  2008-06-25 19:23 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2008-06-25 19:16 UTC (permalink / raw)
  To: gdb

I just realized that gdbserver now depends on ../gnulib.  The problem
is ../gnulib has been configured by and for gdb, not gdbserver. So
if one wants to just build gdbserver, or if the host/target configuration
for gdb and gdbserver are different, then things may not work.

In my particular case, I'm working on a GDB hosted on Solaris cross
ppc-lynxos, and then cross-build gdbserver to run on ppc-lynxos.
I get an error because the stdint.h file doesn't work (SIZE_MAX
is missing).

I don't see any other way but making an additional copy of gnulib
inside gdbserver. I really hate the idea; even though it seems that
this is the way that the project was designed to be used, it means
that we have to be careful to update two copies if a file is
duplicated twice...

Any suggestion?

Thanks,
-- 
Joel


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

* Re: gnulib dependency in gdbserver
  2008-06-25 19:16 gnulib dependency in gdbserver Joel Brobecker
@ 2008-06-25 19:23 ` Daniel Jacobowitz
  2008-06-25 21:14   ` Joel Brobecker
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2008-06-25 19:23 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb

On Wed, Jun 25, 2008 at 03:16:21PM -0400, Joel Brobecker wrote:
> I just realized that gdbserver now depends on ../gnulib.  The problem
> is ../gnulib has been configured by and for gdb, not gdbserver. So
> if one wants to just build gdbserver, or if the host/target configuration
> for gdb and gdbserver are different, then things may not work.
> 
> In my particular case, I'm working on a GDB hosted on Solaris cross
> ppc-lynxos, and then cross-build gdbserver to run on ppc-lynxos.
> I get an error because the stdint.h file doesn't work (SIZE_MAX
> is missing).

How are you configuring?  It sounds like you're trying to share an
object directory (same as srcdir?) for configured gdb and gdbserver;
instead, if you build them both in separate object directories, things
will just work out.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: gnulib dependency in gdbserver
  2008-06-25 19:23 ` Daniel Jacobowitz
@ 2008-06-25 21:14   ` Joel Brobecker
  2008-06-25 21:58     ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2008-06-25 21:14 UTC (permalink / raw)
  To: gdb

> How are you configuring?  It sounds like you're trying to share an
> object directory (same as srcdir?) for configured gdb and gdbserver;

Actually, I was configuring from separate trees.

> instead, if you build them both in separate object directories, things
> will just work out.

I think I can see why things should work for most things (things such
as the generation of the reg-*.c files for instance), but I can't
figure out things should work for gnulib.

I found the pieces that tell configure to check for memmem and use
the one in memmem if the later is not found, but I haven't found
the bits that would configure gnulib. In particular, configuring
gnulib would allow me to get stdlib.h. Should the files generated
by the gnulib configure be stored in the gdbserver directory, btw?

Just as an aside, I noticed the following two rules which look
suspicious:

signals.o: ../signals/signals.c $(server_h)
        $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER

memmem.o: ../gnulib/memmem.c
        $(CC) -o memmem.o -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<

Should the ../[...] be relative to $(srcdir)? Surprisingly, it
seems to work, but I don't understand why...

-- 
Joel


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

* Re: gnulib dependency in gdbserver
  2008-06-25 21:14   ` Joel Brobecker
@ 2008-06-25 21:58     ` Daniel Jacobowitz
  2008-06-25 22:15       ` Joel Brobecker
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2008-06-25 21:58 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb

On Wed, Jun 25, 2008 at 05:13:42PM -0400, Joel Brobecker wrote:
> > instead, if you build them both in separate object directories, things
> > will just work out.
> 
> I think I can see why things should work for most things (things such
> as the generation of the reg-*.c files for instance), but I can't
> figure out things should work for gnulib.

I think I'm beginning to understand your problem.  Did you say
something about LynxOS?  Have you got a local gdbserver port to
a target in which this rule:

>         $(CC) -o memmem.o -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<

is not sufficient?

The only targets in tree are Linux and Windows.  On Windows, the
supplied memmem compiles fine with system headers.  On Linux, it is
skipped.  If LynxOS is not sufficient, then as part of the port you'll
need a better solution to this.

I tried to configure gnulib from $(srcdir)/../gnulib into
$(objdir)/gnulib but couldn't get it to work.  Might be worth another
shot.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: gnulib dependency in gdbserver
  2008-06-25 21:58     ` Daniel Jacobowitz
@ 2008-06-25 22:15       ` Joel Brobecker
  2008-06-25 23:09         ` Joel Brobecker
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2008-06-25 22:15 UTC (permalink / raw)
  To: gdb

> I think I'm beginning to understand your problem.  Did you say
> something about LynxOS?  Have you got a local gdbserver port to
> a target

I have a local LynxOS port that was roughly adapted from LynxOS sources.
I'm actually working on getting permission to submit this code for
inclusion, although I suspect it might not be up to standards. It's pretty
much my first time with the gdbserver, and I'm still learning, so I
just hacked the code out of their sources into HEAD.

> in which this rule:
> 
> >         $(CC) -o memmem.o -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
> 
> is not sufficient?

I thought so because memmem.c uses SIZE_MAX. However, I now realized
that I greped in the wrong directory, and now that I grep again in
the right one, the system stdint.h does seem to provide this macro.
So it looks like an issue with the way I setup the build or maybe
the compiler (we've had some issues of this sort a while ago).
Let me dig in a little more.

Thanks much for the feedback - I was so focused on trying to understand
why gnulib wasn't configured that I missed the obvious.

-- 
Joel


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

* Re: gnulib dependency in gdbserver
  2008-06-25 22:15       ` Joel Brobecker
@ 2008-06-25 23:09         ` Joel Brobecker
  2008-06-26  2:09           ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2008-06-25 23:09 UTC (permalink / raw)
  To: gdb

> I thought so because memmem.c uses SIZE_MAX. However, I now realized
> that I greped in the wrong directory, and now that I grep again in
> the right one, the system stdint.h does seem to provide this macro.
> So it looks like an issue with the way I setup the build or maybe
> the compiler (we've had some issues of this sort a while ago).
> Let me dig in a little more.

Problem solved - the macro definitions are protected by "#if defined
(__STDC_LIMIT_MACROS)", which is not defined by default. Defining
this macro allowed me to build memmem.c, and after fixing another
issue related to init_registers () being "multi-arched", I finally
got an executable.

For my penance, if you think that we could document the contents
of our discussion somewhere, just let me know, and I'll be happy
to do that as my way of thanks. Perhaps in the README file? This
file contains instructions, though, so I'm a little hesitant to
dilute its contents with information that may not be relevant
to the user that just wants to be gdbserver...

-- 
Joel


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

* Re: gnulib dependency in gdbserver
  2008-06-25 23:09         ` Joel Brobecker
@ 2008-06-26  2:09           ` Daniel Jacobowitz
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2008-06-26  2:09 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb

On Wed, Jun 25, 2008 at 07:08:43PM -0400, Joel Brobecker wrote:
> For my penance, if you think that we could document the contents
> of our discussion somewhere, just let me know, and I'll be happy
> to do that as my way of thanks. Perhaps in the README file? This
> file contains instructions, though, so I'm a little hesitant to
> dilute its contents with information that may not be relevant
> to the user that just wants to be gdbserver...

Usual answer - somewhere in gdbint if you can find or invent a
section :-)  Not sure if it goes with 'use of gnulib' or 'source
directory layout' or 'gdbserver' (all made up).

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2008-06-26  2:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-25 19:16 gnulib dependency in gdbserver Joel Brobecker
2008-06-25 19:23 ` Daniel Jacobowitz
2008-06-25 21:14   ` Joel Brobecker
2008-06-25 21:58     ` Daniel Jacobowitz
2008-06-25 22:15       ` Joel Brobecker
2008-06-25 23:09         ` Joel Brobecker
2008-06-26  2:09           ` Daniel Jacobowitz

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