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 <m...@merlins.org> > Suggested-by: Jessica Yu <j...@redhat.com> > Fixes: 3b27a0c85d70 ("objtool: Detect and warn if libelf is missing and don't > break the build") > Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com>
Tested-By: Marc MERLIN <m...@merlins.org> 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