From patchwork Wed Nov 7 09:40:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 10672037 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E80F1923 for ; Wed, 7 Nov 2018 09:40:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FD612B936 for ; Wed, 7 Nov 2018 09:40:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03A072B944; Wed, 7 Nov 2018 09:40:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A340F2B93F for ; Wed, 7 Nov 2018 09:40:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726283AbeKGTJy (ORCPT ); Wed, 7 Nov 2018 14:09:54 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:47470 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726097AbeKGTJx (ORCPT ); Wed, 7 Nov 2018 14:09:53 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AC0691596; Wed, 7 Nov 2018 01:40:20 -0800 (PST) Received: from login2.euhpc.arm.com (login2.euhpc.arm.com [10.6.27.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2B1CD3F718; Wed, 7 Nov 2018 01:40:19 -0800 (PST) From: Vladimir Murzin To: linux-arm-kernel@lists.infradead.org Cc: yamada.masahiro@socionext.com, linux-crypto@vger.kernel.org, linux-kbuild@vger.kernel.org, kbuild-all@01.org, Will Deacon , Marc Zyngier , Ard Biesheuvel Subject: [RFC PATCH 1/4] kconfig: add as-instr macro to scripts/Kconfig.include Date: Wed, 7 Nov 2018 09:40:05 +0000 Message-Id: <1541583608-26375-2-git-send-email-vladimir.murzin@arm.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1541583608-26375-1-git-send-email-vladimir.murzin@arm.com> References: <1541583608-26375-1-git-send-email-vladimir.murzin@arm.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are cases where the whole feature, for instance arm64/lse or arm/crypto, can depend on assembler. Current practice is to report buildtime that selected feature is not supported, which can be quite annoying... It'd nicer if we can check assembler first and opt-in feature visibility in Kconfig. Cc: Masahiro Yamada Cc: Will Deacon Cc: Marc Zyngier Cc: Ard Biesheuvel Signed-off-by: Vladimir Murzin --- scripts/Kconfig.include | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include index dad5583..07c145c 100644 --- a/scripts/Kconfig.include +++ b/scripts/Kconfig.include @@ -22,6 +22,10 @@ success = $(if-success,$(1),y,n) # Return y if the compiler supports , n otherwise cc-option = $(success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/null) +# $(as-instr,) +# Return y if the assembler supports , n otherwise +as-instr = $(success,printf "%b\n" "$(1)" | $(CC) -Werror -c -x assembler -o /dev/null -) + # $(ld-option,) # Return y if the linker supports , n otherwise ld-option = $(success,$(LD) -v $(1))