From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9786C433FF for ; Mon, 29 Jul 2019 14:23:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE112206DD for ; Mon, 29 Jul 2019 14:23:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="k86W0aoh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727567AbfG2OXm (ORCPT ); Mon, 29 Jul 2019 10:23:42 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:37974 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726738AbfG2OXl (ORCPT ); Mon, 29 Jul 2019 10:23:41 -0400 Received: by mail-pg1-f196.google.com with SMTP id f5so19530392pgu.5 for ; Mon, 29 Jul 2019 07:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=message-id:mime-version:content-transfer-encoding:in-reply-to :references:from:to:subject:cc:user-agent:date; bh=kqUnPKiz6VvTqc0+3BE84kZ35KLnOhXxMY+yopDUPhY=; b=k86W0aohKTIyLzBKu/wc2N16ENz7QVuJCm9eOV3rf+vXz48wbkR6TSL3KnMNu+Qg9u QwKbRBGZVkYTYR7rmUEX9cVlei8WTfWGVGQeVr42nqCKd7VzgcrsSLCm88DonZsNdxaY e9jZiEiFJMVjy054rF8KvLZqdz94yA3Q0rK/M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version :content-transfer-encoding:in-reply-to:references:from:to:subject:cc :user-agent:date; bh=kqUnPKiz6VvTqc0+3BE84kZ35KLnOhXxMY+yopDUPhY=; b=F0F+94Fg/maxnUSJaYBrBxIYewKYoglTPHlsHKnr6Kbx9xVdWKRS8DNOyNAfsJrWHv Dj9jDnutfYdMl6VxQz+ut+wxyNC+ZFpmh4sd1xPOXpB4DgAYpRViVOQDV0mBvVmIzhyU 5oPpnLWyfgmLxX3trDUGYuZxqvgyL2PE245gvINXiaSFb3og3dj9RwRXQkDQS5/48dMT FkdvBfH4p8ZX3XDNMDo0V8RZvZaQOX5gmrAJSTKZJxl/hXIerMgM2Hjbuk2BzsAn+x8Y NHG+pp/qlXeZcFy4j7fUiEspqkNL6j7euhLKokiRaH3vWiehiUsZ2URoqrTeICDGiY5A ct+g== X-Gm-Message-State: APjAAAXJMZUcr0LsqVdUT15ecHCxXIDiOMXxHp5y7vC8OfID1qqvXas8 PJFgpKuTlYLl8Bob+7IrOu51+Jgpd8w= X-Google-Smtp-Source: APXvYqw/PF2vE+zBYn0D8DUzj3HuB5GsG03DneqIHvSfRszws4YVVcUlAfy/9QpCj7nC6Zl53Whsmw== X-Received: by 2002:a63:5c07:: with SMTP id q7mr52206048pgb.436.1564410221179; Mon, 29 Jul 2019 07:23:41 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id y14sm11289667pge.7.2019.07.29.07.23.40 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 07:23:40 -0700 (PDT) Message-ID: <5d3f016c.1c69fb81.b4775.c7d0@mx.google.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20190725154730.80169-1-swboyd@chromium.org> From: Stephen Boyd To: Masahiro Yamada Subject: Re: [PATCH v2] kbuild: Check for unknown options with cc-option usage in Kconfig and clang Cc: Michal Marek , Linux Kernel Mailing List , Linux Kbuild mailing list , clang-built-linux , Peter Smith , Nathan Chancellor , Nick Desaulniers , Douglas Anderson User-Agent: alot/0.8.1 Date: Mon, 29 Jul 2019 07:23:39 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Masahiro Yamada (2019-07-29 03:02:40) >=20 > Thanks for catching this. >=20 > I wonder if we could fix this issue > by one-liner, like this: >=20 >=20 > diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include > index 8a5c4d645eb1..4bbf4fc163a2 100644 > --- a/scripts/Kconfig.include > +++ b/scripts/Kconfig.include > @@ -25,7 +25,7 @@ failure =3D $(if-success,$(1),n,y) >=20 > # $(cc-option,) > # Return y if the compiler supports , n otherwise > -cc-option =3D $(success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/nul= l) > +cc-option =3D $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -E -x c > /dev/null -o /dev/null) >=20 > # $(ld-option,) > # Return y if the linker supports , n otherwise >=20 >=20 >=20 > This propagates not only -Werror=3Dunknown-warning-option > but also other clang flags to Kconfig. >=20 >=20 > Currently, we do not pass the target triplet to Kconfig. > This means, cc-option in Kconfig evaluates the given flags > against host-arch instead of target-arch. > The compiler flags are mostly independent of the architecture, > and this is not a big deal, I think. > But, maybe, would it make more sense to pass the other > basic clang flags as well? >=20 Yes that also works and I had that earlier. I wanted to mirror what was done in scripts/Kbuild.include where there's a CC_OPTION_CFLAGS variable. I'm happy either way, so it's up to you.