安装必要的工具
sudo apt-get install bison
进入$SRC目录
保持网络畅通
下载源码
git clone https://fuchsia.googlesource.com/third_party/gcc_none_toolchains
下载完可以看到主要是控制脚本和补丁文件
简单看下doit脚本
脚本主要下载gcc等源码工具
然后解压打补丁编译
:~/fuchsia/gcc_none_toolchains$ ./doit -h
Options
-a <arch list> architectures to build
example: -a 'arm' or -a 'arm i386 x86_64' for multiple
-c use compilation cache (ccache must be installed)
-f fetch source releases from upstream
-h|-? display this help message
-j<#> use <#> parallel workers to build
-o <dir> output directory
-q make the build quieter
-s strip the binaries
执行命令./doit -a 'x86_64' -f -j8
脚本执行完便得到生成的x86_64工具链
在目录x86_64-elf-5.3.0-Linux-x86_64下
执行cleanit脚本清除编译的中间结果
如果报错,把cleanit脚本的第一行改为#!/bin/bash
使用bash来解释执行
如果需要再次编译
执行./doit -a 'x86_64' -j8
不用加-f参数了
源码包在archives目录