Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1623633rwd; Sun, 21 May 2023 02:42:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4JOdQ/prEEg9rJR/ZIqOajRUczhMOQSDJ9+W5MU2rbc+Ig5qB0rcsnxsKurmDIWDxTbcSy X-Received: by 2002:a17:902:ea01:b0:1ab:267e:2f2d with SMTP id s1-20020a170902ea0100b001ab267e2f2dmr9950685plg.48.1684662139743; Sun, 21 May 2023 02:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684662139; cv=none; d=google.com; s=arc-20160816; b=Hrlu6YdAZ55HCN/sdtC0pRpnAYxEz0iAW2wU4JsPzL69mM5ZBSCa8+S008B4SW0CTo nDWrT33Yz1RWrPI5WQQxlhDA7zX2GBSkd4p8OX9Cxz3h7d/4BVebIQrLwRE9ESshN4be Yv7T0RsEZG11Izr4FRTEEOFm8jsCOZh4siIvu0UR5Fp7pBXnZeaVAmslamzrAah9G+yD GDKEZJ2SjLzn5V7RAPEmHI2T2MC8Z9CgsQqxL/tPfZPlWKcSHtF1/2UP3/NW7fiOWABK 68sKpdQmW0Nd9pV+vUoCYxO5W9J+DVnwIr7IMRuU8KzlnGLSTbl0rTeKC6vN2MwUANCO FssA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:dkim-signature :from; bh=zof8EHdN19sxi/e59RnaOsyiYSkxSX0rYij5q4l01bM=; b=CiabGCS2m6VCJY1KFUOIKGW85capPN8Zye+ftNX1U2bJCZUVU/oTGLIU3QRNCPacJO uu9zipqwprMAuMVjyDVhuPM9SIrGlUpRFciKozkDqwAFaAy/xtWJtNvrRmdm8MPrcgkv aXNuBaM9Vcr0eesR4AmmjvQ2W5W/Z+VRy2k3jLGUDdnGqEJ47+3Y2hZyxQyNxRe6Telr 2sP92/pP+Rrg5K5/jOgdfkhOfNhkkfc9LDietWpexA/WtNQZrPTXX6ErcSuKM4HhP/kf cUrL0xozKVzma/nDSRvDBykL9QsbBf2hMU1Y70PlFh+b7mpiSFGIFs1v66PoJcfnCi6Q cabw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=qhrhQOOM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u3-20020a170902714300b001ae5fe35b78si2796385plm.497.2023.05.21.02.42.05; Sun, 21 May 2023 02:42:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=qhrhQOOM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230226AbjEUJh3 (ORCPT + 99 others); Sun, 21 May 2023 05:37:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230177AbjEUJhH (ORCPT ); Sun, 21 May 2023 05:37:07 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD5F7E6; Sun, 21 May 2023 02:36:49 -0700 (PDT) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1684661804; bh=OtZaR9VeuPmOojjtUgQSBdMGO5O2wKJgryXGtmTqRzI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qhrhQOOMS89DvZWNK5Af0kDzvUeY+vJnHje0Yv/lqShv8qVQxvPu7lLqOxLdaHDbb yg7wwTACqQ699CQiFqiHYVuIpHZfQMKuNwT2AyogjeH4mqTU1vmIvrxFgkdbLkNxF/ nsk2legjwR2ozCkPxi3xQjS0XL+LYgRhmOHn0l14= Date: Sun, 21 May 2023 11:36:35 +0200 Subject: [PATCH 7/7] tools/nolibc: simplify stackprotector compiler flags MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230521-nolibc-automatic-stack-protector-v1-7-dad6c80c51c1@weissschuh.net> References: <20230521-nolibc-automatic-stack-protector-v1-0-dad6c80c51c1@weissschuh.net> In-Reply-To: <20230521-nolibc-automatic-stack-protector-v1-0-dad6c80c51c1@weissschuh.net> To: Willy Tarreau , "Paul E. McKenney" , Shuah Khan , Paul Walmsley , Palmer Dabbelt , Albert Ou , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684661802; l=1698; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=OtZaR9VeuPmOojjtUgQSBdMGO5O2wKJgryXGtmTqRzI=; b=DomoIsmXsRZwQWk0ScmwjLFDuu1dnN26YCXUzo34GqOdYuAtwSgkUrabKkFdr4rSI27UuPoCc 06iKjlgljDsC3ma9RvH/A7hClYqSQSwPisv/goaAeqLfKemkx+wOWfn X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that nolibc enable stackprotector support automatically when the compiler enables it we only have to get the -fstack-protector flags correct. The cc-options are structured so that -fstack-protector-all is only enabled if -mstack-protector=guard works, as that is the only mode supported by nolibc. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index bd41102ea299..445c352b1b33 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -76,20 +76,11 @@ else Q=@ endif -CFLAGS_STACKPROTECTOR = -DNOLIBC_STACKPROTECTOR \ - $(call cc-option,-mstack-protector-guard=global) \ - $(call cc-option,-fstack-protector-all) -CFLAGS_STKP_i386 = $(CFLAGS_STACKPROTECTOR) -CFLAGS_STKP_x86_64 = $(CFLAGS_STACKPROTECTOR) -CFLAGS_STKP_x86 = $(CFLAGS_STACKPROTECTOR) -CFLAGS_STKP_arm64 = $(CFLAGS_STACKPROTECTOR) -CFLAGS_STKP_arm = $(CFLAGS_STACKPROTECTOR) -CFLAGS_STKP_mips = $(CFLAGS_STACKPROTECTOR) -CFLAGS_STKP_riscv = $(CFLAGS_STACKPROTECTOR) -CFLAGS_STKP_loongarch = $(CFLAGS_STACKPROTECTOR) +CFLAGS_STACKPROTECTOR = $(call cc-option,-mstack-protector-guard=global -fstack-protector-all) CFLAGS_s390 = -m64 CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 \ $(call cc-option,-fno-stack-protector) \ + $(call cc-option,-mstack-protector-guard=global $(call cc-option,-fstack-protector-all)) \ $(CFLAGS_STKP_$(ARCH)) $(CFLAGS_$(ARCH)) LDFLAGS := -s -- 2.40.1