From patchwork Tue Mar 27 05:29:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 132437 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp4653428ljb; Mon, 26 Mar 2018 22:32:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx49v8J8lRjul8+Ie73RSOjjbjx3Ve3fPeGgry8gB4RM6rJO4z+AhnhnK2evLnolQPm6byqXC X-Received: by 10.98.212.67 with SMTP id u3mr915584pfl.58.1522128731088; Mon, 26 Mar 2018 22:32:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522128731; cv=none; d=google.com; s=arc-20160816; b=uoj9KLqX+8pU88W0O3t28PYtCw17PC8y/445CWb/4oB0krutOKayxZGsb1hN9mkx1x rLrEbG//j5cPvgxtt+zCJa1HNaN+b2tVehKlgCp3fA2ghDcy7PfGB4ZKezV3DRDnZKn5 MwBmGRlf2NTfkql6po/RzFvpNgJMgnCjXFHdkLnnndrGrNZulD3GM67al79AAzVV3UR9 qoWlqHHwWYIPao+lMTyaFZKsW4HnBXGDOg85z+xI81hH8NysLWOlb48cKAA7qSKClTxs 6AUhTZ9jSC+Yaf1f4TW7pUu82SjAtDogbpsXKF1ph7zxBL8T0lE1AZtvP8jQ79NMANqB faoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=6WjQL00enGkVi5o0NmgKQEyQtdjD15+bMKSxvKuX21Q=; b=fQnv+UhuXzAQ84Qr2/0wbBckY1c2XNdbg0sKtO9dGTayJODcp+XRcGsXguboZifsHL 61AjT4s5aZmByWGv1lEwCua9u7Pa5HnD/Vkm/lfONHyrR07PpOMByYhIk6bUHf5nGOYl BKEyWmQ2g/34zlwZzxYbUF3G2hlyI6NfCApCv+yWp8dOQQE4GX+LuQww0pKxvYQQJ41i a0F7UNSySQWICRfSuqXqLfrxCbqRvyPhkCKNNBe5tdXBLYgolQ13ZlG6GtGMX+iqOn1I KjdQUox0mbuilWv414NeAzW5Y/6jxGIUxwtdt8qA7ffnpWht9JY+Zf3juulOC1EUAwEu ig8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=hWZA5rAg; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15-v6si532544plj.701.2018.03.26.22.32.10; Mon, 26 Mar 2018 22:32:11 -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=@nifty.com header.s=dec2015msa header.b=hWZA5rAg; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752138AbeC0FcG (ORCPT + 28 others); Tue, 27 Mar 2018 01:32:06 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:44594 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751824AbeC0FcA (ORCPT ); Tue, 27 Mar 2018 01:32:00 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id w2R5TaLt011947; Tue, 27 Mar 2018 14:29:49 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com w2R5TaLt011947 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1522128590; bh=6WjQL00enGkVi5o0NmgKQEyQtdjD15+bMKSxvKuX21Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hWZA5rAgTdtyQlLHlLR8bImQVEDz+6RHMxv4k44d0mU4URPF2saV+jcl4Watm6WbU 3YZqviUtjodS+j6r5KZ+m+zkD19Pv4AaL3fjvVgRbqIZ+2fEV4PHovZCmIxUBSv88+ cZ91CDirSz9Bjuy4rWs0mD9WxqCKdyZKKafvIQ6aNKg1uCQGamL2fuLaMp+iXYFroB WtJUFWALvbwoLPOYpKOYOIv2Pag32mvqNYC/fyfXpgquiY1pZsCIP3xMQc9GzDLJUC NMax/GPJSwaFZv4pOrC3oVRQnATNb0R6LubYWVuzXiZPM9AkltiCrMAB72m80FUIhF SdviJmqJDT4Xg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Linus Torvalds , Arnd Bergmann , Ulf Magnusson , Kees Cook , Thomas Gleixner , Greg Kroah-Hartman , Randy Dunlap , "Luis R . Rodriguez" , Nicolas Pitre , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v2 10/21] kconfig: add 'success' and 'cc-option' macros Date: Tue, 27 Mar 2018 14:29:24 +0900 Message-Id: <1522128575-5326-11-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522128575-5326-1-git-send-email-yamada.masahiro@socionext.com> References: <1522128575-5326-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'cc-option' will be the most frequently used macro. It evaluates to 'y' if the given argument is supported by the compiler, or 'n' otherwise. Signed-off-by: Masahiro Yamada --- Changes in v2: - Implement 'success' as a macro init/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.7.4 Reviewed-by: Kees Cook Reviewed-by: Ulf Magnusson diff --git a/init/Kconfig b/init/Kconfig index 0d6fe20..c456030 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -8,6 +8,12 @@ config DEFCONFIG_LIST default ARCH_DEFCONFIG default "arch/$ARCH/defconfig" +# expanded to y if the command exits with 0, n otherwise +macro success $(shell ($(1) && echo y) || echo n) + +# expanded to y if the given compiler flag is supported, n otherwise +macro cc-option $(success $CC -Werror $(1) -c -x c /dev/null -o /dev/null) + config CONSTRUCTORS bool depends on !UML