Page MenuHomeSolus

Kernel Headers Don't Package Required Tools
Closed, ResolvedPublic

Description

In order to build modules, Solus ships with the required headers in /lib/modules/$(uname -r)/build, just like every other distro.

However, in order to build modules on recent kernels, the headers must also ship some kernel-tree-specific build-time tools, such as objtool.

You'll observe this when trying to build an out of tree module. Everything goes well, except you have this message in your output: Makefile:944: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel". If you then follow the advice and install libelf-devel, the build entirely fails with something along the lines of make[2]: *** No rule to make target....

You can "fix" this error with this hack/workaround: sudo ln -s /bin/true /lib/modules/$(uname -r)/build/tools/objtool/objtool. This convinces the makefile that objtool was there and did something, and so the build succeeds again.

However, that's obviously a terrible way to do it, and really Solus' packages should instead be including these essential build-time tools as part of the /lib/modules headers that it ships. Shipping objtool&friends with those headers is what all other distros do too.