From: Joel Brobecker <brobecker@adacore.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: Sergio Durigan Junior <sergiodj@redhat.com>,
GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix PR gdb/23835: Don't redefine _FORTIFY_SOURCE if it's already defined
Date: Tue, 30 Oct 2018 22:47:00 -0000 [thread overview]
Message-ID: <20181030224717.GA4081@adacore.com> (raw)
In-Reply-To: <7524d20b4c0390d73fcd4225924329df@polymtl.ca>
> > 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.
>
> I think it makes sense, it also gives the user the possibility to override
> it, if they don't like our value. Give it a few days to give others a
> change to respond. If you don't hear anything in ~1 week, please go ahead
> and push.
Good point about allowing the user to override it.
The patch looks OK to me too.
--
Joel
next prev parent reply other threads:[~2018-10-30 22:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 21:42 Sergio Durigan Junior
2018-10-30 21:54 ` Simon Marchi
2018-10-30 22:47 ` Joel Brobecker [this message]
2018-10-31 20:05 ` Sergio Durigan Junior
2018-10-31 21:27 ` Joel Brobecker
2018-10-31 21:43 ` Sergio Durigan Junior
2018-10-31 20:04 ` Sergio Durigan Junior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181030224717.GA4081@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=sergiodj@redhat.com \
--cc=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox