4.19 build fails on x86 (objtool missing)

Hi, tried to build against the 4.19 testing kernel (Global build settings > Use the testing kernel version) on a fresh pull from trunk today. Build stopped at:

make[3]: Entering directory '/home/matt/openwrt/package/kernel/button-hotplug'
rm -f /home/matt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/button-hotplug/.built
touch /home/matt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/button-hotplug/.built_check
cat /dev/null > /home/matt/openwrt/staging_dir/target-x86_64_musl/pkginfo/button-hotplug.symvers; for subdir in .; do cat /home/matt/openwrt/staging_dir/target-x86_64_musl/pkginfo/*.symvers 2>/dev/null > /home/matt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/button-hotplug/$subdir/Module.symvers; done
make -C "/home/matt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-4.19.44" HOSTCFLAGS="-O2 -I/home/matt/openwrt/staging_dir/host/include -I/home/matt/openwrt/staging_dir/hostpkg/include -I/home/matt/openwrt/staging_dir/target-x86_64_musl/host/include -Wall -Wmissing-prototypes -Wstrict-prototypes" CROSS_COMPILE="x86_64-openwrt-linux-musl-" ARCH="x86" KBUILD_HAVE_NLS=no KBUILD_BUILD_USER="" KBUILD_BUILD_HOST="" KBUILD_BUILD_TIMESTAMP="Sun May 26 19:51:04 2019" KBUILD_BUILD_VERSION="0" HOST_LOADLIBES="-L/home/matt/openwrt/staging_dir/host/lib" CONFIG_SHELL="bash" V='' cmd_syscalls= KERNELRELEASE=4.19.44 SUBDIRS="/home/matt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/button-hotplug" EXTRA_CFLAGS=" -DCONFIG_BUTTON_HOTPLUG=1 " CONFIG_BUTTON_HOTPLUG=m modules
make[4]: Entering directory '/home/matt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-4.19.44'
make[5]: *** No rule to make target 'tools/objtool/objtool', needed by '/home/matt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/button-hotplug/button-hotplug.o'. Stop.
Makefile:1522: recipe for target 'module/home/matt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/button-hotplug' failed
make[4]: *** [module/home/matt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/button-hotplug] Error 2
make[4]: Leaving directory '/home/matt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-4.19.44'
Makefile:50: recipe for target '/home/matt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/button-hotplug/.built' failed
make[3]: *** [/home/matt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/button-hotplug/.built] Error 2
make[3]: Leaving directory '/home/matt/openwrt/package/kernel/button-hotplug'
time: package/kernel/button-hotplug/compile#0.81#0.37#1.06
package/Makefile:107: recipe for target 'package/kernel/button-hotplug/compile' failed
make[2]: *** [package/kernel/button-hotplug/compile] Error 2
make[2]: Leaving directory '/home/matt/openwrt'
package/Makefile:103: recipe for target '/home/matt/openwrt/staging_dir/target-x86_64_musl/stamp/.package_compile' failed
make[1]: *** [/home/matt/openwrt/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/matt/openwrt'
/home/matt/openwrt/include/toplevel.mk:216: recipe for target 'world' failed
make: *** [world] Error 2

I was able to fix this by going into /openwrt/build_dir/toolchain-x86_64_gcc-7.4.0_musl/linux-4.19.44/tools/objtool and running make. Then ran make clean and make in build root and it completed successfully.

I suspect this is either an issue with my build server, or there is a build script in 4.19 trunk that needs to be tweaked to compile objtool when it is needed?

Try a totally clean build (including removing all build artifacts and ./tmp/). make distclean or even a fresh clone is probably the best bet. If it persists, Iā€™d report your findings to the mailing list.

Hi jeff, it was a fresh clone. The same thing has not happened when I build against the default 4.14 kernel.

1 Like

Does gcc 8.x compile successfully.

1 Like

Hi anomeone, I compiled with GCC 7. I will try with 8.x

[ 0.000000] Linux version 4.19.44 (matt@buildbox) (gcc version 7.4.0 (OpenWrt GCC 7.4.0 r10078-7d77879236)) #0 SMP Sun May 26 19:51:04 2019

Hi anomeome, I got a fresh clone of trunk and configured it exactly as before, the only difference being specifying GCC 8 during make menuconfig. This time the build ran start to finish without any error.

1 Like

@castillofrancodamian ,possibly issue from other thread.

package/compile depends on target/compile. Try make target/compile and see if linux make modules is invoked and objtool is built.

I am confused here. Linux source code only provides kernel headers for the toolchain build. Objtool should not be part of game in this stage.

I don't know if any recent commit changed anything, but I just compiled 4.19 testing kernel with the default GCC 7 from a fresh clone and the build completed successfully this time.