gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf 的安装(Linux解压版)
下载gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz 并解压利用 解压 为gcc-linaro-arm-linux-gnueabihf-4.9-2014.07_linux文件夹。然后依次执行如下命令:
[XXXXXX@mouse ~]$cd gcc-linaro-arm-linux-gnueabihf-4.9-2014.07_linux
[XXXXXX@mouse ~]$vi ~/.bash_profile
配置环境变量。
export PATH=$PATH:/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin 加入编译环境
输入命令:
[XXXXXX@mouse ~]$arm-linux-gnueabihf-gcc -v
如出现一下命令则表示执行成功:
libc.so.6: version `GLIBC_2.14' not found
然后在安装arm-linux-gnueabihf-gcc的过程总可能会出现libc.so.6: version `GLIBC_2.14' not found的问题,执行如下命令:
[XXXXXX@mouse ~]$strings /lib64/libc.so.6 |grep GLIBC_
发现当前版本并不支持系统版本不支持GLIBC_2.14。
需要重新下载更新glibc。这里下载glibc-2.14.tar.xz。解压得到glibc-2.14文件夹,在该文件夹下执行如下命令:
[XXXXXX@mouse ~]$mkdir bulid
[XXXXXX@mouse ~]$cd build
[XXXXXX@mouse ~]$../configure --prefix=/home/XXXX/wclbin/glibc-2.14
[XXXXXX@mouse ~]$make -j4
[XXXXXX@mouse ~]$make install
修改环境变量到指定安装目录。
LD_LIBRARY_PATH=/home/XXXX/wclbin/glibc-2.14/lib
保存,问题得以解决。
cannot find crt1.o: No such file or directory
加入--sysroot=/home/***/sysroots/cortexa15t2hf-vfp-neon-linux-gnueabi 参数。
arm-linux-gnueabihf-gcc --sysroot=/home/xxxx/ASR/sv-g5-system/sysroots/cortexa15t2hf-vfp-neon-linux-gnueabi -o hello hello.cpp