This is the mail archive of the
mailing list for the GCC project.
Re: Should we import gnulib under gcc/ or at the top-level like libiberty?
- From: Pedro Alves <palves at redhat dot com>
- To: ayush goel <ayushgoel1610 at gmail dot com>, gcc at gcc dot gnu dot org
- Cc: Manuel LÃpez-IbÃÃez <lopezibanez at gmail dot com>, Joseph Myers <joseph at codesourcery dot com>
- Date: Thu, 23 Jun 2016 12:18:00 +0100
- Subject: Re: Should we import gnulib under gcc/ or at the top-level like libiberty?
- Authentication-results: sourceware.org; auth=none
- References: <etPan dot 576ad632 dot 63dc2d3 dot fa at Ayushs-MacBook-Pro dot local>
On 06/22/2016 07:17 PM, ayush goel wrote:
> Hi, I am working on importing gnulib library inside the gcc tree.
> Should the library be imported in the top level directory along with
> other libraries (like libiberty, libatomic, liboffloadmic etc), or
> should it be imported inside gcc/ like it is done in the binutils-gdb
> tree. There they have a gnulib directory inside gdb/ in the top level
I think that top level is better.
Let me touch a bit on why gdb doesn't put it at top level.
Follow the URL further below for more.
The way gdb's gnulib import is set up nowadays, we have a single
gnulib copy that is used by both gdb and gdbserver (two separate programs).
gdb imports gnulib in a way that makes it a separate library, configured
separately from the programs that use it (gdb and gdbserver), which is
unlike the usual way gnulib is imported, but I think it's the
right thing to do.
gdb doesn't put that gnulib wrapper library at the top level, mainly
just because of history -- we didn't always have that wrapper
library -- and the fact that gdb/gdbserver/ itself is not at top
level either, even though it would be better moved to top level.
See this long email, explaining how the current gdb's gnulib import
is set up:
I suggest gcc reuses the whole of gdb's wrapper library and scripts:
... but put it in the top level instead.
A side effect of putting gnulib in a separately configured directory, is
that you end up with a config.h in the gnulib build directory that needs
to be included by the programs that make use of gnulib. Meaning,
gdb #includes _two_ "config.h" files. See gdb/common/common-defs.h.