Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3527632imm; Mon, 13 Aug 2018 13:23:36 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxwLfdJSfTXAP0fboshrK6PA0QK9Kwx6nCrc+YNAHeR22ToiPheKBee5r8wskZRMpTWxNtM X-Received: by 2002:a17:902:7b83:: with SMTP id w3-v6mr17638472pll.192.1534191816694; Mon, 13 Aug 2018 13:23:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534191816; cv=none; d=google.com; s=arc-20160816; b=ioO21Q0MwnIuLgUtfQreSnoQ9vagay13YuXBuySO5DpqsnsCrF4mGegodVxvRfrNLO x/bHaTM5O24xEZc1Jo+K3ths6ZdsPVhuO2x7JuCehQXRos4B7Pne62w0N7WraA72mjUu ZSRhiEJ3cXc9vPLMBsbc8HralErEJnSWqWo6Pj9lcoRNomd2PQFofPu4Jmi/aF+454yi GNMeZb3Zt2HCuEMa0yvZ5zAx5i/0Cj525GpHXRugP13WI/SjVLCfAW/ANa37TOwdRLhu xquBtCM4zf2w7FvBWbdtC1xJ40nvzho5m25HuMOOMROkr/LpCwNDuV3AhNQJwNqP1M8r lHYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=4llhmx8dM+NoO6zXFNJEAeJZh3bIqLi9zO1XxXSdFPk=; b=YbeZ9i9+90IyO7COROdTLC9gbN6CxQ/xvyeXMudx/k13v+yKkZHR/jC9Dw35yZyRZJ ImOYoQFhf7USie75Ut0Nkd/qOXcCdt39R12nWnS2ux0OXEifgPuMnp2tH7Rya6Yy+70r ILKbn8nluZqnyn5PeUrqU3YfOihDbBcAOqRBq0XGXrieuFMJ4cLoh2RXkIH27qZOkl7C oFbb06a5a1wOqOUUM0a/w5iMSOXXgjJxIXIY/hs16VJ64LKghMzBY7JKJb/FVgKNOCAV N6OW/1XyJ0b43AIrGuphZ5C08ZKUr8dL1Z76aeQ152F92YBebgBJfjv2ViHHnY05hjlH FX8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ExXGgyWG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q20-v6si17228096pgl.573.2018.08.13.13.23.21; Mon, 13 Aug 2018 13:23:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ExXGgyWG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729923AbeHMXCL (ORCPT + 99 others); Mon, 13 Aug 2018 19:02:11 -0400 Received: from mail-yw1-f67.google.com ([209.85.161.67]:40930 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728540AbeHMXCL (ORCPT ); Mon, 13 Aug 2018 19:02:11 -0400 Received: by mail-yw1-f67.google.com with SMTP id z143-v6so14540805ywa.7 for ; Mon, 13 Aug 2018 13:18:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4llhmx8dM+NoO6zXFNJEAeJZh3bIqLi9zO1XxXSdFPk=; b=ExXGgyWG9nnbjrWXo3gQYy74eXBDeZQwgp4g385ZcInUpSg2Jw3yM73pXxYK8ufSbF cstbSn/W13iWZGihtcpsqu1O+EE4oTzKlgGb3SzMEh1eAIAynB69LGr2V3xIK+1qxf9L TnCzdsD3k/h1R0YdwYgSs3b0mtCjdg8m1EhY4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4llhmx8dM+NoO6zXFNJEAeJZh3bIqLi9zO1XxXSdFPk=; b=JZtgRsBktCD5mFB7mts6m90RrmxqZfaFKfgNva8svZm/lt7bsRB/4wE6aHkgWPTUvZ ub+G8FbKphU9c0IOPBiJqzMKSILUl7oUIMRzgUYmkvPL0CxHsBbhxfUHa+ufE49EdWD4 TCqTzEpP9qO0JdQVkf/5IkGrOXOlEYdZuyNbWayuwSSaV7HPGP3ZmSt0dmFrlq8srj5j U4hjAr2OiF9LrmKBPIphclKsJDo0lxDMcwOoX+pC4zJQQhh1ag8+yfLS/XpFNFu4fxAY NeIxnb8ojdcD0D/ul6j/LJHlPWbuh0K50GZBjHfdG7z2Opw8tIN+biFlcTesVJifm5ox WsXA== X-Gm-Message-State: AOUpUlHBZix/rGmKyfZ6jn6/Pnp+gJMwPIndu7PL3M4ttBaenAsAhOLq fXU/VBL9VIJoZzOOvcG70eohwOEFEwE= X-Received: by 2002:a81:9251:: with SMTP id j78-v6mr10897631ywg.5.1534191505531; Mon, 13 Aug 2018 13:18:25 -0700 (PDT) Received: from mail-yw1-f42.google.com (mail-yw1-f42.google.com. [209.85.161.42]) by smtp.gmail.com with ESMTPSA id 21-v6sm8453894ywf.79.2018.08.13.13.18.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 13:18:24 -0700 (PDT) Received: by mail-yw1-f42.google.com with SMTP id r3-v6so14551765ywc.5 for ; Mon, 13 Aug 2018 13:18:23 -0700 (PDT) X-Received: by 2002:a25:af4a:: with SMTP id c10-v6mr10728529ybj.463.1534191503289; Mon, 13 Aug 2018 13:18:23 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:2316:0:0:0:0:0 with HTTP; Mon, 13 Aug 2018 13:18:22 -0700 (PDT) In-Reply-To: References: <20180811094853.32167-1-stefan@agner.ch> From: Kees Cook Date: Mon, 13 Aug 2018 13:18:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] gcc-plugins: require GCC To: Masahiro Yamada Cc: Stefan Agner , Alexei Starovoitov , Andrew Morton , Josef Bacik , Emese Revfy , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 13, 2018 at 1:10 PM, Kees Cook wrote: > On Mon, Aug 13, 2018 at 12:38 AM, Masahiro Yamada > wrote: >> 2018-08-11 18:48 GMT+09:00 Stefan Agner : >>> Unsurprisingly GCC plugins require GCC as a compiler. This avoids >>> GCC plugins being selectable when using clang. >>> >>> Signed-off-by: Stefan Agner >>> --- >>> arch/Kconfig | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/arch/Kconfig b/arch/Kconfig >>> index 1aa59063f1fd..8c693a837ed7 100644 >>> --- a/arch/Kconfig >>> +++ b/arch/Kconfig >>> @@ -422,7 +422,7 @@ config HAVE_GCC_PLUGINS >>> >>> menuconfig GCC_PLUGINS >>> bool "GCC plugins" >>> - depends on HAVE_GCC_PLUGINS >>> + depends on HAVE_GCC_PLUGINS && CC_IS_GCC >>> depends on PLUGIN_HOSTCC != "" >>> help >>> GCC plugins are loadable modules that provide extra features to the >>> -- >>> 2.18.0 >>> >> >> I guess the more correct way is to fix >> scripts/gcc-plugin.sh >> >> This shell script should exit 0 >> only when GCC plugin is supported. > > I'm of two minds: we already have the gcc test in Kconfig so we might > want to avoid redundant checks, but maybe the script should be a > "complete" test. I guess the latter. I will send a patch. Actually, how about we do the test in Kconfig, but ahead of the script? That will reduce redundancy: diff --git a/arch/Kconfig b/arch/Kconfig index 1aa59063f1fd..18f518624e41 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -409,7 +409,7 @@ preferred-plugin-hostcc := $(if-success,[ $(gcc-version) -ge 40800 ],$(HOSTCXX), config PLUGIN_HOSTCC string - default "$(shell,$(srctree)/scripts/gcc-plugin.sh "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")" + default "$(shell,$(srctree)/scripts/gcc-plugin.sh "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")" if CC_IS_GCC help Host compiler used to build GCC plugins. This can be $(HOSTCXX), $(HOSTCC), or a null string if GCC plugin is unsupported. -Kees -- Kees Cook Pixel Security