This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfa/rfc] Build libcommon.a for gdb and gdbserver


On Friday 28 January 2011 15:04:38, Pedro Alves wrote:
> > 
> > Yao> 4  Building libcommon.a for gdb and gdbserver respectively.
> > 
> > This seems to mean that we must build libcommon twice.  I don't
> > understand that -- what is the benefit, versus having a single library?
> 
> See above.  It's not possible currently.  gdb/common/ includes 
> headers from gdb/ when built for gdb, and headers from gdbserver/
> when built for gdbserver.

... and I should stress that gdbserver must be buildable for a
different target you're building gdb for.  Consider:

- you build gdb for an x86-linux host, --target=arm-linux.
  libcommon.a built for x86.
- you build gdbserver to run on arm-linux (host).  libcommon.a
  built for arm.

hence, you get two libcommon builds, even if we get
rid of all the headers mess.  Only the
native-gdb-that-also-builds-gdbserver special
case would be able to get by with a single build.

libcommon.a could also be split into two distinct
libraries.  One, for common, but native-target independent
stuff: utils, signal, xml, common structures, etc.
Another, for native target backend stuff (think ptrace):
gdbserver/linux-low.c and friends, merged with
gdb/linux-nat.c and friends could go into this other
library.  But to a first approximation, a single
common library is good too.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]