Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1744683rwd; Sun, 21 May 2023 05:33:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5sqsunoa0WBj11LTx57AVFmOmehue/Jr5BHvGxXO73Q+dV26ZUahvMCHelrMpybV9Z7aW0 X-Received: by 2002:a05:6a20:2590:b0:104:1fa9:b74c with SMTP id k16-20020a056a20259000b001041fa9b74cmr9216465pzd.14.1684672432155; Sun, 21 May 2023 05:33:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684672432; cv=none; d=google.com; s=arc-20160816; b=lt3MoyiCm1f/W5z4trtWKEYlJ4zxsS+Niktv3YZHPUKrf/Af2dhnchmO0ClPi+xomc FeXtsBpheZ+V5oyRD3+h4uLjvjn7TKnmJfX2yByenWB+Gv00cCoVld1Otgc4TRor3j3+ JrDjuqxQ28Jtr/MhCKyzM5Q6cFsNKYYAC1FERGWi+9k8wgUVL3JJ1XYXybdTrcr2IOYh NZGR4jxL5DubJHKXQEqECUorL+di9Pru0rTXwZ5ZcciHUdZxyNoKKbzd/f2wbI+2GLCV 9m/MUQuC+pw5c3bshy+ZbcpFkSItIU8XaOcxxMqIc3gdAGzBIujY7Fd2lk5QCNmj3n9w UO2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:date; bh=f2npLbPOpADyEO5WMSlJx+vZAFPvEzavBb6SBMvZox0=; b=wys6TvpzjtZNDreXnH6mwvtwnKagaysyf90BctuehSLJaex9jRgjrU87MBg+MpQxCZ yc8XGg2EB0553c5J3R0GvBC+Vacq0S/T3Gfb4NVwdOFwHTufSH1d6CRHJAg9z/NL+MpG FIQW4ChZ4kPowN75iNlbOPvdF5tyf4mVqMSdZhyrk13+0Ys0WNvepC2DAe4DjwUTPZE1 IrjQOtC5saaFpmh7GJqpO0ZK+fHozWv5mtoNplQeaDfRsmRKPAJ+geer/YEcKA04+pvG tldCM/EHdoJ4SF/KFBbY/CJ1HeEOS8S4lGzxj1ApRwVlGSk9qpXmFImWapKqMaF6z9Je 5E5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@t-8ch.de header.s=mail header.b=B4j6MrFv; 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 h64-20020a625343000000b0064d6a514682si470227pfb.366.2023.05.21.05.33.39; Sun, 21 May 2023 05:33:52 -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=@t-8ch.de header.s=mail header.b=B4j6MrFv; 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 S230042AbjEULrl (ORCPT + 99 others); Sun, 21 May 2023 07:47:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231668AbjEUKkV (ORCPT ); Sun, 21 May 2023 06:40:21 -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 3A0751A8; Sun, 21 May 2023 03:36:04 -0700 (PDT) Date: Sun, 21 May 2023 12:36:01 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-8ch.de; s=mail; t=1684665362; bh=DHkS6vR075WOjYryzPWplYp9E9UCb+89BMbbIW7FyiA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B4j6MrFveCJ/eL/P6OzEPwPxvEcIStVL2HPwsp65qDZTBbuEp8VMEP+fnMdzfZbf2 p9HOisqOhrsIQUphD72u//kAtFUBo21iub42AsIJuSvOwgng4FF31iLnDhIsqVsKjR keVBHoPhVpG12mpW7Qa4Dht4CO5uXEHOGs6gjsak= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Willy Tarreau Cc: "Paul E. McKenney" , Shuah Khan , Paul Walmsley , Palmer Dabbelt , Albert Ou , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, llvm@lists.linux.dev Subject: Re: [PATCH 7/7] tools/nolibc: simplify stackprotector compiler flags Message-ID: References: <20230521-nolibc-automatic-stack-protector-v1-0-dad6c80c51c1@weissschuh.net> <20230521-nolibc-automatic-stack-protector-v1-7-dad6c80c51c1@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230521-nolibc-automatic-stack-protector-v1-7-dad6c80c51c1@weissschuh.net> 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 On 2023-05-21 11:36:35+0200, Thomas Weißschuh wrote: > 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 I noticed, of course after having sent the series, that the cleanup here was not done properly. CFLAGS_STACKPROTECTOR and CFLAGS_STKP should be deleted completely. This will be fixed in v2, or feel free to fix it up when applying the series.