这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » 国产MCU » RK3568linuxsdk修改内核配置后编译报错怎么办

共4条 1/1 1 跳转至

RK3568linuxsdk修改内核配置后编译报错怎么办

工程师
2023-10-10 18:13:26     打赏

1.jpg

问题描述及复现步骤:
在修改内核配置后,编译报错,发现是kernel/drivers/spi/spi-wk2xxx这个文件不是源码引起的,请修复一下。

MODPOST vmlinux.o
drivers/spi/spi-wk2xxx: In function wk2xxx_set_mctrl':<br/>/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:828: undefined reference to _mcount'
/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:828:(.text+0xc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol _mcount'<br/>drivers/spi/spi-wk2xxx: In function wk2xxx_get_mctrl':
/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:835: undefined reference to _mcount'<br/>/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:835:(.text+0x24): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol _mcount'
drivers/spi/spi-wk2xxx: In function wk2xxx_enable_ms':<br/>/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:958: undefined reference to _mcount'
/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:958:(.text+0x40): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol _mcount'<br/>drivers/spi/spi-wk2xxx: In function wk2xxx_break_ctl':
/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:968: undefined reference to _mcount'<br/>/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:968:(.text+0x58): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol _mcount'
drivers/spi/spi-wk2xxx: In function wk2xxx_type':<br/>/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:1460: undefined reference to _mcount'
/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:1460:(.text+0x78): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol _mcount'<br/>drivers/spi/spi-wk2xxx:/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:1505: more undefined references to _mcount' follow
drivers/spi/spi-wk2xxx: In function wk2xxx_verify_port':<br/>/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:1505:(.text+0xbc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol _mcount'
drivers/spi/spi-wk2xxx: In function wk2xxx_request_port':<br/>/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:1479:(.text+0x120): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol _mcount'
drivers/spi/spi-wk2xxx: In function wk2xxx_config_port':<br/>/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:1488:(.text+0x154): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol _mcount'
drivers/spi/spi-wk2xxx: In function wk2xxx_release_port':<br/>/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:1471:(.text+0x188): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol _mcount'
drivers/spi/spi-wk2xxx: In function wk2xxx_remove':<br/>/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:1750:(.text+0x1bc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol _mcount'
drivers/spi/spi-wk2xxx: In function wk2xxx_dowork':<br/>/home/llq/p/proj/rk3568/kernel/drivers/spi/spi-wk2xxx.c:266:(.text+0x248): additional relocation overflows omitted from the output<br/>drivers/spi/spi-wk2xxx: In function kmalloc':
/home/llq/p/proj/rk3568/kernel/./include/linux/slab.h:548: undefined reference to kmem_cache_alloc_trace'<br/>drivers/spi/spi-wk2xxx: In function wk2xxx_tx_empty':





关键词: RK3568     linux     sdk     内核    

工程师
2023-10-10 18:13:44     打赏
2楼

看了一下,3566 3568 linux和android sdk中都存在固件,都会有修改配置无法编译的风险


助工
2023-10-10 18:14:02     打赏
3楼

这个是你裁剪配置项造成的。

就拿undefined reference to `kmem_cache_alloc_trace'
在连接文件的时候找不到这个定义,你看看mm/slab.c这个文件是不是被你裁剪了config,造成没有被链接到。

mm/slab.c:kmem_cache_alloc_trace(struct kmem_cache *cachep, gfp_t flags, size_t size)
mm/slab.c:EXPORT_SYMBOL(kmem_cache_alloc_trace);
mm/slub.c:void *kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size)
mm/slub.c:EXPORT_SYMBOL(kmem_cache_alloc_trace);

还有这个undefined reference to `_mcount'

[code]arch/arm64/kernel/arm64ksyms.c:EXPORT_SYMBOL(_mcount);
arch/arm64/kernel/arm64ksyms.c:NOKPROBE_SYMBOL(_mcount);


工程师
2023-10-10 18:14:17     打赏
4楼

我看了一下,应该是kernel/drivers/spi/spi-wk2xxx这个文件没有开源导致的, 这个文件原来是带有ftrace开关进行编译的,我现在需要关闭ftrace开关,然后内核链接这个文件就出问题,_mcount是因为ftrace开关导致的。kernel/drivers/spi/spi-wk2xxx这个可以开发出来吗,我的理解linux内核是gpl的,内核的修改是可以开源出来的,另外还有drivers/mmc/core/mmc_blk_data这也是闭源的,也会引起同样的问题,如果把这2个镜像从makefile中去掉,编译就可以过,但是这2个模块不清楚是啥作用,贸然删掉会不会引起问题。


共4条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]