SwiftAndroid / swift

Port of Apple's reference Swift toolchain to Android; doesn't quite work yet
Apache License 2.0
720 stars 32 forks source link

[android] Remove SunSoft libm dependencies #18

Closed modocache closed 8 years ago

modocache commented 8 years ago

SunSoft libm dependencies introduce licensing issues when considering merging this fork upstream. Remove them for Android only. In order to do so, we must also remove the reference to log2 in stdlib/public/core/BuiltinMath.swift,gyb. Conditionally remove that reference by passing an additional parameter to the gyb template.

modocache commented 8 years ago

I'll add a test that uses log2, then mark it as XFAIL for Android.

modocache commented 8 years ago

Actually, we may be able to get log2 by updating the Android NDK version we use. That sounds like the better approach!

modocache commented 8 years ago

Fixed in https://github.com/SwiftAndroid/swift/commit/4a39bc65e585d9f1b7b3258094effb22d0610a60!

zhuowei commented 8 years ago

Does this mean we can't run on Android 4.4 and below? That's like half the Android devices out there: http://developer.android.com/about/dashboards/index.html

Note that the SunSoft libm was originally taken from NDK's support library - I wonder if statically linking it would be acceptable.

modocache commented 8 years ago

Does this mean we can't run on Android 4.4 and below? That's like half the Android devices out there

Yeah... I'm aware of the tradeoff, but I think it's the right one to make. Sending a pull request for the work we have here could benefit the greater community. We could then try and support Android 4.4 and below as a future improvement. Making this change now doesn't prevent that work from being done in the future.