glibc 配置错误:yacc/bison 丢失

nwl*_*wly 5 linux gcc glibc linux-from-scratch

我遵循LFS的说明,但有一点不同:我只遵循第 5 节 - 构建临时系统的部分内容,以便我可以构建自己的 GCC,原因是这是一台工作机器,我不这样做没有root权限。一切顺利,直到我配置时遇到错误glibc

configure: error:
*** These critical programs are missing or too old: as GNU ld make bison compiler
*** Check the INSTALL file for required versions.
Run Code Online (Sandbox Code Playgroud)

经过一番调查,发现我不满足 LFS 所需的条件:

/usr/bin/yacc is a symbolic link to bison or a small script that executes bison.
Run Code Online (Sandbox Code Playgroud)

结果发现没有这样的文件/usr/bin/yacc(尽管bison确实存在)。但是,因为我在工作中没有 root 权限,所以无法在那里创建符号链接。这里有解决方法吗?

Flo*_*mer 5

当前的 glibc 版本需要 bison 程序来构建(而不是 yacc)。您可以下载 bison 源代码并像这样构建它们:

wget https://ftp.gnu.org/gnu/bison/bison-3.2.tar.gz
tar xf bison-3.2.tar.gz
cd bison-3.2
./configure --prefix=$HOME/install
make
make install
Run Code Online (Sandbox Code Playgroud)

然后您可以将该$HOME/install/bin目录放在命令搜索路径上:

PATH=$HOME/install/bin:$PATH
Run Code Online (Sandbox Code Playgroud)

此时,glibc 的configure脚本应该会选择该 bison 版本。

旧版本的 glibc(2.27 之前)将 bison 生成的文件作为源的一部分提供,因此 bison 是可选的。显然,您所遵循的说明尚未更新以反映野牛的新要求。