【发布时间】:2021-12-29 05:15:33
【问题描述】:
当我为我们的开发板构建 u-boot-spl 时,我看到了这些链接错误。 (u-boot 版本 v2021.10,提交 50c84208ad,Tom Rini,2021 年 10 月 4 日)
u-boot/common/spl/spl.c:669: undefined reference to `memcpy'
u-boot/common/spl/spl.c:684: undefined reference to `mem_malloc_init'
...
但是 arch/arm/Kconfig 说(我的板子是 ARM64)
config USE_ARCH_MEMCPY
bool "Use an assembly optimized implementation of memcpy"
default y if !ARM64
depends on !ARM64 || (ARM64 && (GCC_VERSION >= 90400))
help
Enable the generation of an optimized version of memcpy.
Such an implementation may be faster under some conditions
but may increase the binary size.
因此,如果 ARM64 和 GCC 版本高于 9.04,则应打开 USE_ARCH_MEMCPY。
就我而言,我可以在 include/config/auto.conf 中检查这两个条件是否为真。
CONFIG_ARM64=y
CONFIG_GCC_VERSION=100201
但是 USE_ARCH_MEMCPY 并没有出现在 include/cofig/auto.conf 中(这正常吗?)。
无论如何,我认为这个 CONFIG_USE_ARCH_MEMCPY 应该是y。为什么它会给我这个 memcpy 未定义的错误?
我签入了 lib/Makefile,我明白了
obj-y += string.o
这是无条件的,这个 string.c 包含 memcpy 函数。但是当然这个函数是被#ifndef __HAVE_ARCH_MEMCPY 包围的,所以这不是我想要的。
我应该打开任何选项来使用这个硬件辅助的 memcpy 吗?
ADD : 我尝试添加 CONFIG_LTO 但它不起作用。
【问题讨论】:
-
根据您之前在这些主题中发表的帖子,我怀疑您围绕 SoC 或电路板创建的 Kconfig 条目存在一些问题。
标签: embedded-linux arm64 u-boot