From: Mike Frysinger <vapier@gentoo.org>
To: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] RFC add _FORTIFY_SOURCE to default LTP CFLAGS
Date: Wed, 28 Aug 2013 12:37:02 -0400 [thread overview]
Message-ID: <201308281237.03104.vapier@gentoo.org> (raw)
In-Reply-To: <201308281234.41447.vapier@gentoo.org>
[-- Attachment #1.1: Type: Text/Plain, Size: 1275 bytes --]
On Wednesday 28 August 2013 12:34:40 Mike Frysinger wrote:
> On Wednesday 28 August 2013 07:56:01 chrubis@suse.cz wrote:
> > > unfortunately that does not work. this snippet from coreutils is
> > > probably better:
> > > AH_VERBATIM([FORTIFY_SOURCE],
> > > [/* Enable compile-time and run-time bounds-checking, and some
> > > warnings,
> > > without upsetting glibc 2.15+. */
> > > #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
> > > # define _FORTIFY_SOURCE 2
> > > #endif
> > > ])
> >
> > That wouldn't work here, as config.h is included only in a few testcases
> > (in these that actually use some of the defines there).
> >
> > But given that this just copies some ifdefs into config.h what about
> > adding the snippet directly into compiler.h that is included from
> > test.h thus ends up in all testcases?
>
> SGTM
err, no, that won't work either. _FORTIFY_SOURCE must be defined before any
header file is included. otherwise, including all the C lib headers and then
test.h and then defining this won't accomplish anything.
you could probably turn that AH_VERBATIM into a compile test and then add it
to CPPFLAGS based on the result. that would probably work in most cases.
-mike
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 433 bytes --]
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2013-08-28 16:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-11 11:00 [LTP] RFC add _FORTIFY_SOURCE to default LTP CFLAGS chrubis
[not found] ` <201308242143.45598.vapier@gentoo.org>
2013-08-27 11:04 ` chrubis
[not found] ` <201308271218.22009.vapier@gentoo.org>
2013-08-28 11:56 ` chrubis
[not found] ` <201308281234.41447.vapier@gentoo.org>
2013-08-28 16:37 ` Mike Frysinger [this message]
2013-09-02 12:23 ` chrubis
2013-09-02 14:27 ` chrubis
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=201308281237.03104.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=ltp-list@lists.sourceforge.net \
/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