This is the mail archive of the
mailing list for the GDB project.
Re: [BUILDROBOT] asprintf() no longer declared
- From: Pedro Alves <palves at redhat dot com>
- To: Jan-Benedict Glaw <jbglaw at lug-owl dot de>, Iain Buclaw <ibuclaw at gdcproject dot org>
- Cc: gdb-patches at sourceware dot org, yunlian at google dot com
- Date: Tue, 30 Jun 2015 17:55:02 +0100
- Subject: Re: [BUILDROBOT] asprintf() no longer declared
- Authentication-results: sourceware.org; auth=none
- References: <CABOHX+fRn+jrNs_hfuf6FHr3koC7ynSDYRFfjkFesJYgfUjdjg at mail dot gmail dot com> <20150625142348 dot GO16812 at lug-owl dot de> <20150630162540 dot GA23299 at lug-owl dot de>
On 06/30/2015 05:25 PM, Jan-Benedict Glaw wrote:
> On Thu, 2015-06-25 16:23:48 +0200, Jan-Benedict Glaw <email@example.com> wrote:
>> On Fri, 2015-06-19 17:18:38 +0200, Iain Buclaw <firstname.lastname@example.org> wrote:
>>> Belated attempt at downstreaming libiberty changes from upstream.
>>> Split it into two patches, one with dlang related changes, the other
>>> with everything else.
>>> As requested, commits have been replayed ontop of gdb rather than a
>>> straight diff between the directories.
>> Seems there were some minor changes in libiberty which breaks code
>> generation on non-GNU systems due to missing asprintf().
>> On the AIX builder (gcc111.fsffrance.org), I see build failures in
>> Binutils since then, see ie.
>> /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I/home/jbglaw/repos/binutils_gdb/bfd -I. -I/home/jbglaw/repos/binutils_gdb/bfd -I/home/jbglaw/repos/binutils_gdb/bfd/../include -DHAVE_cr16_elf32_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_plugin_vec -DBINDIR='"/home/jbglaw/build/cr16-elf/_install_/bin"' -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I/home/jbglaw/repos/binutils_gdb/bfd/../zlib -g -O2 -MT bfd.lo -MD -MP -MF .deps/bfd.Tpo -c -o bfd.lo /home/jbglaw/repos/binutils_gdb/bfd/bfd.c
>> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I/home/jbglaw/repos/binutils_gdb/bfd -I. -I/home/jbglaw/repos/binutils_gdb/bfd -I/home/jbglaw/repos/binutils_gdb/bfd/../include -DHAVE_cr16_elf32_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_plugin_vec -DBINDIR=\"/home/jbglaw/build/cr16-elf/_install_/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I/home/jbglaw/repos/binutils_gdb/bfd/../zlib -g -O2 -MT bfd.lo -MD -MP -MF .deps/bfd.Tpo -c /home/jbglaw/repos/binutils_gdb/bfd/bfd.c -o bfd.o
>> /home/jbglaw/repos/binutils_gdb/bfd/bfd.c: In function 'bfd_errmsg':
>> /home/jbglaw/repos/binutils_gdb/bfd/bfd.c:543:7: error: implicit declaration of function 'asprintf' [-Werror=implicit-function-declaration]
>> if (asprintf (&buf, _(bfd_errmsgs [error_tag]), input_bfd->filename, msg)
>> cc1: all warnings being treated as errors
>> make: *** [bfd.lo] Error 1
>> make: Leaving directory `/home/jbglaw/build/cr16-elf/build-binutils-full/bfd'
> It's a few days since building GDB probably broke on all non-GNU
> platforms. Is somebody about to work on that?
TBC, this is not really Iain's fault, as his patch was
just a merge from upstream.
(It'd be good if people interested in the affected platforms
came forward and help diagnose/fix it.)
I suspect that this is what is breaking things:
+2015-05-22 Yunlian Jiang <email@example.com>
+ * libiberty.h (asprintf): Don't declare if HAVE_DECL_ASPRINTF is
+ not defined.
I see here that Yunlian actually wanted this to fix the gdb build:
Iain just happened to merge the patch sooner.
Added Yunlian Jiang to CC.
I think the problem is that bfd's configure.ac is missing
an AC_CHECK_DECLS for asprintf, so that HAVE_DECL_ASPRINTF can end
(the series mentioned at https://gcc.gnu.org/ml/gcc-patches/2015-02/msg01712.html
would address this for good all over the tree, but I never heard
from the libiberty maintainers about that idea. Surprisingly, I notice
now that I missed converting bfd/.)