编译环境:Linux XXXXX 5.0.0-31-generic #33~18.04.1-Ubuntu SMP Tue Oct 1 10:20:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
1,下载arm-none-eabi-gcc
https://launchpad.net/gcc-arm-embedded/+download
gcc-arm-none-eabi-5_4-2016q3-20160926-src.tar.bz2
2,环境搭建
$ sudo su
$ apt-get install software-properties-common
$ add-apt-repository universe
3,更新源
/etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu xenial main universe
deb-src http://archive.ubuntu.com/ubuntu xenial main universe
deb http://security.ubuntu.com/ubuntu xenial-security main
4,持支持32bit的包
dpkg --add-architecture i386,
5,更新所有的包
apt-get update
6,安装生成windows 环境的包
apt-get install -y -t xenial gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686
7,安装所有的工具包
apt-get -f install -y \
build-essential \
autoconf \
autogen \
bison \
dejagnu \
flex \
flip \
gawk \
git \
gperf \
gzip \
nsis \
openssh-client \
p7zip-full \
perl \
python-dev \
libisl-dev \
scons \
tcl \
texinfo \
tofrodos \
wget \
zip \
texlive \
texlive-extra-utils \
libncurses5-dev
8,编译
./build-prerequisites.sh
./build-toolchain.sh --skip_steps=manual
//./build-toolchain.sh --skip_steps=mingw32,manual,gdb-with-python,mingw32-gdb-with-python
–skip_steps 就是 所有源码安装依赖包 configure 步骤中配置的参数:
mingw32 :是跳过 生成32位系统 免安装toolchain
manual :不生成 pdf 和html等说明文档
c错误:
1,/home/lvbing/toolchain/gcc-arm-none-eabi-5_4-2016q3-20160926/src/installation/build_win_pkg.sh: line 100: installjammer: command not found
https://sourceforge.net/projects/installjammer/files/latest/download
2,Error in script "/home/lvbing/toolchain/gcc-arm-none-eabi-5_4-2016q3-20160926/src/installation/arm-none-eabi-gnu-tools.nsi" on line 32 -- aborting creation process
./build-prerequisites.sh --skip_steps=mingw32
./build-toolchain.sh --skip_steps=mingw32,manual,gdb-with-python,mingw32-gdb-with-python