问题
When I run make binutils/readelf
I get the following error:
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"
What dependency am I missing? How do I just build and compile readelf without making the rest of binutils?
回答1:
What has actually happened is that you do not have a Makefile
or at least not one defining binutils/readelf
target. But since there is a binutils/readelf.c
file, make still ran and tried to compile and link binutils/readelf
using its implicit pattern rules... and failed because this source file cannot be built without corresponding configuration.
This is just to add a bit more detail. Long story short, run ./configure
and make
as suggested in the comments and collect your resulting readelf
. Much easier then trying to isolate a solitary item build out of autotools based project. You add -I
to CFLAGS
to find alloca-conf.h
, you'll just run into another problem like that.
来源:https://stackoverflow.com/questions/47850549/binutils-make-error-for-readelf