This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb fails to build

On 15-11-27 05:35 PM, Tobias Burnus wrote:
> On Fri, Nov 27, 2015 at 02:05:53PM -0500, Simon Marchi wrote:
>> I just tested building gdb (622b9eb1a6047bd3ad3e1a3f120cf7318ac25b57) using gcc master:
>> /opt/gcc/bin/gcc -v
>> gcc version 6.0.0 20151127 (experimental) (GCC)
>> and it works fine.  Have you done a build from scratch or an incremental one?
>> In gdb/build-gnulib/config.log, I have:
>>  965 configure:16981: checking for max_align_t
>>  966 configure:16981: result: yes
>> I suppose that yours says "no".
> I think I found the issue of mine: I accidentally start a new
> shell in my build script:
>   time (make "$@" && make install)
> which overrides the set PATH - such that ./configure runs with
> /usr/bin/gcc while make runs with gcc 6.
> Thus, I had "result: no" but before your patch, it didn't fail.
> Sorry for the false alarm!

Ah that makes sense.

>  * * *
> Still, using GCC 6 through out still fails - albeit due to an other issue:
> make[4]: Entering directory `/data/local_users/tobiasb/gdb/binutils-gdb/build/gold'
> g++ -DHAVE_CONFIG_H -I. -I../../gold  -I../../gold -I../../gold/../include -I../../gold/../elfcpp -DLOCALEDIR="\"/data/local_users/tobiasb/gdb/gdb-inst/share/locale\"" -DBINDIR="\"/data/local_users/tobiasb/gdb/gdb-inst/bin\"" -DTOOLBINDIR="\"/data/local_users/tobiasb/gdb/gdb-inst/x86_64-pc-linux-gnu/bin\"" -DTOOLLIBDIR="\"/data/local_users/tobiasb/gdb/gdb-inst/x86_64-pc-linux-gnu/lib\""   -W -Wall    -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=dirsearch.o -I../../gold/../zlib -g -O2 -MT dirsearch.o -MD -MP -MF .deps/dirsearch.Tpo -c -o dirsearch.o ../../gold/
> ../../gold/ error: â{anonymous}::Dir_caches::~Dir_caches()â defined but not used [-Werror=unused-function]
>  Dir_caches::~Dir_caches()
>  ^~~~~~~~~~
> That's with GDB 622b9eb1a6047bd3ad3e1a3f120cf7318ac25b57
> and GCC 335ce86cb6cea8046993ab93d573316fd9ff798c (r231023).
> I wonder why that didn't show up with before
> when configuring with GCC 4.4 and building GCC 6.
> I assume it didn't show up for you as you didn't use
> '--enable-ld --enable-gold' - or did you also build gold?
> Cheers,
> Tobias

No I don't build gold.  I generally use the following configure line.  Since I am interested
in gdb, I disable pretty much everything else.

~/src/binutils-gdb/configure \
  --enable-targets=all \
  CFLAGS="-g3 -O0" CXXFLAGS="-g3 -O0" \
  --with-python=/usr/bin/python3 \
  --disable-ld --disable-gold --disable-gas --disable-binutils --disable-gprof

I can also see some similar warnings causing failure in bfd and opcodes, which is required to
build gdb (things like unused function/variable, variable may be used before assigned).  I then
go in the offending subdirectory and build the file without -Werror.  For you example, it would

  make CFLAGS="-Wno-error" dirsearch.o

in $(builddir)/gold.  The right thing to do, however, would be to fix the warning at the source.
So if time was not an issue, I would go and fix all these little warnings, but unfortunately I
don't have that luxury :(.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]