我正在尝试使用arm-eabi-ld
binutils-gold
替换我的默认ld
,但是在链接期间我已经
(..../*.o) requires unsupported dynamic reloc; recompile with -fPIC
Android.mk中的 LOCAL_CFLAGS := -fPIC
没有多大帮助。有没有机会使用金链接器?
答案 0 :(得分: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