From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752482AbdBOSzy (ORCPT ); Wed, 15 Feb 2017 13:55:54 -0500 Received: from magic.merlins.org ([209.81.13.136]:45868 "EHLO mail1.merlins.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751654AbdBOSzx (ORCPT ); Wed, 15 Feb 2017 13:55:53 -0500 Date: Wed, 15 Feb 2017 10:55:48 -0800 From: Marc MERLIN To: Josh Poimboeuf Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Jessica Yu , Michal Marek Message-ID: <20170215185548.zhjunwvzbdjsfsd6@merlins.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sysadmin: BOFH X-URL: http://marc.merlins.org/ User-Agent: NeoMutt/20160916 (1.7.0) X-SA-Exim-Connect-IP: 173.11.111.145 X-SA-Exim-Mail-From: marc@merlins.org X-Spam-Report: * 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) * -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Subject: Re: [PATCH] objtool: fix CONFIG_STACK_VALIDATION warning for out-of-tree modules Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 15, 2017 at 12:21:17PM -0600, Josh Poimboeuf wrote: > 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. > > Reported-by: Marc MERLIN > Suggested-by: Jessica Yu > Fixes: 3b27a0c85d70 ("objtool: Detect and warn if libelf is missing and don't break the build") > Signed-off-by: Josh Poimboeuf Tested-By: Marc MERLIN saruman:/usr/src/linux-block# dpkg --remove libelf-dev saruman:/usr/src/linux-block/tools/objtool# make clean saruman:/usr/src/linux-block# dkms install bbswitch/0.8 Kernel preparation unnecessary for this kernel. Skipping... Building module: cleaning build area... make -j8 KERNELRELEASE=4.10.0-rc7-mm3kb1+ KVERSION=4.10.0-rc7-mm3kb1+...(bad exit status: 2) Error! Bad return status for module build on kernel: 4.10.0-rc7-mm3kb1+ (x86_64) saruman:/usr/src/linux-block# patch -p1 -s < objtool.patch saruman:/usr/src/linux-block# dkms install bbswitch/0.8 Kernel preparation unnecessary for this kernel. Skipping... Building module: cleaning build area... make -j8 KERNELRELEASE=4.10.0-rc7-mm3kb1+ KVERSION=4.10.0-rc7-mm3kb1+... cleaning build area... DKMS: build completed. bbswitch.ko: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/4.10.0-rc7-mm3kb1+/updates/dkms/ depmod... DKMS: install completed. All good, thank you. Marc -- "A mouse is a device used to point at the xterm you want to type in" - A.S.R. Microsoft is to operating systems .... .... what McDonalds is to gourmet cooking Home page: http://marc.merlins.org/ | PGP 1024R/763BE901