Why does the compiler have such a warning?

Hi All:
Why does JP6.1 compile with such a warning? 5.12 does not.

JP6.1

新文件 1.txt (10.7 MB)

depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/opensrc-disp/nvidia.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/sound/soc/tegra/snd-soc-tegra210-adx.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/drivers/platform/tegra/rtcpu/ivc-bus.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/drivers/net/wireless/realtek/rtl8822ce/rtl8822ce.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/drivers/video/tegra/host/nvcsi/nvhost-nvcsi-t194.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/drivers/platform/tegra/dce/tegra-dce.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/drivers/media/i2c/nv_ar0234.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/drivers/platform/tegra/rtcpu/rtcpu-debug.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/drivers/media/i2c/max9295.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/drivers/media/platform/tegra/cdi/cam_cdi_tsc.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/drivers/media/i2c/max96712.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/drivers/media/i2c/lt6911uxc.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/sound/soc/tegra/snd-soc-tegra210-mixer.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/drivers/media/i2c/nv_imx390.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/drivers/platform/tegra/mce/tegra-mce.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/drivers/net/ethernet/nvidia/pcie/tegra_vnet.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/drivers/bmi088/bmi088.ko needs unknown symbol _mcount
depmod: WARNING: /home/w/master/L4T-public-source/output/Linux_for_Tegra/rootfs/lib/modules/5.15.148-tegra/updates/sound/soc/tegra/snd-soc-tegra-machine-driver.ko needs unknown symbol _mcount

defconfig file:
defconfig.txt (32.1 KB)

ls bsp/jp6.1/kernel_src/
generic_rt_build.sh  hardware  hwpm  kernel  kernel-devicetree  kernel_src_build_env.sh  Makefile  nvbuild.sh  nvcommon_build.sh  nvdisplay  nvethernetrm  nvgpu  nvidia-oot  out

shell:

export PATH=${PROJECT_TOP}/prebuild_tools/gcc_11.3/bin:${PATH}
export CROSS_COMPILE="${PROJECT_TOP}/prebuild_tools/gcc_11.3/bin/aarch64-buildroot-linux-gnu-"

pushd "${PROJECT_TOP}/bsp/${JETVERSION}/kernel_src/kernel" > /dev/null 2>&1
	echo "*** Jetson Linux kernel ***"
		make
	echo ""
	
	echo "*** Jetson Linux kernel in-tree modules ***"
		export INSTALL_MOD_PATH=${PROJECT_TOP}/${OUT_PUT}/Linux_for_Tegra/rootfs
		sudo -E make install
		cp ${KERNEL_OUTPUT}/arch/arm64/boot/Image ${PROJECT_TOP}/${OUT_PUT}/Linux_for_Tegra/kernel/Image
		cp ${KERNEL_OUTPUT_DIR}/vmlinux ${PROJECT_TOP}/${OUT_PUT}/Linux_for_Tegra/kernel/
	echo ""
popd > /dev/null 2>&1

pushd "${PROJECT_TOP}/bsp/${JETVERSION}/kernel_src" > /dev/null 2>&1
	echo "*** build out-tree modules ***"
		export KERNEL_HEADERS=${KERNEL_SOURCE_DIR}
		make modules
	echo ""
	
	echo "*** install out-tree modules ***"
		sudo -E make modules_install
	echo ""

	pushd "${PROJECT_TOP}/${OUT_PUT}/Linux_for_Tegra/" > /dev/null 2>&1
		echo "*** update the initramfs ***"
			sudo ./tools/l4t_update_initrd.sh
		echo ""
	popd > /dev/null 2>&1
	
	echo "*** build&install dtbs ***"
		export KERNEL_HEADERS=${KERNEL_SOURCE_DIR}
		make dtbs
		cp kernel-devicetree/generic-dts/dtbs/* ${PROJECT_TOP}/${OUT_PUT}/Linux_for_Tegra/kernel/dtb/
	echo ""
	
	echo "*** clean out-tree modules, dtbs ***"
	make clean
	echo ""
popd > /dev/null 2>&1

Did you edit the .config by hand? Or did you compile without a starting configuration? What I’m wondering is how the configuration was generated prior to building. What I’m seeing is that you have enabled modules which have dependencies, and you never enabled the dependencies. Editors like the menuconfig or nconfig understand dependencies, and if you add or change something using those, then it also adds or edits dependencies and not just the one symbol you’ve changed. If you start with a valid configuration, and then edit using a dependency-aware editor, then you won’t end up without the missing dependencies.

My configuration file is made into a raw file by making menuconfig, and then make menuconfig is executed again and the relevant configuration is modified. Eventually, the two diffs are merged into defconfig

Is it because defconfig opens the following configuration:
CONFIG_DYNAMIC_FTRACE

defconfig file:
defconfig.txt (32.1 KB)

This is likely the reason why it is missing dependencies. You cannot start with menuconfig. You have to start with a valid base configuration, and then modify it with menuconfig (I prefer nconfig; they look exactly the same, but nconfig has a symbol search function).

You should start with either the make target defconfig (in older releases before JetPack 6.x it was tegra_defconfig), or else with a known working complete configuration (example: the /proc/config.gz of a working running system).

Also, don’t forget to set up CONFIG_LOCALVERSION. If the “integrated” setup (items which are “=y” are integrated into the kernel Image) are an exact match to the running kernel, then I’d use “-tegra” (the suffix of the default “uname -r” command). If anything which is “=y” changes, then I’d use something other than “-tegra” for “CONFIG_LOCALVERSION”.

1 Like