报错详情
make[1]: flex: Command not found
BISON dtc-parser.tab.c
make[1]: bison: Command not found
LEX dtc-lexer.lex.c
make[1]: flex: Command not found
make[1]: '/soft/qemu-2.11.0/capstone/libcapstone.a' is up to date.
CC util/memfd.o
util/memfd.c:44:12: error: static declaration of ‘memfd_create’ follows non-static declaration
static int memfd_create(const char *name, unsigned int flags)
^~~~~~~~~~~~
In file included from /usr/include/bits/mman-linux.h:117:0,
from /usr/include/bits/mman.h:49,
from /usr/include/sys/mman.h:41,
from /soft/qemu-2.11.0/include/sysemu/os-posix.h:29,
from /soft/qemu-2.11.0/include/qemu/osdep.h:104,
from util/memfd.c:28:
/usr/include/bits/mman-shared.h:46:5: note: previous declaration of ‘memfd_create’ was here
int memfd_create (const char *__name, unsigned int __flags) __THROW;
^~~~~~~~~~~~
make: *** [/soft/qemu-2.11.0/rules.mak:66: util/memfd.o] Error 1
解决方案
修改报错的文件memfd.c
vim qemu-2.11.0/util/memfd.c
将第43行
static int memfd_create(const char *name, unsigned int flags)
修改为
int memfd_create(const char *name, unsigned int flags)
保存退出
make clean
make
编译成功