From patchwork Tue Dec 18 05:25:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10734835 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 11A9D13B5 for ; Tue, 18 Dec 2018 05:26:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F31E629582 for ; Tue, 18 Dec 2018 05:26:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E330A2A52B; Tue, 18 Dec 2018 05:26:32 +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,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 5219429582 for ; Tue, 18 Dec 2018 05:26:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726365AbeLRF0b (ORCPT ); Tue, 18 Dec 2018 00:26:31 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:59785 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726322AbeLRF0b (ORCPT ); Tue, 18 Dec 2018 00:26:31 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id wBI5PoZA030731; Tue, 18 Dec 2018 14:25:50 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com wBI5PoZA030731 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1545110751; bh=WhkTIvnxrA5Lys7ML7oerDPj21OzgOyOFM6M3SRkHao=; h=From:To:Cc:Subject:Date:From; b=t4H5J+WPWqoXvf2Ha5nwqAQEXDYAg3OkpZt/GhwZbxJQemC5UYsnWJgflCUX+R5+E V2Bq7uM4708naZmMbT3qKW9alVE3304bOnucYT6vW7NG88YyhsUO14aWrl0hp6U1aK SQKHpaFvzKTlt/8ntrQ+LOLUNSwE/8bdXBq13S5q15hPVa7baLb0F3luZZt5s4hNLV oTCmy/ElNiGGB62LIPaR1b9Q1p5DqS9Y1kysLDc1dlmneyt9Dfk8XhIFw4IB2B/I/8 1PnKYJqU3y9nH6e7ZTvjvhTRpCY5nRdJuiunhRDKrBLuBMpvfuTGPe2FJUTFk8RQ9u mCHEglNA+rmcw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Paul Gortmaker , Bernd Edlinger , Qian Cai , Masahiro Yamada , Josh Poimboeuf , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: fix false positive warning/error about missing libelf Date: Tue, 18 Dec 2018 14:25:41 +0900 Message-Id: <1545110741-10761-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For the same reason as commit 25896d073d8a ("x86/build: Fix compiler support check for CONFIG_RETPOLINE"), you cannot put this $(error ...) into the parse stage of the top Makefile. Perhaps I'd propose a more sophisticated solution later, but this is the best I can do for now. Link: https://lkml.org/lkml/2017/12/25/211 Reported-by: Paul Gortmaker Reported-by: Bernd Edlinger Reported-by: Qian Cai Cc: Josh Poimboeuf Signed-off-by: Masahiro Yamada Tested-by: Qian Cai --- Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 56d5270..d45856f 100644 --- a/Makefile +++ b/Makefile @@ -962,11 +962,6 @@ ifdef CONFIG_STACK_VALIDATION ifeq ($(has_libelf),1) objtool_target := tools/objtool FORCE else - ifdef CONFIG_UNWINDER_ORC - $(error "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel") - else - $(warning "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel") - endif SKIP_STACK_VALIDATION := 1 export SKIP_STACK_VALIDATION endif @@ -1125,6 +1120,14 @@ uapi-asm-generic: PHONY += prepare-objtool prepare-objtool: $(objtool_target) +ifeq ($(SKIP_STACK_VALIDATION),1) +ifdef CONFIG_UNWINDER_ORC + @echo "error: Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2 + @false +else + @echo "warning: Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2 +endif +endif # Generate some files # ---------------------------------------------------------------------------