标签:
0 前言
1 安装arm-linux-gcc-4.3.2
2 配置 nfs 服务器
之前在 fedora 64bit 上建立交叉编译,但由于4.4.3版本需要另装用于gdb-server调试的gdb工具,而且折腾了很久,多个gdb版本都报错。还是乖乖用32bit的系统。
友善之臂提供的arm-linux-gcc4.4.2已经集成了 gdb,不用重新安装gdb
[hy@localhost ARM]$ tar xvzf arm-linux-gcc-4.3.2.tgz -C /
[hy@localhost ARM]$ su Password: [root@localhost ARM]# vi /etc/profile
在profile的最后一行添加路径,保存退出 :
##hy add 3.22 export PATH=$PATH:/usr/local/arm/4.3.2/bin #
[root@localhost ARM]# source /etc/profile
注:在切换回普通用户时,如:hy 用户时,可能需要重新使文件生效 source /etc/profile。
[root@localhost ARM]# arm-linux-gcc -v Using built-in specs. Target: arm-none-linux-gnueabi Configured with: /scratch/julian/lite-respin/linux/src/gcc-4.3/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion=‘Sourcery G++ Lite 2008q3-72‘ --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin Thread model: posix gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72)
检查arm-linux-gdb -v
[root@localhost ARM]# arm-linux-gdb -v GNU gdb (Sourcery G++ Lite 2008q3-72) 6.8.50.20080821-cvs Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi". For bug reporting instructions, please see: <https://support.codesourcery.com/GNUToolchain/>. [root@localhost ARM]#
[hy@localhost pjhello]$ arm-linux-gcc -o hello hello.c [hy@localhost pjhello]$ ls hello hello.c
虚拟机共享文件给目标机,设置Vmware setting->Network-> Bridged
主机和目标机的IP设置在同一网段。
[hy@localhost ~]$ mkdir /home/hy/nfsshare [hy@localhost ~]$ chmod 777 -R nfsshare/
[root@localhost hy]# vim /etc/exports
/home/hy/nfsshare *(sync,rw,no_root_squash)
查看共享的文件夹
[root@localhost hy]# showmount -e Export list for localhost.localdomain: /home/hy/nfsshare *
出现共享的文件列表时,说明主机的 nfs 配置正确。如果报错,请检查 nfs 状态和防火墙。
检查nfs的状态
[hy@localhost ~]$ systemctl status nfs.service
开启nfs服务
[root@localhost hy]# service nfs start Redirecting to /bin/systemctl start nfs.service
停止,开始防火墙
[root@localhost init.d]# systemctl stop firewalld.service [root@localhost init.d]# systemctl start firewalld.service
禁用防火墙,
[root@localhost init.d]# systemctl disable firewalld.service
目标机挂载命令如下,注意IP为主机的IP地址,且在同一网段:
[root@FriendlyARM /]# mount -t nfs -o nolock 192.168.1.8:/home/hy/nfsshare/ /mnt mount: RPC: Unable to receive; errno = No route to host
挂载时报错错,这时应检查主机的防火墙和 nfs 的状态。
挂载成功后,在目标机的 /mnt/目录下,就可看到共享的文件
http://www.linuxidc.com/Linux/2011-02/32733.htm
Fedora20-32bit cross-compiling arm-linux-gcc4.3.2
标签:
原文地址:http://www.cnblogs.com/hythink/p/5308728.html