当前位置: 首页 > news >正文

gccgo1.18编译笔记

一、下载依赖:

wget https://gcc.gnu.org/pub/gcc/infrastructure/mpfr-4.1.0.tar.bz2
wget https://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.2.1.tar.bz2
wget https://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.2.1.tar.gz

二、安装依赖:

#依次解压,然后
./configure
make
make install

默认安装到 /usr/local 目录下,包括bin和lib。

三、安装gold(a new, faster, ELF only linker):

yum install texinfo
# 安装 gold
wget https://mirrors.aliyun.com/gnu/binutils/binutils-2.40.tar.gz
tar -xzvf binutils-2.40.tar.gz
cd binutils-2.40
./configure --prefix=/usr/local/binutils2.40 --enable-gold
make
make install

四、下载gcc代码库(国内镜像),切换到gccgo分支:

git clone https://mirrors.tuna.tsinghua.edu.cn/git/gcc.git  gcc14.0.0-20230626-go1.18
cd gcc14.0.0-20230626-go1.18
git checkout gccgo

五、另外目录编译:

mkdir /opt/gccgo-build
cd /opt/gccgo-build
/opt/gcc14.0.0-20230626-go1.18/configure --prefix=/opt/gcc14.0.0-20230626-go1.18-el8-x64-output --enable-bootstrap --enable-checking=release --enable-languages=go --disable-multilib --with-ld=/usr/local/binutils2.40/bin/ld.gold --with-mpfr-lib=/usr/local/lib --with-gmp-lib=/usr/local/lib --with-mpc-lib=/usr/local/lib
make
make install

如果中途编译出错,重新编译:

cd /opt/gccgo-build
find ./ | grep 'config.cache' | xargs rm

六、设置当前进程的环境变量:

export PATH=/opt/gcc14.0.0-20230626-go1.18-el8-x64-output/bin:$PATH
export LD_LIBRARY_PATH=/opt/gcc14.0.0-20230626-go1.18-el8-x64-output/lib64:$LD_LIBRARY_PATH

七、查看版本:

--end--

相关文章:

  • AxiosError: Network Error
  • 关于order by的sql注入实验
  • 如何用Python 3自动打开exe程序
  • c++入门-------命名空间、缺省参数、函数重载
  • 我的电脑是 3070ti 能用那个级别的deepseek
  • 解决Open WebU无法显示基于OpenAI API接口的推理内容的问题
  • 详细介绍嵌入式硬件设计
  • Ubuntu - Redis 安装、远程访问
  • 图书馆系统源码详解
  • 萌新学 Python 之自定义函数
  • Unity技术突破
  • Leetcode 3463. Check If Digits Are Equal in String After Operations II
  • 2025版-Github账号注册详细过程
  • 【C语言】第八期——指针
  • UE_C++ —— Logging in Unreal
  • 初识XML
  • LeetCode 热题 100 206. 反转链表
  • ASP.NET Core Clean Architecture
  • 如何选择适合自己电脑的本地部署模型,模型的大小与b之间的关系,模型参数,量化Q
  • 嵌入式之内存管理
  • 舆情信息网站/今晚赛事比分预测
  • 手机网络营销策划书/沈阳seo收费
  • wordpress显示代码/aso优化重要吗
  • 天津专业做网站的公司有哪些/百度客户端电脑版
  • 返利网站建设哪个公司好/网络app推广是什么工作
  • 东莞做微网站/b2b网站免费推广平台