This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH build/doc] Replacing libiberty with gnulib
- From: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- To: ayush goel <ayushgoel1610 at gmail dot com>
- Cc: Pedro Alves <palves at redhat dot com>, Joseph Myers <joseph at codesourcery dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>
- Date: Wed, 10 Aug 2016 15:05:03 +0100
- Subject: Re: [PATCH build/doc] Replacing libiberty with gnulib
- Authentication-results: sourceware.org; auth=none
- References: <CAGp8FVWQA07SmwP8u1CByk2zQmWU4b9Ldgk9rnp=yv2Tf_bZ9w@mail.gmail.com> <CAESRpQBgROXjDG1QCZJj6nKXGNZ=z4cM=_nTvKDM6R-ruZh_EA@mail.gmail.com> <alpine.DEB.2.20.1607291651000.29277@digraph.polyomino.org.uk> <CAESRpQC5h_y0eHyqdc57iWBUMUpJSJPJqHU3ZYovUQ7R6w3S1Q@mail.gmail.com> <CAESRpQAx0Kbs5w16dAtBZRNpHTw+V1COmh9XJ15j-WFY=KskXA@mail.gmail.com> <fe882e54-cd1c-c041-cf59-48c44167027c@redhat.com> <CAGp8FVWcgy3EvVaD-MATf_Fg2d0pNMWwvuRR+a95+ALxocPAow@mail.gmail.com> <1f3ae2ba-3c92-0184-f3ee-bb8e3ed8cbef@redhat.com> <CAGp8FVWkVcx4JO7C9=qdH9oHU=39nwaH5roQF_9KVsazQJSp4w@mail.gmail.com>
On 10 August 2016 at 14:40, ayush goel <ayushgoel1610@gmail.com> wrote:
> On 9 August 2016 at 2:20:59 PM, Pedro Alves (palves@redhat.com) wrote:
>> the scheme of configuring gnulib in a separate directory as borrowed from gdb
>> requires including two config.h headers -- the gnulib client's, and gnulib's.
Isn't this also true for libiberty's config.h ? I have no idea
when/how is that included.
>> Did you do something different that avoids needing that somehow?
>
> I wasn’t aware of this. Thanks for pointing this out.
> It’s strange however, I didn’t see anything failing while
> building/testing my system.
>>
>> In gdb, .c files don't include "config.h" directly. Instead all .c files
>> include a "defs.h" file first thing, and that in turn (after another indirection)
>> is what includes both gdb's "config.h" and gnulib's "config.h”:
>
> Can gcc also adopt a similar approach? Include gnulib’s config.h in a
> single header file instead of including it in every function that uses
> it.
> Which header file would be the most suitable for this purpose(probably
> which is generically included by almost all the gcc functions)?
Unfortunately, gcc/*.c include config.h directly. Sorry, I'm not
really sure how this is supposed to work and how it was working for
libiberty's config.h but I'd suggest to copy that if possible.
Cheers,
Manuel.