目录

0 前言

1 安装arm-linux-gcc-4.3.2

2 配置 nfs 服务器


0 前言

之前在 fedora 64bit 上建立交叉编译,但由于4.4.3版本需要另装用于gdb-server调试的gdb工具,而且折腾了很久,多个gdb版本都报错。还是乖乖用32bit的系统。

友善之臂提供的arm-linux-gcc4.4.2已经集成了 gdb,不用重新安装gdb


1 安装arm-linux-gcc-4.3.2

1.1 将 arm-linux-gcc-4.3.2.tgz 放到 home/hy/ARM 目录下

1.2 解压文件,注意 -C 为大写,改变解压目录的意思,C后面有一个空格,再加上一个根目录符号 /

[hy@localhost ARM]$ tar xvzf arm-linux-gcc-4.3.2.tgz -C /

1.3 添加系统环境变量,因为要修改 /etc下的文件,所以需要root

[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
#

1.4使文件立即生效,不须重启fedora:

[root@localhost ARM]# source /etc/profile

注:在切换回普通用户时,如:hy 用户时,可能需要重新使文件生效  source /etc/profile。

1.5检查版本,如下说明安装成功

[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]#

1.6 编译hello程序,如下,编译通过,如果是64位系统Fedora,这里还会报错。

[hy@localhost pjhello]$ arm-linux-gcc -o hello hello.c
[hy@localhost pjhello]$ ls
hello hello.c

2 配置 nfs 服务器

虚拟机共享文件给目标机,设置Vmware setting->Network-> Bridged

主机和目标机的IP设置在同一网段。

2.1 建立共享文件夹并设置权限

[hy@localhost ~]$ mkdir /home/hy/nfsshare
[hy@localhost ~]$ chmod 777 -R nfsshare/

2.2 添加共享

[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

2.3 目标机挂载共享文件夹

目标机挂载命令如下,注意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的更多相关文章

  1. Linux 安装 go 以及 arm linux 移植 go

    背景 Go是一门全新的静态类型开发语言,具有自动垃圾回收,丰富的内置类型,函数多返回值,错误处理,匿名函数,并发编程,反射等特性. 从Go1.4之后Go语言的编译器完全由Go语言编写,所以为了从源代码 ...

  2. 构建 ARM Linux 4.7.3 嵌入式开发环境 —— BusyBox 构建 RootFS

    上一篇我们已经成功将 ARM Linux 4.7.3 的内核利用 U-BOOT 引导了起来.但是细心的你会发现,引导到后面,系统无法启动,出现内核恐慌 (Kernel Panic). 原因是找不到文件 ...

  3. arm linux kernel 从入口到start_kernel 的代码分析

    参考资料: <ARM体系结构与编程> <嵌入式Linux应用开发完全手册> Linux_Memory_Address_Mapping http://www.chinaunix. ...

  4. How to build and run ARM Linux on QEMU from scratch

    This blog shows how to run ARM Linux on QEMU! This can be used as a base for later projects using th ...

  5. 【Qt开发】【VS开发】【Linux开发】OpenCV、Qt-MinGw、Qt-msvc、VS2010、VS2015、Ubuntu Linux、ARM Linux中几个特别容易混淆的内容

    [Qt开发][VS开发][Linux开发]OpenCV.Qt-MinGw.Qt-msvc.VS2010.VS2015.Ubuntu Linux.ARM Linux中几个特别容易混淆的内容 标签:[Qt ...

  6. ARM Linux Qt 5.x.x 无标题栏

    /********************************************************************************* * ARM Linux Qt 5. ...

  7. 构建 ARM Linux 4.7.3 嵌入式开发环境 —— U-BOOT 引导 Kernel

    经过若干天的反复测试,搜索.终于成功利用 Qemu 在 u-boot 下引导 ARM Linux 4.7.3 内核.如下详细解释整个构建过程. 准备环境 运行环境:Ubuntu 16.04 需要的虚拟 ...

  8. ARM Linux 3.x的设备树(Device Tree)

    http://blog.csdn.net/21cnbao/article/details/8457546 宋宝华 Barry Song <21cnbao@gmail.com> 1.     ...

  9. ARM Linux启动代码分析

    前言 在学习.分析之前首先要弄明白一个问题:为什么要分析启动代码? 因为启动代码绝大部分都是用汇编语言写的,对于没学过或者不熟悉汇编语言的同学确实有一定难度,但是如果你想真正深入地学习Linux,那么 ...

  10. ARM Linux 3.x的设备树(Device Tree)

    1. ARM Device Tree起源 Linus Torvalds在2011年3月17日的ARM Linux邮件列表宣称“this whole ARM thing is a f*cking pai ...

随机推荐

  1. 记录 git 常用的操作命令总结

    记录 git 常用的操作命令总结 2016-12-15 16:44:04 作为一名开发者,熟悉使用 git 代码管理工具是一项必备的基本技能.git 相较 SVN 而言,其优点不言而喻.git 的功能 ...

  2. GDB 完全教程

    一.简介 GDB是一个功能强大的调试器,它是一个自由软件,能够用在许多UNIX平台上.它同时也是Linux系统中的默认调试器.GDB已被移植到许多其他的计算机平台上,并且能够用于调试嵌入式实时系统.一 ...

  3. .net core ClaimsPrincipal Class

    hClaimsPrincipal Class ttps://msdn.microsoft.com/en-us/library/system.identitymodel.services.claimsp ...

  4. 如何将网页的title前面的图标替换成自己的图标

    首先要准备自己的图标,图标必须是.ico格式的图片,网上有很多在线工具可以将自己的图片转换成ico格式的图片,这里给大家介绍两个网站 在线ico转换工具:生成的图标是可以选尺寸的,原图片的大小不限制 ...

  5. HBase Zookeeper 安装学习

    https://my.oschina.net/hanzhankang/blog/129335 http://blog.itpub.net/27099995/viewspace-1394831/ htt ...

  6. [LeetCode] Arithmetic Slices II - Subsequence 算数切片之二 - 子序列

    A sequence of numbers is called arithmetic if it consists of at least three elements and if the diff ...

  7. CCF 201512-4 送货(错误)

    直接用DFS深搜,检查了好久没能发现错误,贴上来以后慢慢看... /* DFS深度优先搜索 Edge保存边 u{v,been} cnt记录走过的街道 如果没有就return ;继续递归 */ #inc ...

  8. js中的原型prototype

    var arr1 = new Array(12,34,98,43,38,79,56,1); arr1.sum=function (){ var result = 0; for(var i=0; i&l ...

  9. Java常见Exception整理

    前言: 技术开发入坑近1年,摸打滚爬,各种升级打怪.因目前从事Java相关,故整理了一下并把常见的异常(Exception)贴出来,一来为了后续提醒自己,二来供即将入坑的朋友打一下预防针!A级(代码逻 ...

  10. codeforces754D Fedor and coupons

    本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作. 本文作者:ljh2000 作者博客:http://www.cnblogs.com/ljh2000-jump/ ...