All of lore.kernel.org
 help / color / mirror / Atom feed
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: Thu, 23 May 2013 22:32:56 +0200	[thread overview]
Message-ID: <ghppwh4etj.fsf@mx10.gouders.net> (raw)
In-Reply-To: <20130522111850.GA15091@pd.tnic> (Borislav Petkov's message of "Wed, 22 May 2013 13:18:50 +0200")

Hi Borislav,

Borislav Petkov <bp@suse.de> writes:

> Hi,
>
> On Wed, May 22, 2013 at 12:00:21PM +0200, Dirk Gouders wrote:
>> CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC
>
> it seems someone else hit this already and fixed it too:
>
> commit d2f32479e5526a1ab3b4e43910fcb279871524ce
> Author: Marcin Slusarz <marcin.slusarz@gmail.com>
> Date:   Sun Feb 17 16:03:36 2013 +0100
>
>     perf tools: check if -DFORTIFY_SOURCE=2 is allowed

I thought about this _FORTIFY_SOURCE test and how the above commit
could/should be adopted to lib/lk/Makefile, and I thought that if it
were true that recent versions of gcc define _FORTIFY_SOURCE by default,
that test could probably be modified and just check gcc's builtin macros to
find out if _FORTIFY_SOURCE has to be defined explicitely and I tried to
find out when gcc started to use _FORTIFY_SOURCE builtin definitions...

In short: all what I said in my initial post was tested with gcc
versions on gentoo machines and it is gentoo that patches gcc so that
_FORTIFY_SOURCE becomes a builtin definition.  Unfortunately I don't
have access to machines running other distributions and can only report
about gcc on gentoo, but even with this limited information I would say
it depends on the distribution in use if -D_FORTIFY_SOURCE=2 is needed
and not on the gcc version.

Sorry for the noise if you already noticed my fault, I felt I should
correct my initial misleading information.

Dirk

  parent reply	other threads:[~2013-05-23 20:33 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 [this message]
2013-05-22 11:22 ` 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=ghppwh4etj.fsf@mx10.gouders.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.