当我使用 yocto 项目构建 glibc 库时,它提供了
错误:缺少属性((构造函数))支持??
添加覆盖标志后:
TARGET_CFLAGS += "-fprofile-arcs -ftest-coverage"
TARGET_LDFLAGS += "-lgcov -fprofile-arcs -ftest-coverage"
仍然,我收到 glibc 错误。
请找到配置日志文件的链接:https://drive.google.com/file/d/14tiQJ8JIFE_tDWt3H9tS8zBBQROcZDNa/view
即使在 conf/local.conf 中添加以下行后它也不起作用:
EXTRA_OECONF = "libc_cv_ctors_header=yes"
连我都试过了
EXTRA_OECONF_append = "libc_cv_ctors_header=yes"
请找到编译过程中生成的配置日志文件:https://drive.google.com/open?id=1kxTu8pt7h_9ty55OywP9Ilmmp04T61Rr
那么,如何解决这个错误?
日志文件错误点
poky-linux/gcc/i586-poky-linux/8.2.0/ld: /tmp/ccxetEc1.o: in function `_GLOBAL__sub_D_00100_1__start':
conftest.c:(.text.exit+0x40): undefined reference to `__gcov_exit'<br>
collect2: error: ld returned 1 exit status<br>
configure:5682: $? = 1<br>
configure:5702: error: missing __attribute__ ((constructor)) support??
最佳答案
您正尝试在 CFLAGS
中使用 -fprofile-arcs -ftest-coverage
构建 glibc。这是行不通的。您看到的错误是这些不正确的编译器标志造成的。
分析 glibc 需要对整个库进行相当大的更改,并且需要通过使用 --enable-profile
(这不是默认设置)进行构建来创建。
关于linux - 未定义对 `__gcov_exit' 的引用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54418831/