From patchwork Mon Dec 19 11:15:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nix X-Patchwork-Id: 18564 Received: (qmail 119987 invoked by alias); 19 Dec 2016 11:25:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 119906 invoked by uid 89); 19 Dec 2016 11:25:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=makeconfig, Makeconfig, 8268, 8217 X-HELO: mail.esperi.org.uk From: Nix To: libc-alpha@sourceware.org Cc: fweimer@redhat.com Subject: [PATCH 15/15] Enable -fstack-protector=* when requested by configure. Date: Mon, 19 Dec 2016 11:15:28 +0000 Message-Id: <20161219111528.14969-16-nix@esperi.org.uk> In-Reply-To: <20161219111528.14969-1-nix@esperi.org.uk> References: <20161219111528.14969-1-nix@esperi.org.uk> X-DCC--Metrics: spindle 1480; Body=2 Fuz1=2 Fuz2=2 From: Nick Alcock This finally turns on all the machinery added in previous commits. v3: Wrap long lines. v5: Shuffle to the end. * Makeconfig (+stack-protector): New variable. (+cflags): Use it. --- Makeconfig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makeconfig b/Makeconfig index a785860..2b84d93 100644 --- a/Makeconfig +++ b/Makeconfig @@ -762,6 +762,11 @@ endif # disable any optimization that assume default rounding mode. +math-flags = -frounding-math +# We might want to compile with some stack-protection flag. +ifneq ($(stack-protector),) ++stack-protector=$(stack-protector) +endif + # This is the program that generates makefile dependencies from C source files. # The -MP flag tells GCC >= 3.2 (which we now require) to produce dummy # targets for headers so that removed headers don't break the build. @@ -821,7 +826,8 @@ ifeq "$(strip $(+cflags))" "" +cflags := $(default_cflags) endif # $(+cflags) == "" -+cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants) $(+math-flags) ++cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants) $(+math-flags) \ + $(+stack-protector) +gcc-nowarn := -w # Don't duplicate options if we inherited variables from the parent.