概述
最近在安装petalinux2021.2时提示gcc版本太低,按提示可以用别的方法解决,但是最好还是升级一下
xlx@u16:/opt/xilinx$ ./petalinux-v2021.2-final-installer.run -d /opt/xilinx/p212/
INFO: Checking installation environment requirements...
INFO: Checking free disk space
INFO: Checking installed tools
WARNING: Seems like your machine does not have gcc 6 or greater version,Please enable buildtools Extended in petalinux-config --> yocto settings
INFO: Checking installed development libraries
INFO: Checking network and other services
INFO: Checking installer checksum...
INFO: Extracting PetaLinux installer...
1.添加源
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
这里根据网速情况,需要等待一会
2.安装 gcc-6/g++ -6
sudo apt-get install gcc-6 g++-6
3.查看 gcc/g++ 链接
查看系统当前使用的 gcc
ls -l /usr/bin/gcc
lrwxrwxrwx 1 root root 5 Nov 16 16:49 gcc -> gcc-5
ls -l /usr/bin/g++
lrwxrwxrwx 1 root root 5 Nov 16 16:49 g++ -> g++-5
4.重定向 gcc 链接到 gcc-6
cd /usr/bin
sudo sudo rm gcc
sudo ln -s gcc-6 gcc
sudo rm g++
sudo ln -s g++-6 g++
5.重新查看gcc/g++ 的链接:
ls -l /usr/bin/gcc
lrwxrwxrwx 1 root root 5 Mar 25 16:22 gcc -> gcc-6
ls -l /usr/bin/g++
lrwxrwxrwx 1 root root 5 Mar 25 16:22 g++ -> g++-6
gcc --version
gcc (Ubuntu 6.5.0-2ubuntu1~16.04) 6.5.0 20181026
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
g++ --version
g++ (Ubuntu 6.5.0-2ubuntu1~16.04) 6.5.0 20181026
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.