From: Dirk Gouders <dirk@gouders.net>
To: Borislav Petkov <bp@suse.de>
Cc: Jiri Olsa <jolsa@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: tools/lib/lk: redefinition of _FORTIFY_SOURCE (gcc-4.7.2)
Date: Wed, 22 May 2013 13:22:14 +0200 [thread overview]
Message-ID: <gitxlvuumx.fsf@karga.hank.lab> (raw)
In-Reply-To: <giy5b7uyfe.fsf@karga.hank.lab> (Dirk Gouders's message of "Wed, 22 May 2013 12:00:21 +0200")
Dirk Gouders <dirk@gouders.net> writes:
> What probably might help in any case is undefining _FORTIFY_SOURCE before
> defining it, because as far as I know, there is no problem with
> undefining something that is not yet defined, but I could imagine,
> others might have more elegant suggestions:
>
> CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE
> -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC
More elegant would probably be to look at tools/perf/Makefile and handle
the problem as is done there:
CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC
ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -D_FORTIFY_SOURCE=2,-D_FORTIFY_SOURCE=2),y)
CFLAGS := $(CFLAGS) -D_FORTIFY_SOURCE=2
endif
I tested it here and it works well.
Dirk
prev parent reply other threads:[~2013-05-22 11:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 10:00 tools/lib/lk: redefinition of _FORTIFY_SOURCE (gcc-4.7.2) Dirk Gouders
2013-05-22 11:18 ` Borislav Petkov
2013-05-22 11:27 ` Dirk Gouders
2013-05-22 13:50 ` Borislav Petkov
2013-05-23 20:32 ` Dirk Gouders
2013-05-22 11:22 ` Dirk Gouders [this message]
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=gitxlvuumx.fsf@karga.hank.lab \
--to=dirk@gouders.net \
--cc=bp@suse.de \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.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