From: Dirk Gouders <dirk@gouders.net>
To: Ingo Molnar <mingo@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/lib/api/Makefile: Add feature check for _FORTIFY_SOURCE
Date: Mon, 20 Apr 2015 20:34:07 +0200 [thread overview]
Message-ID: <gh7ft6odi8.fsf@quad.gouders.net> (raw)
In-Reply-To: <20150420181631.GA19378@gmail.com> (Ingo Molnar's message of "Mon, 20 Apr 2015 20:16:31 +0200")
Ingo Molnar <mingo@kernel.org> writes:
> * Dirk Gouders <dirk@gouders.net> wrote:
>
>> For example on Gentoo systems where _FORTIFY_SOURCE is set by default,
>> `make -C tools/perf' fails, because of the macro being redefined.
>>
>> Fix that by a feature-check analogous to tools/perf/config/Makefile.
>>
>> Signed-off-by: Dirk Gouders <dirk@gouders.net>
>> ---
>> tools/lib/api/Makefile | 9 ++++++++-
>> 1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile
>> index d8fe29f..acf9097 100644
>> --- a/tools/lib/api/Makefile
>> +++ b/tools/lib/api/Makefile
>> @@ -16,7 +16,14 @@ MAKEFLAGS += --no-print-directory
>> LIBFILE = $(OUTPUT)libapi.a
>>
>> CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
>> -CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 -fPIC
>> +CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fPIC
>> +
>> +ifeq ($(DEBUG),0)
>> + ifeq ($(feature-fortify-source), 1)
>> + CFLAGS += -D_FORTIFY_SOURCE=2
>> + endif
>> +endif
>
> So how about undefining it instead and re-defining it as
> _FORTIFY_SOURCE=2?
>
> Just in case a distro sets a weaker version - lets not accept that
> weaker setting. We've always had the stronger version of it.
Yes, I was suggesting something similar (but without founded reasoning),
some time ago [1].
Would the "undefining-approch" mean that we should modify the handling
of _FORTIFY_SOURCE in tools/perf/config/Makefile as well?
Dirk
[1] https://lkml.org/lkml/2013/5/22/186
next prev parent reply other threads:[~2015-04-20 18:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-20 12:01 [PATCH] tools/lib/api/Makefile: Add feature check for _FORTIFY_SOURCE Dirk Gouders
2015-04-20 18:16 ` Ingo Molnar
2015-04-20 18:34 ` Dirk Gouders [this message]
2015-04-20 18:55 ` Bobby Powers
2015-04-21 7:46 ` Dirk Gouders
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=gh7ft6odi8.fsf@quad.gouders.net \
--to=dirk@gouders.net \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
/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