在Linux下安装FriendlyARM交叉编译器

    xiaoxiao2021-03-25  105

    这里使用的是FriendlyARM开发板所提供的压缩包,版本是4.4.3。下面来看看怎么在RedHat Linux下安装交叉编译器。

    一、安装交叉编译器的步骤如下所示:

    1、将arm-linux-gcc-4.4.3.tar.gz压缩包复制到共享文件下。

    2、对arm-linux-gcc-4.4.3.tar.gz压缩包进行解压,解压到/目录下(根目录)。

    [root@localhost Linux]# tar -xvzf arm-linux-gcc-4.4.3.tar.gz -C /

    在根目录(/)下会出现一个opt目录,里面存放的是arm-linux-gcc解压好的内容。

    3、配置环境变量。

    先进入/opt/FriendlyARM/toolschain/4.4.3/bin目录中,用pwd命令查看路径。

    [root@localhost opt]# cd FriendlyARM/toolschain/4.4.3/bin/ [root@localhost bin]# pwd /opt/FriendlyARM/toolschain/4.4.3/bin

    用vim打开/etc/profile文件进行编辑,在下面输入:

    export PATH=$PATH:/opt/FriendlyARM/toolschain/4.4.3/bin

    注意:上面的路径一定要保持一致,不然系统要提示找不到交叉编译器!

    4、使用source /etc/profile 命令使配置文件/etc/profile生效。

    [root@localhost /]# source /etc/profile 5、使用arm-linux-gcc -v命令查看交叉编译器安装成功没有。 [root@localhost /]# arm-linux-gcc -v Using built-in specs. Target: arm-none-linux-gnueabi Configured with: /opt/FriendlyARM/mini2440/build-toolschain/working/src/gcc-4.4.3/configure --build=i386-build_redhat-linux-gnu --host=i386-build_redhat-linux-gnu --target=arm-none-linux-gnueabi --prefix=/opt/FriendlyARM/toolschain/4.4.3 --with-sysroot=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root --enable-languages=c,c++ --disable-multilib --with-arch=armv4t --with-cpu=arm920t --with-tune=arm920t --with-float=soft --with-pkgversion=ctng-1.6.1 --disable-sjlj-exceptions --enable-__cxa_atexit --with-gmp=/opt/FriendlyARM/toolschain/4.4.3 --with-mpfr=/opt/FriendlyARM/toolschain/4.4.3 --with-ppl=/opt/FriendlyARM/toolschain/4.4.3 --with-cloog=/opt/FriendlyARM/toolschain/4.4.3 --with-mpc=/opt/FriendlyARM/toolschain/4.4.3 --with-local-prefix=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-c99 --enable-long-long --enable-target-optspace Thread model: posix gcc version 4.4.3 (ctng-1.6.1)

    能够正确的显示交叉编译器的版本号,说明交叉编译器就已经安装完成了!下面就可以使用了

    转载请注明原文地址: https://ju.6miu.com/read-11563.html

    最新回复(0)