This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH/libiberty] fix build of gdb/binutils with clang.
- From: Ian Lance Taylor <iant at google dot com>
- To: Yunlian Jiang <yunlian at google dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 4 May 2015 17:30:20 -0700
- Subject: Re: [PATCH/libiberty] fix build of gdb/binutils with clang.
- Authentication-results: sourceware.org; auth=none
- References: <CAMsPy2vps4WX9ax-JfPCGdWbRw=deyu+OuqpgojSJFSe6e+HHg at mail dot gmail dot com> <CAKOQZ8wXKGAxKgcetJxPPWXgxaeNrbLf-E_o6Tz2zbjYF6VfQg at mail dot gmail dot com> <CAMsPy2v+MduooHaBA8hhiTcrq_1NeQm1X-LnOrMEoouUQii4kg at mail dot gmail dot com> <CAKOQZ8z7ME_yEbW3YgMWCLyRVz+w3wjYz7LNayBBBmC1atFYHA at mail dot gmail dot com> <CAMsPy2s2A8U-vTE8u9y+P+xmESKMSuHD=6RV798KNEQKbZdXUg at mail dot gmail dot com>
On Mon, May 4, 2015 at 3:49 PM, Yunlian Jiang <email@example.com> wrote:
> There was a similar disscussion here
That was a discussion about libiberty. Your subject says you have
trouble building gdb.
Can you describe the exact problem that you are having? What
precisely are you doing? What precisely happens?
> The problem is in the configure stage, the __GNU_SOURCE is not
> defined, and it could not find
> the declaration of asprintf. so it make a declaration of asprintf in
> libiberty.h. And for the file floatformat.c,
> the __GNU_SOURCE is defined, so it could find another asprintf in
> /usr/include/bits/stdio2.h, it also includes
> libiberty.h. So these two asprintf conflicts when __USE_FORTIFY_LEVEL is set.
I think the basic guideline should be that HAVE_DECL_ASPRINTF should
be correct. If libiberty compiled with _GNU_SOURCE defined, then it
should test HAVE_DECL_ASPRINTF with _GNU_SOURCE defined. If not, then
not. So perhaps the problem is that libiberty is compiling some files
with _GNU_SOURCE defined and some not.