gdb build failures
Daron Chabot
daron.chabot at usask.ca
Mon Apr 14 14:11:26 UTC 2008
On 14-Apr-08, at 2:10 AM, Ralf Corsepius wrote:
>
> On Sun, 2008-04-13 at 10:54 -0600, Daron Chabot wrote:
>> All,
>>
>> FYI: "Out of the box", gdb-6.7.1 (and gdb-6.8 as well) do not build
>> on mac os x (Tiger). The failure is due to the addition of "-Werror"
>> to the gdb's build CFLAGS (and maybe also due to the use of
>> gcc-4.x.x ?).
>>
>> Once the build gets to gdb-6.x.x/gdb, it trips over warnings like
>> these:
>> ../../gdb-6.7.1/gdb/i386-tdep.c: In function 'i386_collect_fpregset':
>> ../../gdb-6.7.1/gdb/i386-tdep.c:2035: warning: format not a string
>> literal, argument types not checked
>> ../../gdb-6.7.1/gdb/i386-tdep.c: In function 'i386_print_insn':
>> ../../gdb-6.7.1/gdb/i386-tdep.c:2139: warning: format not a string
>> literal, argument types not checked
>>
>> which, of course, cause the build to bail because of the -Werror
>> flag...
>>
>> In each warning case, the culprit code is one form or another of
>> error-reporting or gdb-assert( ) statements. These functions may not
>> be dangerous in any way, but gcc seems to think that they *could*
>> be...
>>
>> Simply removing the "-Werror" addition from the appropriate Makefile
>> allows the build(s) to complete successfully, albeit with much
>> noise...
>
> cf. below. You seem to have a typo in your configure options.
Good catch, thanks Ralf. I completely missed the "-" vs "--", below.
The typo is really there: I didn't simply mis-copy the output of "gcc
-v"...
>
>> Should the gdb and gcc lists be notified ?
> --enable-werror and using -Werror during gcc/gdb builts are band-aids
> for developing gdb/gcc themselves. You normally don't want to use them
> when wanting to build gdb/gcc when wanting to install gdb/gdb.
>
> That said, you will want to not pass --enable-werror to configure when
> building gdb/gcc, rsp. you might even want to pass --disable-werror.
>
> I.e. the gdb/gcc list might be interested in seeing these
> warnings/errors.
>
> You, as a user/system-integrator/installer are not really
> interested in
> them.
Interesting...
>
>> Info:
>> ---------------------------------------------------------------------
>> ---
>> ------------------------------
>> djc at toolbox--> ../gdb-6.7.1/configure --target=i386-rtems --prefix=/
>> opt/rtems
>>
>> djc at toolbox--> uname -a
>> Darwin toolbox 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10
>> 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386
>>
>> djc at toolbox--> gcc -v
>> Using built-in specs.
>> Target: i686-apple-darwin8
>> Configured with: /private/var/tmp/gcc/gcc-5367.obj~1/src/configure --
>> disable-checking -enable-werror --prefix=/usr --mandir=/share/man --
>> enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg]
>> [^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-
>> slibdir=/usr/lib --build=powerpc-apple-darwin8 --with-arch=nocona --
>> with-tune=generic --program-prefix= --host=i686-apple-darwin8 --
>> target=i686-apple-darwin8
>> Thread model: posix
>> gcc version 4.0.1 (Apple Computer, Inc. build 5367)
> Check your options:
>
> ./configure --help | grep werror
> --enable-werror enable -Werror in bootstrap stage2 and later
>
> I see -enable-werror above ("-" vs "--")
So, it seems to be the *combination* of apple's gcc defining "--
enable-werror" (actually, "-enable-error")
AND the addition of "-Werror" to gdb's build CFLAGS which causes the
build failure...
Configuring gdb with an additional "--disable-werror" results in a
successful build.
Thanks again, Ralf.
-- dc
More information about the users
mailing list