软件安装

安装bison

  1. mkdir -p /tmp/bison
  2. cd /tmp/bison
  3. wget http://ftp.gnu.org/gnu/bison/bison-3.8.tar.xz
  4. tar -xf bison-3.8.tar.xz
  5. cd bison-3.8
  6. ./configure
  7. make -j(getconf _NPROCESSORS_ONLN)
  8. make install

安装GNU工具集

安装新GNU工具集

  1. mkdir -p /tmp/gnu
  2. cd /tmp/gnu
  3. wget https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.xz
  4. tar -xf binutils-2.38.tar.xz
  5. cd binutils-2.38
  6. ./configure --prefix=/usr/local/binutils
  7. make
  8. make install

备份旧GNU集

  1. mv /usr/bin/ld /usr/bin/ld_bak
  2. mv /usr/bin/as /usr/bin/as_bak

创建新的软链接

  1. ln -s /usr/local/binutils/bin/ld /usr/bin/ld
  2. ln -s /usr/local/binutils/bin/as /usr/bin/as

更新make

  1. mkdir -p /tmp/make
  2. cd /tmp/make
  3. wget https://ftp.gnu.org/gnu/make/make-4.3.tar.gz
  4. tar -xf make-4.3
  5. ./configure --prefix=/usr
  6. type make
  7. make check
  8. make install

更新compiler

  1. mkdir -p /tmp/gcc
  2. cd /tmp/gcc
  3. wget https://ftp.gnu.org/gnu/gcc/gcc-12.1.0/gcc-12.1.0.tar.xz
  4. tar -xf gcc-12.1.0
  5. cd gcc-12.1.0
  6. ./contrib/downloan_prerequisites
  7. mkdir build
  8. cd build
  9. ../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
  10. make -j8 // 很费时,耐心等待
  11. make install

更新Glibc

  1. mkdir -p /tmp/glibc
  2. cd /tmp/glibc
  3. wget https://ftp.gnu.org/gnu/glibc/glibc-2.35.tar.xz
  4. tar -xvf glibc-2.34.tar.xz
  5. cd glibc-2.34
  6. mkdir build
  7. cd build
  8. ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin

编译错误

curl/curl.h: No such file or directory

安装以下依赖:

  • libcurl-devel
  • libcurl-dev

    http-push.c:22:19: fatal error: expat.h: No such file or directory

    安装以下依赖:

  • expat-devel

    These critical programs are missing or too old: as GNU ld bison make compiler

    出现这个问题是因为有些包不存或太旧了。要解决这个问题,那么我们可以安装或更新对应的包就可以了。

  • bison - 更新 [bison](#m51Gk)

  • as,ld - 更新 [GNU](#i7bnX)
  • make - 更新 make
  • compiler - 更新 gcc

    makeinfo is missing on your system

    安装texinfo
    1. yum install texinfo -y

    没有找到semanage命令

    查看库中的相关包: ```shell yum provides /usr/sbin/semanage

// policycoreutils-python-utils-2.9.19.el8.noarch: SELinux policy core python utilities

  1. 根据上面的提示,需要如下面安装包:
  2. ```shell
  3. yum install policycoreutils-python-utils.noarch -y