Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5204532rwb; Tue, 6 Sep 2022 21:43:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR7TBlUC5c35cC1FFq/TgMBhQ6wg0AFre+lgkixpUV7js04x0efpa2XCuRT28eCVosKH3owx X-Received: by 2002:a17:903:187:b0:175:4e37:c294 with SMTP id z7-20020a170903018700b001754e37c294mr2080115plg.129.1662525817509; Tue, 06 Sep 2022 21:43:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662525817; cv=none; d=google.com; s=arc-20160816; b=giV4l6/bXIGKGddEoSQg5H6qahs3H8qP3R9W3wXOSfrNQ0vinK2C0cq2gYsN3ub30F sr181vXQHGkZqxGa/+z+t8dT1adfPblahQrufwB9EG6fZY2dBvjqn6de6LEFOOnl2m1I EW05HmMakjMeTuExmD2RgnfxHfpvJQeQdVl8vXqhGY2LKjpjTwWCUe1+zPpShMtI8r6/ ++Qn0Ko70KSE+6r6c2/nPUqtoEKUQuZGm8AEB1x1d84A4cZRLpBafWzsJUI/YgQ2mVEE lYVTqkP6oCCbDt/PS5zsFriMUS7T9GoNg68MPkpQF+HehRC/UY0DTjWLrbZHKxMKdr2t GMkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=1UbbBUkvxSBhRKBM4/+Em4xozDMjh5y0hIq+C6QbsRg=; b=cw81WGif4/dVn/HJ/B9Je6+aWN+98IKnWcKs+KfMFG1QZMi3soqMhZ8oeeJIxmLipI 4SMlgSXtLw30XltcClj1Ka+r3aha0nelL5pVfsIQ9g0iAd80TZUV1+55px5cciA1DBja kwozzYqgoEB9wVji0yP6S7j/vXuv/yHatXOWw8qa3hPFEv52dL6+ZCmwjM1sAt3WS7Q9 XX5ejqXb8Fh/EcQReWdzr8u2NO522qnRMvOYeLRQO4eDq98PfeQDRR3PyjKIMkxG3QaF 5scGABE+QgZ+zy17ZIuc3jeXoi6K+8AoSJWcfUv3mikv1lyVHZTrf0gdDULA1HXZEvNB CfsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=GXJMmUPs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h190-20020a6383c7000000b004301e6b2e94si10850646pge.602.2022.09.06.21.43.25; Tue, 06 Sep 2022 21:43:37 -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=@nifty.com header.s=dec2015msa header.b=GXJMmUPs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229783AbiIGE20 (ORCPT + 99 others); Wed, 7 Sep 2022 00:28:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbiIGE2X (ORCPT ); Wed, 7 Sep 2022 00:28:23 -0400 Received: from conssluserg-01.nifty.com (conssluserg-01.nifty.com [210.131.2.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE2D7923FD; Tue, 6 Sep 2022 21:28:21 -0700 (PDT) Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 2874S5uP030471; Wed, 7 Sep 2022 13:28:05 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 2874S5uP030471 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1662524885; bh=1UbbBUkvxSBhRKBM4/+Em4xozDMjh5y0hIq+C6QbsRg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GXJMmUPsQbYrp/qghqYA3gi9b1dY4MjZGQU5m1J9o4DuqFkrTU9WrUdz44bSDmP6s O1Tnx/oKIu4satumwvM4kzJQvyv+5BkO4AoS+IxSpzXrj/3C2Ll3PNyqBwVvzQSuLN 0q2emN+ml5NpkxVAK6YXKwDwNuo8fxtKg4rRWjEnshtLhwD3ReiutEBeyxF8W4noUc yVlgbFKD2GkNHdINB58XA/9EWlF01eFCrjKgtaWk6prc/RcMjTRZLSnJ4NM2ah4rAR yTpuFcFLNOPR2rxEn3b9G6k9vw3qMiJlogrxEeSDmMAEHd/rgJurtYrTrjXwZXxjeW ZVTYoW8A4w1Jg== X-Nifty-SrcIP: [209.85.210.46] Received: by mail-ot1-f46.google.com with SMTP id m21-20020a9d6ad5000000b00638df677850so9478577otq.5; Tue, 06 Sep 2022 21:28:05 -0700 (PDT) X-Gm-Message-State: ACgBeo0oFgMkCzAGdidcCuMpngmyNYtF/LhtAAyY4vTrnTQPEYUJCINR WN2Frrx7zcf3eoEpT7ESMQ+9RFLdQpFLvv1UKPg= X-Received: by 2002:a05:6830:658b:b0:63b:3501:7167 with SMTP id cn11-20020a056830658b00b0063b35017167mr715790otb.343.1662524884592; Tue, 06 Sep 2022 21:28:04 -0700 (PDT) MIME-Version: 1.0 References: <20220831184408.2778264-1-ndesaulniers@google.com> <20220831184408.2778264-3-ndesaulniers@google.com> In-Reply-To: From: Masahiro Yamada Date: Wed, 7 Sep 2022 13:27:28 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/5] Makefile.compiler: Use KBUILD_AFLAGS for as-option To: Nick Desaulniers Cc: Nathan Chancellor , Michal Marek , Tom Rix , Linux Kbuild mailing list , Linux Kernel Mailing List , clang-built-linux , X86 ML , Dmitrii Bundin , Fangrui Song , Alexey Alexandrov , Bill Wendling , Greg Thelen Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_SOFTFAIL, T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, Sep 7, 2022 at 12:12 PM Nick Desaulniers wrote: > > > > > > > > > > I also believe '-x assembler' should be changed to > > '-x assembler-with-cpp'. > > > > > > As I mentioned somewhere before, our assembly code (*.S) is always > > preprocessed. There is no *.s file in the kernel source tree. > > > > > > So, '-x assembler-with-cpp' matches the real situation. > > Should I do this for as-instr then as well? In the same patch? Probably we should fix as-instr in the same way. You can do it in the same patch, or in a separate one. It is up to you. > > > > > > One interesting thing is, clang does not warn > > [-Wunused-command-line-argument] for *.S files. > > > > > > > > > > $ clang -fomit-frame-pointer -c -x assembler /dev/null -o /dev/null > > clang: warning: argument unused during compilation: > > '-fomit-frame-pointer' [-Wunused-command-line-argument] > > > > $ clang -fomit-frame-pointer -c -x assembler-with-cpp /dev/null -o /dev/null > > > > > > > > The root cause is we are using '-x assembler', which > > never happens in the kernel tree. > > > > > > > > > > To sum up, the code I think correct is: > > > > > > as-option = $(call try-run,\ > > $(CC) -Werror $(KBUILD_AFLAGS) $(1) -c -x assembler-with-cpp > > /dev/null -o "$$TMP",$(1),$(2)) > > Does your recent patch affect this? > https://lore.kernel.org/linux-kbuild/20220905083619.672091-1-masahiroy@kernel.org/ No, I do not think so. > If so, then I should not add -Werror as you suggest above? I think we should always add -Werror to as-option. as-option checks the command line options with /dev/null as the source input (that is, source input is always valid). If as-option results in a warning, that option will sprinkle the same warning for all *.S files in the source tree. So, any warning in as-option should be considered as an error. -- Best Regards Masahiro Yamada