Ubuntu20.04 安装Zynq开发交叉编译环境
安装文件:xilinx-2011.09-50-arm-xilinx-linux-gnueabi.bin
1 安装交叉编译器出问题
1.1 64位系统缺少32位库
安装缺少的32位库,以前的ia32-libs已经被lib32z1取代
解决办法
sudo apt-get install lib32z1
1.2 shell 版本不对
./arm-2010q1-202-arm-none-linux-gnueabi.bin
错误信息如下
Checking for required programs: awk grep sed bzip2 gunzip
Error: DASH shell not supported as system shell
The installer has detected that your system uses the dash shell
as /bin/sh. This shell is not supported by the installer.
You can work around this problem by changing /bin/sh to be a
symbolic link to a supported shell such as bash.
For example, on Ubuntu systems, execute this shell command:
% sudo dpkg-reconfigure -plow dash
Install as /bin/sh? No
Please refer to the Getting Started guide for more information,
or contact CodeSourcery Support for assistance.
解决办法
sudo dpkg-reconfigure dash
出现菜单问你是否要dash的时候,选no就可以了。
1.3 配置交叉编译工具
添加以下内容:
gedit ~/.bashrc
export PATH=$PATH:/home/tony/CodeSourcery/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux/bin
# save and exit
source ~/.bashrc
测试配置是否成功
在其他目录执行
arm-xilinx-linux-gnueabi-gcc -v
测试交叉编译工具是否生效
Using built-in specs.
COLLECT_GCC=arm-xilinx-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/home/tony/CodeSourcery/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux/bin/../libexec/gcc/arm-xilinx-linux-gnueabi/4.6.1/lto-wrapper
Target: arm-xilinx-linux-gnueabi
Configured with: /scratch/janisjo/2011.09-xilinx-linux/src/gcc-4.6-2011.09/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-xilinx-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs --with-arch=armv5te --with-cpu=cortex-a9 --with-float=softfp --with-fpu=neon-fp16 --disable-multilib --with-gnu-as --with-gnu-ld --with-specs='%{save-temps: -fverbose-asm} %{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables} -D__CS_SOURCERYGXX_MAJ__=2011 -D__CS_SOURCERYGXX_MIN__=9 -D__CS_SOURCERYGXX_REV__=50 %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --enable-shared --enable-lto --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery CodeBench Lite 2011.09-50' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-xilinx-linux-gnueabi/libc --with-build-sysroot=/scratch/janisjo/2011.09-xilinx-linux/install/arm-xilinx-linux-gnueabi/libc --with-gmp=/scratch/janisjo/2011.09-xilinx-linux/obj/host-libs-2011.09-50-arm-xilinx-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/janisjo/2011.09-xilinx-linux/obj/host-libs-2011.09-50-arm-xilinx-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpc=/scratch/janisjo/2011.09-xilinx-linux/obj/host-libs-2011.09-50-arm-xilinx-linux-gnueabi-i686-pc-linux-gnu/usr --with-ppl=/scratch/janisjo/2011.09-xilinx-linux/obj/host-libs-2011.09-50-arm-xilinx-linux-gnueabi-i686-pc-linux-gnu/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/scratch/janisjo/2011.09-xilinx-linux/obj/host-libs-2011.09-50-arm-xilinx-linux-gnueabi-i686-pc-linux-gnu/usr --with-libelf=/scratch/janisjo/2011.09-xilinx-linux/obj/host-libs-2011.09-50-arm-xilinx-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/janisjo/2011.09-xilinx-linux/install/arm-xilinx-linux-gnueabi/bin --with-build-time-tools=/scratch/janisjo/2011.09-xilinx-linux/install/arm-xilinx-linux-gnueabi/bin
Thread model: posix
gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-50)