Re: [PATCH/libiberty] fix build of gdb/binutils with clang.

2015-05-20 Thread Yunlian Jiang
GCC bootstraps with this patch. On Wed, May 20, 2015 at 12:54 PM, Ian Lance Taylor wrote: > This is OK if GCC bootstraps. > > Thanks. > > Ian > > On Wed, May 20, 2015 at 11:25 AM, Yunlian Jiang wrote: >> I have the following change to make libiberty compile with _GN

Re: [PATCH/libiberty] fix build of gdb/binutils with clang.

2015-05-20 Thread Yunlian Jiang
#define _GNU_SOURCE +#endif #ifdef HAVE_CONFIG_H #include "config.h" On Tue, May 19, 2015 at 11:15 AM, Ian Lance Taylor wrote: > On Tue, May 19, 2015 at 11:08 AM, Yunlian Jiang wrote: >> >> I could do that and it make the compilation of libiberty passes. >>

Re: [PATCH/libiberty] fix build of gdb/binutils with clang.

2015-05-19 Thread Yunlian Jiang
not include the libiberty/config.h and at the same time, _GNU_SOURCE is defind, the same error happens. On Mon, May 18, 2015 at 4:52 PM, Ian Lance Taylor wrote: > On Mon, May 18, 2015 at 4:26 PM, Yunlian Jiang wrote: >> >> Yes, the problem is libiberty is compiling some files >> w

Re: [PATCH/libiberty] fix build of gdb/binutils with clang.

2015-05-18 Thread Yunlian Jiang
, May 4, 2015 at 3:49 PM, Yunlian Jiang wrote: >> There was a similar disscussion here >> https://gcc.gnu.org/ml/gcc/2005-11/msg01190.html > > That was a discussion about libiberty. Your subject says you have > trouble building gdb. > > Can you describe the exact proble

Re: [PATCH/libiberty] fix build of gdb/binutils with clang.

2015-05-04 Thread Yunlian Jiang
, 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. On Sat, May 2, 2015 at 11:58 AM, Ian Lance Taylor wrote: > On Fri, May 1, 2015 at 4:45 PM, Yunlian Ji

Re: [PATCH/libiberty] fix build of gdb/binutils with clang.

2015-05-01 Thread Yunlian Jiang
The test case does not have #define _GNU_SOURCE, so it says error: ‘asprintf’ undeclared (first use in this function) On Fri, May 1, 2015 at 3:45 PM, Ian Lance Taylor wrote: > On Tue, Apr 28, 2015 at 2:59 PM, Yunlian Jiang wrote: >> I believe this is the same problem as >> http

[PATCH/libiberty] fix build of gdb/binutils with clang.

2015-04-28 Thread Yunlian Jiang
I believe this is the same problem as https://gcc.gnu.org/ml/gcc-patches/2008-07/msg00292.html The asprinf declaration is messed up when using clang to build gdb. diff --git a/include/libiberty.h b/include/libiberty.h index b33dd65..a294903 100644 --- a/include/libiberty.h +++ b/include/libibert