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

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

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

最佳答案

好消息!

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

关于android - binutils-gold是否支持arm/Android?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4955070/

10-12 20:38