[swift-dev] Compiling Swift for Android x86

Max Rose max at lightwell.pro
Thu Aug 31 15:24:19 CDT 2017

Hi Everybody,

We're working on adding Android x86 to the available targets for Swift.
Currently we're able to compile an executable through the toolchain.
However, running the executable leads to a crash "cannot locate symbol
'__sync_val_compare_and_swap_16' referenced by '[...]libswiftCore.so'".

In comparing the swift standard library for ARM to our swift standard
library for x86 we noticed that the ARM standard library include symbols
for __sync_val_compare_and_swap_{1, 2, and 4}, but the x86 library has an
undefined symbol for __sync_val_compare_and_swap_16. This is the same for

My main questions are:
1) Where is the __sync_val_compare_and_swap coming from?
2) Does this seem like and issue linking to the wrong atomic library, or is
this a deeper issue?
3) Is comparing Android ARM to x86 a valid comparison or are the platforms
too different?

We're fairly new to compiler toolchains so any suggestions would be very
much appreciated! With the introduction of the Android apps to Chromebooks,
it will be great to be able to have Swift run on all Android platforms.


max rose | lead engineer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20170831/2b0125fc/attachment.html>

More information about the swift-dev mailing list