Re: 7.7.1 and building kernel modules ...
Hello hb,
Thanks a lot for your explanation, I have been puzzled by this for a
long time! It was only possible to build dkms packages for the 64bit
kernel with the complete source unpacked and linked to
/lib/modules/<version>/build, which I did to work around the problem.
I think there is a bug in kernel-package that causes objtool not to be
build or included in the kernel-headers package, since I also get a lot
of "bash"-related parse errors during build. However, Packages for
kernel and headers seem to be built correctly, I was just not aware of
objtool missing.
Even more annoying, the problem did not appear for the 32bit kernel
version. Now I know this was only the case because
CONFIG_STACK_VALIDATION just wasn't set there.
I fixed the problem now by generally disabling that option. Thanks again
for your finding!
Regards
-Klaus
On 03.01.17, hb wrote:
> ... by default fails, like
>
> $ make
> make -C /lib/modules/4.7.9-64/build M=/home/knoppix/demo modules
> make[1]: Entering directory '/usr/src/linux-headers-4.7.9-64'
> make[2]: *** No rule to make target 'tools/objtool/objtool', needed by
> '/home/knoppix/demo/hello.o'. Stop.
> Makefile:1458: recipe for target '_module_/home/knoppix/demo' failed
> make[1]: *** [_module_/home/knoppix/demo] Error 2
> make[1]: Leaving directory '/usr/src/linux-headers-4.7.9-64'
> Makefile:4: recipe for target 'all' failed
> make: *** [all] Error 2
>
> This is - more or less - a known problem, the objtool is missing (as far
> as I can see it should be in the linux-headers-4.7.9-64 package). I
> didn't try but I assume that with the kernel sources you can build your
> own objtool. Objtool seems to be new in 4.6 and seems to depend on
> CONFIG_STACK_VALIDATION.
>
> So a possible workaround is to disable CONFIG_STACK_VALIDATION:
>
> $ make CONFIG_STACK_VALIDATION=
> make -C /lib/modules/4.7.9-64/build M=/home/knoppix/demo modules
> make[1]: Entering directory '/usr/src/linux-headers-4.7.9-64'
> CC [M] /home/knoppix/demo/hello.o
> Building modules, stage 2.
> MODPOST 1 modules
> CC /home/knoppix/demo/hello.mod.o
> LD [M] /home/knoppix/demo/hello.ko
> make[1]: Leaving directory '/usr/src/linux-headers-4.7.9-64'
> $
Reply to: