Chinaunix首页 | 论坛 | 博客
  • 博客访问: 210209
  • 博文数量: 145
  • 博客积分: 3000
  • 博客等级: 中校
  • 技术积分: 1720
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-14 18:42
文章分类

全部博文(145)

文章存档

2011年(1)

2009年(144)

我的朋友

分类: LINUX

2009-08-18 11:24:08

by tangke 2009-08-18

本文主要讲解龙芯平台上面的android移植过程。

从mips网站上面
下载source code大概在2.5G左右吧。

然后通过我前面讲到的建立一个交叉编译环境
http://blog.chinaunix.net/u3/100996/showart.php?id=2003850

然后下载使用jdk的x86版本。
注意这个地方一定要用jdk的x86版本,而不是使用mispel版本。
然后我们通过在.bashrc文件里面修改建立环境变量
 
 export PATH=${PATH}:/root/android-sdk-linux_x86-1.5_r1/tools
 export PATH=${PATH}:/root/jdk1.6.0_14/bin

 export JAVA_HOME=/root/jdk1.6.0_14/
 export ANDROID_HOME=${JAVA_HOME}
 export CLASSPATH=${JAVA_HOME}/lib:${CLASSPATH}

 export ANDROID_JAVA_HOME=/root/jdk1.6.0_14/

建立交叉编译环境镜像,因为mipsandroid使用/opt/mips-4.3/bin/下面的一个具体路径,所以我们需要做一个链接
ln -s /usr/bin/mipsel-linux-gnu-gcc-4.0 /opt/mips-4.3/bin/mips-linux-gnu-gcc
ln -s /usr/bin/mipsel-linux-gnu-g++-4.0 /opt/mips-4.3/bin/mips-linux-gnu-g++
ln -s /usr/bin/mipsel-linux-gnu-ld /opt/mips-4.3/bin/mips-linux-gnu-ld
ln -s /usr/bin/mipsel-linux-gnu-ar /opt/mips-4.3/bin/mips-linux-gnu-ar

然后我们进入mipsandroid目录,
export TARGET_ARCH=mips
export TARGET_ARCH_VERSION=mips32
make
但是我们发现最终还是出现了问题
"out/target/product/generic/obj/lib/crtbegin-static.o:In function '__start':
(.text+0x14):relocation truncated to fit: R_MIPS_PC16 against '__libc_init'
collect2:ld returned 1 exit status
初步怀疑可能是交叉编译器的问题

该问题我已经提交到mips官方,以下是提交内容以及回复:

Bug #9

compile error

Added by ago. Updated 7 days ago.

Status: New Start: 08/18/2009
Priority: Normal Due date:
Assigned to: - % Done:

0%

Category: - Spent time: -
Target version: -

Description

hi guys.
when I use the cross-compile [version :4.0.4] to compile the source code,end with
error
"out/target/product/generic/obj/lib/crtbegin-static.o:In function '__start':
(.text+0x14):relocation truncated to fit: R_MIPS_PC16 against '__libc_init'
collect2:ld returned 1 exit status

so I thinks maybe the cross-compiler's version is too low, when I use the version 4.3
the issue is found too.

who can give me some support?

tangke

thanks in advance

(903 Bytes) Lan Yixun, 08/18/2009 08:08 PM

History

Updated by ago

  • File added
Comment

I encountered the same error too, the toolchain which I used is generated by gentoo's crossdev.
$mipsel-softfloat-linux-gnu-gcc -v
Using built-in specs.
Target: mipsel-softfloat-linux-gnu
Configured with: /var/build/cross/mipsel-softfloat-linux-gnu/portage/cross-mipsel-softfloat-linux-gnu/gcc-4.3.4/work/gcc-4.3.4/configure --prefix=/usr --bindir=/usr/i486-pc-linux-gnu/mipsel-softfloat-linux-gnu/gcc-bin/4.3.4 --includedir=/usr/lib/gcc/mipsel-softfloat-linux-gnu/4.3.4/include --datadir=/usr/share/gcc-data/mipsel-softfloat-linux-gnu/4.3.4 --mandir=/usr/share/gcc-data/mipsel-softfloat-linux-gnu/4.3.4/man --infodir=/usr/share/gcc-data/mipsel-softfloat-linux-gnu/4.3.4/info --with-gxx-include-dir=/usr/lib/gcc/mipsel-softfloat-linux-gnu/4.3.4/include/g++-v4 --host=i486-pc-linux-gnu --target=mipsel-softfloat-linux-gnu --build=i486-pc-linux-gnu --disable-altivec --disable-fixed-point --with-float=soft --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --disable-libmudflap --disable-libssp --disable-libgomp --enable-cld --disable-libgcj --enable-languages=c,c++ --with-sysroot=/usr/mipsel-softfloat-linux-gnu --disable-bootstrap --disable-libgomp --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl= --with-pkgversion='Gentoo 4.3.4 p1.0, pie-10.1.5'
Thread model: posix
gcc version 4.3.4 (Gentoo 4.3.4 p1.0, pie-10.1.5)

$mipsel-softfloat-linux-gnu-ld -v
GNU ld (Linux/GNU Binutils) 2.19.51.0.9.20090606


阅读(1137) | 评论(1) | 转发(0) |
0

上一篇:Linux,kernel, compile

下一篇:xrandr, xvattr

给主人留下些什么吧!~~

chinaunix网友2010-11-07 02:41:34

博主,后来,这事有下文了吗?