Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1522577
  • 博文数量: 290
  • 博客积分: 3468
  • 博客等级: 中校
  • 技术积分: 3461
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-28 22:21
文章分类

全部博文(290)

文章存档

2016年(13)

2015年(3)

2014年(42)

2013年(67)

2012年(90)

2011年(75)

分类: LINUX

2011-01-27 15:27:37

系统环境:ubuntu 10.04
交叉编译工具链:gcc-3.4.6.tar.gz
下载地址:

gcc-3.3 :     库最齐全
gcc-3.4.6: http://dev.lemote.com/files/binary/toolchain/kernel/gcc-3.4.6-newbin.ls2f.tar.gz
gcc-4.3: 

gcc-4.4.3:1.搭建交叉编译工具环境环境
$ sudo chmod 766 /opt    // gcc3.3 是解压到根目录(/)
$ tar xf mipsel-gcc-3.4.6.tar.gz -C  /opt
$ export PATH=/opt/gcc-4.3/bin:$PATH

如果需要在另外的终端和重启机子后都包含这环境变量的话,可以把/opt/gcc-3.4.6/bin: 添加到~/.bashrc文件下,然后重启终端。操作步骤如下:
$ cat >> ~/.bashrc << "EOF
> export PATH=$PATH:/opt/gcc-4.3/bin/
> EOF


说明:交叉工具链的存放位置是根据($ mipsel-linux-gcc -v) 显示内容中 --prefix后面的内容决定的,如果存放的位置与其不一致,有时会出现一些意想不到的错误
$ mipsel-linux-gcc -v    
从 /opt/gcc-3.4.6/bin/../lib/gcc/mipsel-linux/3.4.6/specs 读取 specs
配置为:../gcc-3.4.6/configure --prefix=/opt/gcc-3.4.6/ --target=mipsel-linux --host=i686-linux --enable-threads=posix --enable-shared --disable-checking --enable-languages=c,c++,f77 -v
线程模型:posix
gcc version 3.4.6

2.查看编译后的可执行文件的文件信息(mips  or  x86)
$ file rdesktop
rdesktop: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.0, not stripped

3.查看编译后的库的信息(mips  or  x86)
$ readelf -h libxcb.so
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           MIPS R3000
  Version:                           0x1
  Entry point address:               0x6f60
  Start of program headers:          52 (bytes into file)
  Start of section headers:          169104 (bytes into file)
  Flags:                             0x10001007, noreorder, pic, cpic, o32, mips2
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         4
  Size of section headers:           40 (bytes)
  Number of section headers:         33
  Section header string table index: 30

阅读(5599) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~