当我运行 make binutils/readelf
时,出现以下错误:
In file included from readelf.c:43:0:
sysdep.h:23:25: fatal error: alloca-conf.h: No such file or directory
#include "alloca-conf.h"
我缺少什么依赖项?我如何只构建和编译 readelf 而无需制作其余的 binutils?
最佳答案
实际发生的情况是您没有Makefile
或至少没有定义binutils/readelf
目标。但是由于有一个 binutils/readelf.c
文件,make 仍然运行并尝试使用其隐式模式规则编译和链接 binutils/readelf
...但失败了,因为这个源文件没有相应的配置是无法构建的。
这只是为了添加更多细节。长话短说,按照评论中的建议运行 ./configure
和 make
并收集生成的 readelf
。比尝试从基于 autotools 的项目中分离出一个单独的项目要容易得多。您将 -I
添加到 CFLAGS
以查找 alloca-conf.h
,您将遇到另一个类似的问题。
关于linux - binutils 为 readelf 报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47850549/