From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752420AbcDVJqf (ORCPT ); Fri, 22 Apr 2016 05:46:35 -0400 Received: from terminus.zytor.com ([198.137.202.10]:36626 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314AbcDVJqc (ORCPT ); Fri, 22 Apr 2016 05:46:32 -0400 Date: Fri, 22 Apr 2016 02:45:03 -0700 From: tip-bot for Steven Rostedt Message-ID: Cc: torvalds@linux-foundation.org, rostedt@goodmis.org, mmarek@suse.cz, hpa@zytor.com, bernd@petrovitsch.priv.at, palves@redhat.com, acme@kernel.org, luto@kernel.org, mingo@kernel.org, chris.j.arges@canonical.com, bp@alien8.de, peterz@infradead.org, tglx@linutronix.de, akpm@linux-foundation.org, namhyung@gmail.com, jpoimboe@redhat.com, linux-kernel@vger.kernel.org, jslaby@suse.cz Reply-To: torvalds@linux-foundation.org, rostedt@goodmis.org, mmarek@suse.cz, hpa@zytor.com, bernd@petrovitsch.priv.at, palves@redhat.com, acme@kernel.org, luto@kernel.org, mingo@kernel.org, chris.j.arges@canonical.com, bp@alien8.de, peterz@infradead.org, tglx@linutronix.de, akpm@linux-foundation.org, namhyung@gmail.com, jpoimboe@redhat.com, jslaby@suse.cz, linux-kernel@vger.kernel.org In-Reply-To: <20160420153234.GA24032@home.goodmis.org> References: <20160420153234.GA24032@home.goodmis.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/urgent] objtool: Fix Makefile to properly see if libelf is supported Git-Commit-ID: c2bb9e32e2315971a8535fee77335c04a739d71d 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: c2bb9e32e2315971a8535fee77335c04a739d71d Gitweb: http://git.kernel.org/tip/c2bb9e32e2315971a8535fee77335c04a739d71d Author: Steven Rostedt AuthorDate: Wed, 20 Apr 2016 11:32:35 -0400 Committer: Ingo Molnar CommitDate: Fri, 22 Apr 2016 09:00:57 +0200 objtool: Fix Makefile to properly see if libelf is supported When doing a make allmodconfig, I hit the following compile error: In file included from builtin-check.c:32:0: elf.h:22:18: fatal error: gelf.h: No such file or directory compilation terminated. ... Digging into it, it appears that the $(shell ..) command in the Makefile does not give the proper result when it fails to find -lelf, and continues to compile objtool. Instead, use the "try-run" makefile macro to perform the test. This gives a proper result for both cases. Signed-off-by: Steven Rostedt Acked-by: Josh Poimboeuf Cc: Andrew Morton Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Bernd Petrovitsch Cc: Borislav Petkov Cc: Chris J Arges Cc: Jiri Slaby Cc: Linus Torvalds Cc: Michal Marek Cc: Namhyung Kim Cc: Pedro Alves Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: live-patching@vger.kernel.org Fixes: 442f04c34a1a4 ("objtool: Add tool to perform compile-time stack metadata validation") Link: http://lkml.kernel.org/r/20160420153234.GA24032@home.goodmis.org Signed-off-by: Ingo Molnar --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1d0aef0..70ca38e 100644 --- a/Makefile +++ b/Makefile @@ -1008,7 +1008,8 @@ prepare0: archprepare FORCE prepare: prepare0 prepare-objtool ifdef CONFIG_STACK_VALIDATION - has_libelf := $(shell echo "int main() {}" | $(HOSTCC) -xc -o /dev/null -lelf - &> /dev/null && echo 1 || echo 0) + 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