gdb fails to build
Simon Marchi
simon.marchi@ericsson.com
Fri Nov 27 19:05:00 GMT 2015
On 15-11-27 10:49 AM, Simon Marchi wrote:
> On 15-11-27 08:31 AM, Tobias Burnus wrote:
>> Hello all,
>>
>> today, I fail to build gdb using GCC 6; looking at the changes, the culprit
>> seems to be this patch set. (I don't know whether it caused the issue or
>> just revealed it.) In any case, using yesterday's GDB with yesterday's GCC
>> worked.
>>
>> The error I see is for remove.c - using stddef.h via common-defs.h:
>>
>> gcc -g -O2 -I. -I../../gdb -I../../gdb/common -I../../gdb/config -DLOCALEDIR="\"gdb/gdb-inst/share/locale\"" -DHAVE_CONFIG_H -I../../gdb/../include/opcode -I../../gdb/../opcodes/.. -I../../gdb/../readline/.. -I../../gdb/../zlib -I../bfd -I../../gdb/../bfd -I../../gdb/../include -I../libdecnumber -I../../gdb/../libdecnumber -I../../gdb/gnulib/import -Ibuild-gnulib/import -DTUI=1 -Ipython/python/include/python2.7 -Ipython/python/include/python2.7 -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wpointer-sign -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral -Werror -c -o remote.o -MT remote.o -MMD -MP -MF .deps/remote.Tpo ../../gdb/remote.c
>>
>> In file included from build-gnulib/import/stdio.h:53:0,
>> from ../../gdb/common/common-defs.h:31,
>> from ../../gdb/defs.h:28,
>> from ../../gdb/remote.c:22:
>> build-gnulib/import/stddef.h:104:3: error: conflicting types for ‘max_align_t’
>> } max_align_t;
>> ^
>>
>> In file included from build-gnulib/import/stddef.h:55:0,
>> from build-gnulib/import/stdio.h:53,
>> from ../../gdb/common/common-defs.h:31,
>> from ../../gdb/defs.h:28,
>> from ../../gdb/remote.c:22:
>> gcc/gcc-trunk/lib/gcc/x86_64-pc-linux-gnu/6.0.0/include/stddef.h:429:3: note: previous declaration of ‘max_align_t’ was here
>> } max_align_t;
>> ^
>>
>>
>> The definitions are as follows. GCC 6:
>>
>> typedef struct {
>> long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
>> long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
>> } max_align_t;
>>
>>
>>
>> GDB's build-gnulib:
>>
>> typedef union
>> {
>> char *__p _GL_STDDEF_ALIGNAS (char *);
>> double __d _GL_STDDEF_ALIGNAS (double);
>> long double __ld _GL_STDDEF_ALIGNAS (long double);
>> long int __i _GL_STDDEF_ALIGNAS (long int);
>> } max_align_t;
>>
>>
>> Cheers,
>>
>> Tobias
>
> I am trying to build gcc from the tree to see if I can reproduce the failure. However,
> I really can't see how this patch could cause this kind of failure... We'll see.
I just tested building gdb (622b9eb1a6047bd3ad3e1a3f120cf7318ac25b57) using gcc master:
/opt/gcc/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/opt/gcc/bin/gcc
COLLECT_LTO_WRAPPER=/opt/gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/emaisin/src/gcc/configure --enable-languages=c,c++ --disable-bootstrap --prefix=/opt/gcc
Thread model: posix
gcc version 6.0.0 20151127 (experimental) (GCC)
and it works fine. Have you done a build from scratch or an incremental one? I would suggest
retrying from scratch. If you try to incrementally build, but with different compilers, then the
options configure found for the first compiler (such as whether stddef.h defines max_align_t)
might not work for the second compiler.
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".
Simon
More information about the Gdb-patches
mailing list