我从 Github https://github.com/coreos/grub克隆了 grub ,但是它无法编译并给出错误。错误似乎很明显,但关键是上游代码没有编译。我做错什么了吗?
我做了以下事情来编译:
./autogen.sh
./configure --target=x86_64 --with-platform=efi
make
我收到此错误:
grub_script.yy.c: In function ‘yy_fatal_error’:
grub_script.yy.c:19:22: error: statement with no effect [-Werror=unused-value]
#define fprintf(...) 0
^
grub_script.yy.c:2367:2: note: in expansion of macro ‘fprintf’
fprintf( stderr, "%s\n", msg );
^
cc1: all warnings being treated as errors
Makefile:35746: recipe for target 'normal_module-grub_script.yy.o' failed
make[3]: *** [normal_module-grub_script.yy.o] Error 1
make[3]: Leaving directory '/tmp/grub-2.02/grub-core'
Makefile:23531: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/tmp/grub-2.02/grub-core'
Makefile:10904: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/grub-2.02'
Makefile:3130: recipe for target 'all' failed
make: *** [all] Error 2
我尝试使用 gcc 4.8,5 和 7,但同样的错误。我的主机是 Ubuntu-18 64 位。