[swift-dev] Android: wrong ld (linker) keeps being invoked

Brian Gesiak modocache at gmail.com
Sun Sep 25 20:53:18 CDT 2016


Eric,

This is definitely something I'd like to improve. I believe karwa's new
`-tools-directory` option (https://github.com/apple/swift/pull/2912 and
https://github.com/apple/swift/pull/4543) could take care of this problem.
If so, we should update docs/Android.md to recommend using that. Could you
try using that?

As for me, I've found success with the symlink solution up until now. I'm
not sure why it doesn't work in your case...

I believe that in later versions of Clang, -fuse-ld accepts full paths to
linkers. So it may work if you have a sufficiently recent version --
although I haven't tried myself.

- Brian Gesiak



On Sat, Sep 24, 2016 at 8:26 PM, Eric Wing via swift-dev <
swift-dev at swift.org> wrote:

> I'm being hit by the problem where the wrong linker is being invoked
> when trying to build a program with swiftc for Android.
>
> The problem seems to already be known and reported here, but the
> solutions/workarounds don't fully work for me:
> https://bugs.swift.org/browse/SR-1264
>
> The only way I can make this work is by removing/renaming my system
> installed /usr/bin/ld.gold so the process can't find it.
>
>
> - Changing my PATH so another ld.gold is found first didn't affect
> things. It looks like it always prefers /usr/bin/ld.gold.
>
> - Adding the symlink for /usr/bin/armv7-none-linux-androideabi-ld.gold
> didn't help (until I removed my /usr/bin/ld.gold
>
> - Using the -use-ld=  switch seemed to have absolutely no effect for
> me. (I tried multiple things like armv7 to find an ld.armv7 and also
> tried full explicit paths to the real android ld.gold)
>
> Any ideas on how to fix this? I don't like having to remove my system
> ld.gold.
>
> Thanks,
> Eric
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20160925/f0d06afe/attachment.html>


More information about the swift-dev mailing list