From patchwork Mon Nov 28 12:32:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nix X-Patchwork-Id: 699955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tS5jJ2vfMz9vFb for ; Mon, 28 Nov 2016 23:34:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="v/NUvvrC"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=q4vlVjxZWybBXImheSH/YQVI2q7Jrsa G2LK8/qKQkL/eYiEmSdzFpkraGPKzc/VoExvi9cImoN+E5rkYLk27Bpt/pQya3ZK O9wKtyUAV8h/LxBG0To0t02n0OsspR0K4P41Nc1gonQgGbfyqnb+AFDmE5c+1pos z1mM7fSPuvmU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=83PaxnCZtOpXlUfUurx6C+cliFw=; b=v/NUv vrC0FSGccBTKscC7u+0eGxI+adLL9k0rpmLKQ+4M0sHQf12S2WobNvjBtE+3gZGQ lkz0It+3QHEvQsvFSwvOWpNPZtV0dOCDOK+g6sDKpUMkDlfPK4Igi+JWqXmorHhc YpH6ParsEWi2RK30bvTXiJuraeyxznF3YbLrUQ= Received: (qmail 51484 invoked by alias); 28 Nov 2016 12:33:35 -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 51144 invoked by uid 89); 28 Nov 2016 12:33:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:1337, 8217 X-HELO: mail.esperi.org.uk From: Nix To: libc-alpha@sourceware.org Cc: fweimer@redhat.com, Nick Alcock Subject: [PATCH 12/12] Enable -fstack-protector=* when requested by configure. Date: Mon, 28 Nov 2016 12:32:28 +0000 Message-Id: <20161128123228.30856-13-nix@esperi.org.uk> In-Reply-To: <20161128123228.30856-1-nix@esperi.org.uk> References: <20161128123228.30856-1-nix@esperi.org.uk> X-DCC--Metrics: spindle 1282; Body=3 Fuz1=3 Fuz2=3 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.