[swift-dev] Cross-compile for Android armv7 from OSX

Tom Gall tom.gall at linaro.org
Mon Jan 18 15:07:14 CST 2016


Cool!

I was just starting a similar exercise but using x86-64 linux as the
host since I've managed to get swift building and running on my
arm-linux box.

Cheers!

On Mon, Jan 18, 2016 at 1:03 PM, Geordie Jay via swift-dev
<swift-dev at swift.org> wrote:
> I have just pushed a branch to the SwiftAndroid repo that is at the stage of
> correctly compiling the swift toolchain and stdlib objects for android-armv7
> and macosx-x86_64 (as verified using nm from the different toolchains):
> https://github.com/SwiftAndroid/swift/tree/osx-crosscompile. The problem is
> it fails at the linker stage.
>
> Basically the OSX linker doesn't understand the “—sysroot” option (See
> AddSwift.cmake:59). Up until that point though (throughout the compiling
> stage), we need that option because otherwise the Android components attempt
> to use OSX /usr/include, which throws all sorts of errors because of wrong
> architecture etc. Why it fails to compile when I remove the “—sysroot”
> option, but also fails _with_ it in the link stage will probably be key to
> fixing this. Again, it seems that what we really need to do is use the
> Android linker, not the Xcode one.
>
> I'm going to try figure out how to do that tomorrow but not confident I’ll
> get far given my limited experience with this.. This work may also be of
> interest to the Raspberry Pi / BeagleBoard folks, would also love to hear
> some opinions about how to solve the CMAKE_SYSTEM_NAME problem, that will
> also affect cross-compilation for those uses. In any case, any hints or
> collaborators would be most welcome.
>
> Geordie
>
>
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev
>



-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Director, Linaro Mobile Group
Tech Lead, GPGPU
Linaro.org │ Open source software for ARM SoCs
irc: tgall_foo | skype : tom_gall


More information about the swift-dev mailing list