gpt4 book ai didi

Linux 内核构建编译错误 stringop-overflow 和 sizeof-pointer-memaccess

转载 作者:太空宇宙 更新时间:2023-11-04 11:57:32 27 4
gpt4 key购买 nike

我已经尝试构建 Linux 内核,但遇到了一些编译错误。有谁知道我做错了什么以及如何解决? (或者,您需要哪些额外信息?)

构建系统正在运行最新的 Fedora:4.19.6-300.fc29.x86_64 #1 SMP Sun Dec 2 17:33:14 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

目标系统是 Radxa Rock Pi 4

export ARCH=arm64

export CROSS_COMPILE=aarch64-linux-gnu-

引用https://forum.radxa.com/t/building-debian-image-on-gcc8-systems/128/4

是的,Radxa 有一个论坛,我在那里交叉发帖,但我认为 Stack Overflow 在这方面有更广泛的经验。

编译错误如下:

arch/arm64/kernel/vdso.c: In function ‘vdso_init’: arch/arm64/kernel/vdso.c:119:6: warning: ‘memcmp’ reading 4 bytes from a region of size 1 [-Wstringop-overflow=] error, forbidden warning:vdso.c:119 if (memcmp(&vdso_start, "\177ELF", 4)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ make[1]: *** [scripts/Makefile.build:277: arch/arm64/kernel/vdso.o] Error 1

fs/exec.c: In function ‘get_task_comm’: fs/exec.c:1084:32: warning: argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess] error, forbidden warning:exec.c:1084
strncpy(buf, tsk->comm, sizeof(tsk->comm));

                            ^

最佳答案

Radxa 提供了答案,即将 gcc-aarch64-linux-gnu 降级到 Fedora 之前版本中的版本 7。

关于Linux 内核构建编译错误 stringop-overflow 和 sizeof-pointer-memaccess,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53692404/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com