编译命令:
./build.sh --product-name rk3568 --ccache --no-prebuild-sdk --enable_notice_collection=false --gn-args build_product_type=DEBUG --gn-args load_test_config=false
在编译到内核时可能会报如下错误:
GEN .tmp_initcalls.lds
LTO vmlinux.o
MODPOST vmlinux.symvers
WARNING: modpost: vmlinux.o(___ksymtab_gpl+rockchip_clk_register_armclk+0x0): Section mismatch in reference from the variable __ksymtab_rockchip_clk_register_armclk to the function .init.text:rockchip_clk_register_armclk()
The symbol rockchip_clk_register_armclk is exported and annotated __init
Fix this by removing the __init annotation of rockchip_clk_register_armclk or drop the export.
MODINFO modules.builtin.modinfo
GEN modules.builtin
LD .tmp_vmlinux.btf
ld.lld: error: undefined symbol: __aarch64_cas4_acq_rel
>>> referenced by hdf_vnode_adapter.c:294 (/home/smile/OpenHarmony-v4.1.1-Release/out/kernel/OBJ/linux-5.10/../../../../drivers/hdf_core/framework/core/adapter/vnode/src/hdf_vnode_adapter.c:294)
>>> vmlinux.o:(HdfVNodeAdapterIoctl)
>>> referenced by hdf_vnode_adapter.c:303 (/home/smile/OpenHarmony-v4.1.1-Release/out/kernel/OBJ/linux-5.10/../../../../drivers/hdf_core/framework/core/adapter/vnode/src/hdf_vnode_adapter.c:303)
>>> vmlinux.o:(HdfVNodeAdapterIoctl)
>>> referenced by hdf_vnode_adapter.c:428 (/home/smile/OpenHarmony-v4.1.1-Release/out/kernel/OBJ/linux-5.10/../../../../drivers/hdf_core/framework/core/adapter/vnode/src/hdf_vnode_adapter.c:428)
>>> vmlinux.o:(HdfDeviceSendEventToClient)
>>> referenced 1 more times
BTF .btf.vmlinux.bin.o
pahole: .tmp_vmlinux.btf: No such file or directory
LD .tmp_vmlinux.kallsyms1
ld.lld: error: .btf.vmlinux.bin.o: unknown file type
make[2]: *** [/home/smile/OpenHarmony-v4.1.1-Release/out/kernel/src_tmp/linux-5.10/Makefile:1225: vmlinux] Error 1
make[1]: *** [arch/arm64/Makefile:208: rk3568-toybrick-x0-linux.img] Error 2
make[1]: Leaving directory '/home/smile/OpenHarmony-v4.1.1-Release/out/kernel/OBJ/linux-5.10'
make: *** [Makefile:192: __sub-make] Error 2
解决方法:
vim kernel/linux/patches/linux-5.10/rk3568_patch/kernel.patch
找到 +MAKE="make LLVM=1 LLVM_IAS=1 CROSS_COMPILE=aarch64-linux-gnu-" ,删除掉CROSS_COMPILE=aarch64-linux-gnu-
本站资源均来自互联网,仅供研究学习,禁止违法使用和商用,产生法律纠纷本站概不负责!如果侵犯了您的权益请与我们联系!
转载请注明出处: 免费源码网-免费的源码资源网站 » 一个OpenHarmony rk3568编译问题
发表评论 取消回复