当我使用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??
你正在尝试用-fprofile-arcs -ftest-coverage
中的CFLAGS
构建glibc。那样不行。您看到的错误是这些不正确的编译器标志的结果。
分析glibc需要在整个库中进行相当大的更改,并且需要通过使用--enable-profile
(这不是默认值)构建来创建。