2

我正在尝试arm-eabi-ld用 installed from替换我的默认值binutils-gold ld,但是在链接期间我得到了

(..../*.o) requires unsupported dynamic reloc; recompile with -fPIC

LOCAL_CFLAGS := -fPIC在 Android.mk 中并没有太大帮助。有没有机会使用黄金链接器?

4

1 回答 1

3

好消息!

https://launchpad.net/ubuntu/+source/binutils/2.21.0.20110327-2ubuntu2/+buildjob/2436559的最新版本对我有用!

我的结果:

与 ld 连接:6 分钟

与黄金链接: 1分钟!!!!

安装脚本:

cd /tmp
wget https://launchpad.net/ubuntu/+source/binutils/2.21.0.20110327-2ubuntu2/+buildjob/2436559/+files/binutils_2.21.0.20110327-2ubuntu2_amd64.deb
wget https://launchpad.net/ubuntu/+source/binutils/2.21.0.20110327-2ubuntu2/+buildjob/2436559/+files/binutils-gold_2.21.0.20110327-2ubuntu2_amd64.deb

sudo dpkg -i binutils-gold_2.21.0.20110327-2ubuntu2_amd64.deb binutils_2.21.0.20110327-2ubuntu2_amd64.deb

cd $ANDROID_NDK_DIR/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/arm-eabi/bin/
mv ld ld.backup
ln -s /usr/bin/ld.gold ld 

cd $ANDROID_NDK_DIR/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/
mv arm-eabi-ld arm-eabi-ld.backup
ln -s /usr/bin/ld.gold arm-eabi-ld
于 2011-04-15T09:22:28.140 回答