From patchwork Fri Feb 21 07:42:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 230845 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 314C6C35641 for ; Fri, 21 Feb 2020 08:26:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 05DE320679 for ; Fri, 21 Feb 2020 08:26:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273604; bh=vz5gTBeqfS9iKhsuyNNi+PbAPPat9tNnC+F6SHigKak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ktvzMk6kA9eqfkz7ZFRyrhHiNHm/IlnUNB2KD4roXgYW4U9dELuQJXoONht63shc1 vC9rqrlbW+P7bxvbxpVLjPP2RE9jhDfPEKWNrk2NSDa2msTe2Y6IN30jYlGYYib3Ex Kc9s/s5lEoMEwyxRhGWjj3c2sTZ03YwE2rG+t+xw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388419AbgBUIXG (ORCPT ); Fri, 21 Feb 2020 03:23:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:34982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388417AbgBUIXG (ORCPT ); Fri, 21 Feb 2020 03:23:06 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2C9E92467A; Fri, 21 Feb 2020 08:23:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273385; bh=vz5gTBeqfS9iKhsuyNNi+PbAPPat9tNnC+F6SHigKak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oR8m9N1S1SuOINum0ywTBy/D1VKSvsaJmxRWB26UCaeDamHDGUmqr9BznWkm/CBAu jhhRNju3O5NeClY4DTXRQXbjMnXUE4tVnfiIVgSpPIB+RpQmJQvCcbIcLQBflfPhBz javFmg+4BYBUo9z3pO7xtK7J4Dcest3w4Nv09S6o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Sasha Levin Subject: [PATCH 4.19 151/191] kbuild: use -S instead of -E for precise cc-option test in Kconfig Date: Fri, 21 Feb 2020 08:42:04 +0100 Message-Id: <20200221072308.858375369@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072250.732482588@linuxfoundation.org> References: <20200221072250.732482588@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada [ Upstream commit 3bed1b7b9d79ca40e41e3af130931a3225e951a3 ] Currently, -E (stop after the preprocessing stage) is used to check whether the given compiler flag is supported. While it is faster than -S (or -c), it can be false-positive. You need to run the compilation proper to check the flag more precisely. For example, -E and -S disagree about the support of "--param asan-instrument-allocas=1". $ gcc -Werror --param asan-instrument-allocas=1 -E -x c /dev/null -o /dev/null $ echo $? 0 $ gcc -Werror --param asan-instrument-allocas=1 -S -x c /dev/null -o /dev/null cc1: error: invalid --param name ‘asan-instrument-allocas’; did you mean ‘asan-instrument-writes’? $ echo $? 1 Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- scripts/Kconfig.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include index 3b2861f47709b..79455ad6b3863 100644 --- a/scripts/Kconfig.include +++ b/scripts/Kconfig.include @@ -20,7 +20,7 @@ success = $(if-success,$(1),y,n) # $(cc-option,) # Return y if the compiler supports , n otherwise -cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -E -x c /dev/null -o /dev/null) +cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -S -x c /dev/null -o /dev/null) # $(ld-option,) # Return y if the linker supports , n otherwise