public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Michael Cree <mcree@orcon.net.nz>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, paulus@samba.org, hpa@zytor.com,
	mingo@redhat.com, a.p.zijlstra@chello.nl,
	ink@jurassic.park.msu.ru, tglx@linutronix.de, rth@twiddle.net,
	mingo@elte.hu, mcree@orcon.net.nz
Subject: [tip:perf/core] perf tools: Test -fstack-protector-all compiler option for inclusion in CFLAGS
Date: Wed, 11 Nov 2009 07:48:37 GMT	[thread overview]
Message-ID: <tip-5d7bdab75cd56d2bdc0986ae5546be3b09fea70a@git.kernel.org> (raw)
In-Reply-To: <20091111074302.GA3728@omega>

Commit-ID:  5d7bdab75cd56d2bdc0986ae5546be3b09fea70a
Gitweb:     http://git.kernel.org/tip/5d7bdab75cd56d2bdc0986ae5546be3b09fea70a
Author:     Michael Cree <mcree@orcon.net.nz>
AuthorDate: Wed, 11 Nov 2009 20:43:03 +1300
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 11 Nov 2009 08:46:45 +0100

perf tools: Test -fstack-protector-all compiler option for inclusion in CFLAGS

Some architectures (e.g. Alpha) do not support the
-fstack-protector-all compiler option and the use of the option
with -Werror causes the compiler to abort and the build fails.

Test that the compiler supports -fstack-protector-all before
inclusion in CFLAGS.

Signed-off-by: Michael Cree <mcree@orcon.net.nz>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <20091111074302.GA3728@omega>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 tools/perf/Makefile |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index b9509b1..e6d4272 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -207,7 +207,7 @@ ifndef PERF_DEBUG
   CFLAGS_OPTIMIZE = -O6
 endif
 
-CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
+CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
 LDFLAGS = -lpthread -lrt -lelf -lm
 ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
@@ -259,6 +259,9 @@ PTHREAD_LIBS = -lpthread
 # explicitly what architecture to check for. Fix this up for yours..
 SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
 
+ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null >/dev/null 2>&1 && echo y"), y)
+  CFLAGS := $(CFLAGS) -fstack-protector-all
+endif
 
 
 ### --- END CONFIGURATION SECTION ---

  reply	other threads:[~2009-11-11  7:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-26  8:32 [PATCH] [alpha] Add minimal support for software performance events Michael Cree
2009-10-26  8:48 ` Ingo Molnar
2009-10-27  8:09   ` Michael Cree
2009-11-08 12:22     ` Ingo Molnar
2009-11-08 12:27       ` Ingo Molnar
2009-11-11  7:43         ` Michael Cree
2009-11-11  7:48           ` tip-bot for Michael Cree [this message]
2009-10-27 18:29   ` Matt Turner
2009-10-28 20:56     ` Sam Ravnborg
2009-10-26 11:38 ` [tip:perf/core] perf tools, Alpha: Add Alpha support to perf.h tip-bot for Michael Cree
2009-10-26 12:08   ` Pekka Enberg
2009-10-26 12:22     ` Ingo Molnar
2009-10-28 20:58       ` Sam Ravnborg
2009-11-10 21:21     ` Peter Zijlstra
2009-12-01  4:30 ` [PATCH] [alpha] Add minimal support for software performance events Matt Turner
2009-12-01  9:31   ` Michael Cree

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=tip-5d7bdab75cd56d2bdc0986ae5546be3b09fea70a@git.kernel.org \
    --to=mcree@orcon.net.nz \
    --cc=a.p.zijlstra@chello.nl \
    --cc=hpa@zytor.com \
    --cc=ink@jurassic.park.msu.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=rth@twiddle.net \
    --cc=tglx@linutronix.de \
    /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