[FS#1282] "CONFIG_STRIP_KERNEL_EXPORTS" breaks kernel compilation for Raspberry PI3 (arm64)

LEDE Bugs lede-bugs at lists.infradead.org
Thu Jan 18 10:08:51 PST 2018


A new Flyspray task has been opened.  Details are below. 

User who did this - Thorsten Maerz (torte71) 

Attached to Project - OpenWrt/LEDE Project
Summary - "CONFIG_STRIP_KERNEL_EXPORTS" breaks kernel compilation for Raspberry PI3 (arm64)
Task Type - Build Failure
Category - Kernel
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - Low
Priority - Very Low
Reported Version - Trunk
Due in Version - Undecided
Due Date - Undecided
Details - Target: brcm2708_bcm2710 (rpi-3)
Affected openwrt revision: git-head (26045049baf646aa2ce3dce78106da5acf4936ea)
(openwrt-17.01 is not affected)


  * Reproducing
git clone https://git.openwrt.org/openwrt/openwrt.git ; cd openwrt
make menuconfig
# Select:
#   Target: Broadcom BCM27xx
#   Subtarget: BCM2710 64 bit based boards
#   Global build settings  ---> Strip unnecessary exports from the kernel image: Enabled
make -j 1 V=s

  * Build log

make -C /home/torte/openwrt/nfs/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-brcm2708_bcm2710/linux-4.9.76 HOSTCFLAGS="-O2 -I/home/torte/openwrt/nfs/openwrt/staging_dir/host/include  -Wall -Wmissing-prototypes -Wstrict-prototypes" CROSS_COMPILE="aarch64-openwrt-linux-musl-" ARCH="arm64" KBUILD_HAVE_NLS=no KBUILD_BUILD_USER="" KBUILD_BUILD_HOST="" KBUILD_BUILD_TIMESTAMP="Thu Jan 18 10:39:42 2018" KBUILD_BUILD_VERSION="0" HOST_LOADLIBES="-L/home/torte/openwrt/nfs/openwrt/staging_dir/host/lib" CONFIG_SHELL="bash" V=''  cmd_syscalls= KERNELRELEASE=4.9.76 EXTRA_LDSFLAGS="-I/home/torte/openwrt/nfs/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-brcm2708_bcm2710 -include symtab.h" CC="aarch64-openwrt-linux-musl-gcc" modules
make[5]: Entering directory '/home/torte/openwrt/nfs/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-brcm2708_bcm2710/linux-4.9.76'
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  LDS     arch/arm64/kernel/vdso/vdso.lds
cc1: fatal error: symtab.h: No such file or directory
compilation terminated.
scripts/Makefile.build:405: recipe for target 'arch/arm64/kernel/vdso/vdso.lds' failed
make[6]: *** [arch/arm64/kernel/vdso/vdso.lds] Error 1
arch/arm64/Makefile:145: recipe for target 'vdso_prepare' failed
make[5]: *** [vdso_prepare] Error 2


  * Details
The option CONFIG_STRIP_KERNEL_EXPORTS adds "-include symtab.h" for all linker script invokations. See openwrt/include/kernel-defaults.mk:

ifdef CONFIG_STRIP_KERNEL_EXPORTS
  KERNEL_MAKEOPTS += \
        EXTRA_LDSFLAGS="-I$(KERNEL_BUILD_DIR) -include symtab.h"
endif


On recent kernels (4.9.x, arm64 build), linker scripts are used to generate "vdso.lds" at the "make modules" stage.
But the file "symtab.h" is generated later (at the install/image generation stage). See openwrt/include/kernel-build.mk:

  $(LINUX_DIR)/.image: $(STAMP_CONFIGURED) $(if $(CONFIG_STRIP_KERNEL_EXPORTS),$(KERNEL_BUILD_DIR)/symtab.h) FORCE
        $(Kernel/CompileImage)
        $(Kernel/CollectDebug)
        touch $$@

As a result, kernel compilation fails.


  * Sidenotes:
- 32bit arm (brcm2708_bcm2708) is not affected, the vdso stuff is generated by normal .c files

- On arm64 4.4 kernels, the vdso stuff is not compiled for reasons, that I don't know. Anyway, openwrt-17.01 is not affected


More information can be found at the following URL:
https://bugs.lede-project.org/index.php?do=details&task_id=1282



More information about the lede-bugs mailing list