This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix Gnulib glob.c resource leaks found by Coverity
Tom Tromey wrote:
> >>>>> "Gary" == Gary Benson <gbenson@redhat.com> writes:
>
> Gary> Coverity discovered a number of resource leaks in Gnulib's glob.c.
> Gary> This commit backports the five Gnulib commits that fix the leaks.
>
> Gary> Regression tested on the buildbot.
>
> Gary> Ok to commit?
>
> Why a local patch as opposed to a gnulib update?
Because of this:
https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00157.html
Basically Gnulib appends flags to $CC during ./configure, but then
GDB's Makefile passes $CC to Gnulib's Makefile for building, so
Gnulib's ./configure does all it's checks with these special flags,
and then GDB strips them off while building Gnulib, which makes the
compilation fail. I've tried for some weeks to fix this, both in
Gnulib (making it not touch $CC) and more recently in GDB (making it
not overwrite $CC) but nothing I've tried worked so I've given up.
FWIW it can't be fixed by not passing CC to Gnulib's Makefile from
GDB as Sergio suggested; Gnulib itself builds, but GDB then fails to
build because the Gnulib code it includes was configured with the
special flags Gnulib added but that aren't there for the GDB build.
Cheers,
Gary