Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4847844rwd; Tue, 23 May 2023 13:33:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6meOAagy8TUrz1uukaQhYthu2yzE1iS854YpgbtiTI89ss+4HbiByBxKhgVE192hE8bQqq X-Received: by 2002:a05:6a00:2301:b0:643:7fcf:836d with SMTP id h1-20020a056a00230100b006437fcf836dmr286465pfh.25.1684874026244; Tue, 23 May 2023 13:33:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684874026; cv=none; d=google.com; s=arc-20160816; b=h6Xtr4w1sesQoQFWn+I8aH+2oHb1hlceWvgKyEm65GlstjQuoN+YS/kprYoEnhy1Ps S71UjLBXW6Ip0kfcjxtz/AJx+kzTe+bsg+Y8XmWvJb3lEIdX67fI++7y12aKRN3ryuwV KunEQy2T4m+/fMZUAf9UeZ6w32f0EfpB0INWlJqUQt1VdC38JELj7PpGn+WoLHD4ZI+Q 9HwfHjCXbRZ9rszmdDl+xBr08hkzfwyT1v7AUqRLe8LA/JBEqYRGnjSSZlm7HSupKZP4 kHSC3dCXl1AOe1JqIVJUCn2LAa/JL3aUTxMbSorGQVgHEfoWjy1d0qyFMeiYhNMMl1DN 5/kA== 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:date; bh=HMYIhqj4IySbVs9eyRcr/TA/SKSM9z2jT11pdJqToxU=; b=wHytKq5ttsMPFyuyu+UpGL7B1WEjP6aXBjQkuMvJfQcmdqaIlWb9WNPvYBVzsEtwPJ h0PxT1Kc3R1peqw5+puIPMKhO5OqFm+TAJQdYcPk6rVjeGhlvWXban+QTIxP4lvcPBK7 LqKqHxrsvdqgeYZf1Iv02Nrmzvw5n9jstm4XD+FYw7KBP9PgzY7U7opMI0QLOlFjnDHe LXubsjlVIoyEASfQ7O6kjwFB37G084k04sAj9aQTZyzqtA5FTGt00kUKjeR3FCpJTUxT +j4jVqGqtZlxgBQ1u7iOYpZEp4Kq1HRpbUPOTj126AJ3uLSZoga33fj6eckZ73DQ50Bj HyhA== ARC-Authentication-Results: i=1; mx.google.com; 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 l184-20020a6388c1000000b005343c3db9ebsi7027113pgd.616.2023.05.23.13.33.31; Tue, 23 May 2023 13:33:46 -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; 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 S238516AbjEWUNt (ORCPT + 99 others); Tue, 23 May 2023 16:13:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbjEWUNs (ORCPT ); Tue, 23 May 2023 16:13:48 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8D3BB11D; Tue, 23 May 2023 13:13:45 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 34NKCcxC014675; Tue, 23 May 2023 22:12:38 +0200 Date: Tue, 23 May 2023 22:12:38 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Zhangjin Wu 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=iso-8859-1 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=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 Hi Thomas, Zhangjin, I merged and pushed this series on top of the previous series, it's in branch 20230523-nolibc-rv32+stkp3. However, Thomas, I found an issue with this last patch that I partially reverted in a last patch I pushed as well so that we can discuss it: On Sun, May 21, 2023 at 11:36:35AM +0200, Thomas Wei?schuh wrote: > > -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)) By doing so, we reintroduce the forced stack-protector mechanism that cannot be disabled anymore. The ability to disable it was the main point of the options above. In fact checking __SSP__* was a solution to save the user from having to set -DNOLIBC_STACKPROTECTOR to match their compiler's flags, but here in the nolibc-test we still want to be able to forcefully disable stkp for a run (at least to unbreak gcc-9, and possibly to confirm that non-stkp builds still continue to work when your local toolchain has it by default). So I reverted that part and only dropped -DNOLIBC_STACKPROTECTOR. This way I could run the test on all archs with gcc-9 by forcing CFLAGS_STACKPROTECTOR= and verified it was still possible to disable it for a specific arch only by setting CFLAGS_STKP_$ARCH. If you're fine with this we can squash this one into your cleanup patch. Zhangjin I think this branch should work well enough for you to serve as a base for your upcoming series. We'll clean it up later once we all agree on the stat() replacement for syscall() and on the various remaining points including your time32 alternatives. Thanks to you both, Willy PS: we're still carrying a long CC list of individuals who are likely not that much interested in our discussion, I propose that we trim it on next exchanges and only keep us 3 and the lists, in order to remove some of their e-mail pollution.