This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/23835] gdb/common/common-defs.h:71:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Wed, 31 Oct 2018 21:43:35 +0000
- Subject: [Bug gdb/23835] gdb/common/common-defs.h:71:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
- Auto-submitted: auto-generated
- References: <bug-23835-4717@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=23835
--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Sergio Durigan Junior
<sergiodj@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=656efb5e2691b2bd29573d9985d20206c47b6927
commit 656efb5e2691b2bd29573d9985d20206c47b6927
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Tue Oct 30 17:37:03 2018 -0400
Fix PR gdb/23835: Don't redefine _FORTIFY_SOURCE if it's already defined
Gentoo has a local GCC patch which always defines _FORTIFY_SOURCE=2.
This causes a build problem when building GDB there, because
"common/common-defs.h" also defines _FORTIFY_SOURCE=2:
CXX gdb.o
In file included from ../../gdb/defs.h:28:0,
from ../../gdb/gdb.c:19:
../../gdb/common/common-defs.h:71:0: error: "_FORTIFY_SOURCE" redefined
[-Werror]
#define _FORTIFY_SOURCE 2
<built-in>: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors
make[2]: *** [Makefile:1619: gdb.o] Error 1
Even though it is questionable whether Gentoo's approach is the
correct one:
https://jira.mongodb.org/browse/SERVER-29982
https://bugs.gentoo.org/621036
it is still possible for GDB to be a bit more robust here and make
sure it just defines _FORTIFY_SOURCE if it hasn't been defined
already. This patch does that.
Tested by rebuilding and making sure the macro was defined.
gdb/ChangeLog:
2018-10-31 Sergio Durigan Junior <sergiodj@redhat.com>
PR gdb/23835
* common/common-defs.h: Don't redefine _FORTIFY_SOURCE if it's
already defined.
--
You are receiving this mail because:
You are on the CC list for the bug.