准备工作

  1. 下载交叉编译工具:arm-himix200-linux
    百度网盘:
    链接:https://pan.baidu.com/s/1XuRLd3J6S68X_k6Sq1DmwA
        提取码:dzas 
  1. ubuntu版本:

    vmare安装的ubuntu18.04 amd64版本

     dopi@ubuntu:~$ cat /proc/version
    Linux version 5.3.0-62-generic (buildd@lcy01-amd64-004) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #56~18.04.1-Ubuntu SMP Wed Jun 24 16:17:03 UTC 2020

更换镜像源,再更新

打开镜像源,ubuntu18更新源:https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
选择ubuntu18.04:
在这里插入图片描述
修改权限,复制到 source.list 中,保存退出。

sudo chmod 777 /etc/apt/sources.list
vi /etc/apt/sources.lis

安装交叉编译环境

tar -zxvf arm-himix200-linux.tgz
cd arm-himix200-linux
sudo ./arm-himix200-linux.install

执行时间有点长,您可以站起来活动下,毕竟我们男人,坐久了不好,哈哈。

dopi@ubuntu:sudo ./arm-himix200-linux.install 
[sudo] password for dopi: 
Installing HuaWei LiteOS Linux at /opt/hisi-linux/x86-arm
mkdir: created directory '/opt/hisi-linux/x86-arm/arm-himix200-linux'
Extract cross tools ...
export path /opt/hisi-linux/x86-arm/arm-himix200-linux/bin

添加到环境变量中

export path=/opt/hisi-linux/x86-arm/arm-himix200-linux/bin
source /etc/profile

测试

dopi@ubuntu:~$ arm-himix200-linux-gcc -v
arm-himix200-linux-gcc: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
dopi@ubuntu:~$ 

解决方法:

vim /etc/default/locale
将第一项LANG="zh_CN,UT-F8"改为LANG=“C”

修改完后,记得重启虚拟机。

在查询版本号

arm-himix200-linux-gcc -v
Using built-in specs.
COLLECT_GCC=arm-himix200-linux-gcc
COLLECT_LTO_WRAPPER=/opt/hisi-linux/x86-arm/arm-himix200-linux/host_bin/../libexec/gcc/arm-linux-gnueabi/6.3.0/lto-wrapper
Target: arm-linux-gnueabi
Configured with: /usr1/code/CODE_CCTD_V1R2C00/code/current/SDK_CPU_UNIFIED/build/script/arm-himix200-linux/arm_himix200_build_dir/src/gcc-6.3.0/configure --host=i586-suse-linux --build=i586-suse-linux --target=arm-linux-gnueabi --prefix=/usr1/code/CODE_CCTD_V1R2C00/code/current/SDK_CPU_UNIFIED/build/script/arm-himix200-linux/arm_himix200_build_dir/install --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-lto --enable-symvers=gnu --enable-__cxa_atexit --enable-nls --enable-clocale=gnu --enable-extra-hisi-multilibs --with-sysroot=/usr1/code/CODE_CCTD_V1R2C00/code/current/SDK_CPU_UNIFIED/build/script/arm-himix200-linux/arm_himix200_build_dir/install/target --with-build-sysroot=/usr1/code/CODE_CCTD_V1R2C00/code/current/SDK_CPU_UNIFIED/build/script/arm-himix200-linux/arm_himix200_build_dir/install/target --with-gmp=/usr1/code/CODE_CCTD_V1R2C00/code/current/SDK_CPU_UNIFIED/build/script/arm-himix200-linux/arm_himix200_build_dir/obj/host-libs/usr --with-mpfr=/usr1/code/CODE_CCTD_V1R2C00/code/current/SDK_CPU_UNIFIED/build/script/arm-himix200-linux/arm_himix200_build_dir/obj/host-libs/usr --with-mpc=/usr1/code/CODE_CCTD_V1R2C00/code/current/SDK_CPU_UNIFIED/build/script/arm-himix200-linux/arm_himix200_build_dir/obj/host-libs/usr --enable-libgomp --disable-libitm --enable-poison-system-directories --with-pkgversion='HC&C V100R002C00B021_20180917'
Thread model: posix
gcc version 6.3.0 (HC&C V100R002C00B021_20180917) 
文档更新时间: 2020-11-08 15:02   作者:Tony