Linux Bison-3.0.4 中的 From Scratch 错误 'make check'

Linux From Scratch error in Bison-3.0.4 'make check'

所以我正在阅读 Linux From Scratch 这本书,并且在第 5.17 Bison-3.0.4.

章中

书上指导我们在make之后做一个make check来测试编译后的Bison包的结果。

最初,我收到以下错误:

make[3]: Entering directory `/sources/bison-3.0'
  LEX      examples/calc++/calc++-scanner.cc
  CXX      
examples/calc++/examples_calc___calc__-calc++-scanner.o
g++: error: ./examples/calc++/calc++-scanner.cc: No such file or directory
g++: fatal error: no input files
compilation terminated.
make[3]: *** 
[examples/calc++/examples_calc___calc__-calc++-scanner.o] Error 1
make[3]: Leaving directory `/sources/bison-3.0'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/sources/bison-3.0'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/sources/bison-3.0'
make: *** [check] Error 2

但在 this website 上得到了解决方案。它告诉我在发布 make check 之前执行以下操作:

cp Makefile Makefile.bak
sed -i '/calc++/d' Makefile
make check

这解决了问题,除了以下三个 FAILED 检查之外,所有检查都变成了绿色 ok

430: Variants lalr1.cc parse.assert api.token.constructor FAILED (c++.at:374)
431: Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_} FAILED (c++.at:375)
432: Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_} %locations FAILED (c++.at:376)

我尝试在 Google 上搜索,但一无所获。

有什么想法吗?

这是常见的错误。如Chapter 4.6. About the Test Suites所述:

Experience has shown that there is little to be gained from running the test suites in Chapter 5. There can be no escaping the fact that the host system always exerts some influence on the tests in that chapter, often causing inexplicable failures. Because the tools built in Chapter 5 are temporary and eventually discarded, we do not recommend running the test suites in Chapter 5 for the average reader. The instructions for running those test suites are provided for the benefit of testers and developers, but they are strictly optional.

解决方法很简单 - 不要 运行 测试第 5 章中编译的包。它们会失败并且没有任何意义。当您构建真实系统时,第 6 章中的测试很重要。