From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752367AbdBTJm7 (ORCPT ); Mon, 20 Feb 2017 04:42:59 -0500 Received: from terminus.zytor.com ([65.50.211.136]:33926 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750920AbdBTJm5 (ORCPT ); Mon, 20 Feb 2017 04:42:57 -0500 Date: Mon, 20 Feb 2017 01:13:49 -0800 From: tip-bot for Josh Poimboeuf Message-ID: Cc: marc@merlins.org, mmarek@suse.com, hpa@zytor.com, jeyu@redhat.com, mingo@kernel.org, torvalds@linux-foundation.org, peterz@infradead.org, jpoimboe@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de Reply-To: torvalds@linux-foundation.org, mingo@kernel.org, jeyu@redhat.com, hpa@zytor.com, marc@merlins.org, mmarek@suse.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, jpoimboe@redhat.com, peterz@infradead.org In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:core/urgent] objtool: Fix CONFIG_STACK_VALIDATION=y warning for out-of-tree modules Git-Commit-ID: 9f0c18aec620bc9d82268b3cb937568dd07b43ff X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 9f0c18aec620bc9d82268b3cb937568dd07b43ff Gitweb: http://git.kernel.org/tip/9f0c18aec620bc9d82268b3cb937568dd07b43ff Author: Josh Poimboeuf AuthorDate: Wed, 15 Feb 2017 12:21:17 -0600 Committer: Ingo Molnar CommitDate: Mon, 20 Feb 2017 09:49:34 +0100 objtool: Fix CONFIG_STACK_VALIDATION=y warning for out-of-tree modules When building a CONFIG_STACK_VALIDATION enabled kernel without the libelf devel package installed, the Makefile prints a warning: "Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel" But when building an out-of-tree module, the warning doesn't show. Instead it tries to use objtool, and the build fails with: /bin/sh: ./tools/objtool/objtool: No such file or directory Make sure the warning and the disabling of objtool occur in all cases, by moving the CONFIG_STACK_VALIDATION checks outside the 'ifeq ($(KBUILD_EXTMOD),)' block in the Makefile. Tested-By: Marc MERLIN Suggested-by: Jessica Yu Reported-by: Marc MERLIN Signed-off-by: Josh Poimboeuf Reviewed-by: Jessica Yu Cc: Linus Torvalds Cc: Michal Marek Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: 3b27a0c85d70 ("objtool: Detect and warn if libelf is missing and don't break the build") Link: http://lkml.kernel.org/r/b3088ae4a8698143d4851965793c61fec2135b1f.1487182864.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar --- Makefile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index f1e6a02..32c8457 100644 --- a/Makefile +++ b/Makefile @@ -908,6 +908,18 @@ mod_sign_cmd = true endif export mod_sign_cmd +ifdef CONFIG_STACK_VALIDATION + has_libelf := $(call try-run,\ + echo "int main() {}" | $(HOSTCC) -xc -o /dev/null -lelf -,1,0) + ifeq ($(has_libelf),1) + objtool_target := tools/objtool FORCE + else + $(warning "Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel") + SKIP_STACK_VALIDATION := 1 + export SKIP_STACK_VALIDATION + endif +endif + ifeq ($(KBUILD_EXTMOD),) core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/ @@ -1035,18 +1047,6 @@ prepare0: archprepare gcc-plugins # All the preparing.. prepare: prepare0 prepare-objtool -ifdef CONFIG_STACK_VALIDATION - has_libelf := $(call try-run,\ - echo "int main() {}" | $(HOSTCC) -xc -o /dev/null -lelf -,1,0) - ifeq ($(has_libelf),1) - objtool_target := tools/objtool FORCE - else - $(warning "Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel") - SKIP_STACK_VALIDATION := 1 - export SKIP_STACK_VALIDATION - endif -endif - PHONY += prepare-objtool prepare-objtool: $(objtool_target)