From 07697489f4587e41f4f63aa526c1bd7d2fcd5494 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 27 Feb 2015 15:52:02 +0000 Subject: Create libiberty.m4, have GDB and GDBserver use it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Converting GDB to be a C++ program, I stumbled on 'basename' issues, like: src/gdb/../include/ansidecl.h:169:64: error: new declaration ‘char* basename(const char*)’ /usr/include/string.h:597:26: error: ambiguates old declaration ‘const char* basename(const char*)’ which I believe led to this bit in gold's configure.ac: dnl We have to check these in C, not C++, because autoconf generates dnl tests which have no type information, and current glibc provides dnl multiple declarations of functions like basename when compiling dnl with C++. AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf, strverscmp]) These checks IIUC intend to generate all the HAVE_DECL_FOO symbols that libiberty.h and ansidecl.h check. GDB is missing these checks currently, which results in the conflict shown above. This adds an m4 file that both GDB and GDBserver's configury use to pull in the autoconf checks that libiberty clients needs done in order to use these libiberty.h/ansidecl.h. gdb/ChangeLog: 2015-02-27 Pedro Alves * libiberty.m4: New file. * acinclude.m4: Include libiberty.m4. * configure.ac: Call libiberty_INIT. * config.in, configure: Regenerate. gdb/gdbserver/ 2015-02-27 Pedro Alves * acinclude.m4: Include libiberty.m4. * configure.ac: Call libiberty_INIT. * config.in, configure: Regenerate. --- gdb/acinclude.m4 | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gdb/acinclude.m4') diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4 index 1f0b574..0ad90e7 100644 --- a/gdb/acinclude.m4 +++ b/gdb/acinclude.m4 @@ -57,6 +57,9 @@ sinclude([../config/zlib.m4]) m4_include([common/common.m4]) +dnl For libiberty_INIT. +m4_include(libiberty.m4) + ## ----------------------------------------- ## ## ANSIfy the C compiler whenever possible. ## ## From Franc,ois Pinard ## -- cgit v1.1