准备
Installing GCC- GNU Projecthttps://gcc.gnu.org/install/
代码下载
gcc源码下载
gnu-gcc-gcc-12.1.0安装包下载_开源镜像站-阿里云gnu-gcc-gcc-12.1.0安装包是阿里云官方提供的开源镜像免费下载服务,每天下载量过亿,阿里巴巴开源镜像站为包含gnu-gcc-gcc-12.1.0安装包的几百个操作系统镜像和依赖包镜像进行免费CDN加速,更新频率高、稳定安全。https://mirrors.aliyun.com/gnu/gcc/gcc-12.1.0/GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+
https://mirrors.aliyun.com/gnu/gmp/gmp-6.2.1.tar.xzhttps://mirrors.aliyun.com/gnu/gmp/gmp-6.2.1.tar.xzhttps://mirrors.aliyun.com/gnu/mpfr/mpfr-4.1.0.tar.gz
https://mirrors.aliyun.com/gnu/mpfr/mpfr-4.1.0.tar.gzhttps://mirrors.aliyun.com/gnu/mpc/mpc-1.2.1.tar.gz
https://mirrors.aliyun.com/gnu/mpc/mpc-1.2.1.tar.gz
编译
apt install m4
cd gmp-6.2.1
./configure && make && make install
cd mpfr-4.1.0
./configure && make && make install
cd mpc-1.2.1
./configure && make && make install
cd gcc-12.1.0
./configure --disable-multilib
make -j4
make install
编译GDB
代码下载
gnu-gdb安装包下载_开源镜像站-阿里云gnu-gdb安装包是阿里云官方提供的开源镜像免费下载服务,每天下载量过亿,阿里巴巴开源镜像站为包含gnu-gdb安装包的几百个操作系统镜像和依赖包镜像进行免费CDN加速,更新频率高、稳定安全。https://mirrors.aliyun.com/gnu/gdb/https://mirrors.aliyun.com/gnu/gdb/gdb-12.1.tar.gz
https://mirrors.aliyun.com/gnu/gdb/gdb-12.1.tar.gz编译
./configure
make -j4
make install