-
Notifications
You must be signed in to change notification settings - Fork 564
Refactor Android, android_x64 support. #3306
Conversation
Spinner compiler and runs fine when build with this patch. |
@@ -59,9 +59,9 @@ private class LlvmPipelineConfiguration(context: Context) { | |||
KonanTarget.LINUX_ARM64 -> "generic" | |||
KonanTarget.ANDROID_ARM32 -> "arm7tdmi" | |||
KonanTarget.ANDROID_ARM64 -> "cortex-a57" | |||
KonanTarget.ANDROID_X64 -> "x86-64" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @sbogolepov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine.
"-I$toolchainSysroot/usr/include/c++/v1", | ||
"-I$toolchainSysroot/usr/include", | ||
"-I$toolchainSysroot/usr/include/$clangTarget") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this equal to what Android Studio uses to compile C++ sources with NDK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar.
@@ -108,13 +108,22 @@ open class AndroidLinker(targetProperties: AndroidConfigurables) | |||
return staticGnuArCommands(ar, executable, objectFiles, libraries) | |||
|
|||
val dynamic = kind == LinkerOutputKind.DYNAMIC_LIBRARY | |||
// liblog.so must be linked in, as we use its functionality in runtime. | |||
val toolchainSysroot = "${absoluteTargetToolchain}/sysroot" | |||
val apiSysroot = "${absoluteTargetSysRoot}/android-${Android.API}/arch-${Android.architectureForTarget(target)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as in ClangArgs
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not extract common logic then?
dependencies.macos_x64-android_arm64 = \ | ||
# Android ARM64, based on NDK. | ||
targetToolchain.macos_x64-android_arm64 = target-toolchain-1-osx-android_ndk | ||
dependencies.macos_x64-android_x64 = \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
android_x64
and android_arm64
seem mixed up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, wrong order.
android/keycodes.h \ | ||
android/log.h android/looper.h \ | ||
android/multinetwork.h \ | ||
android/native_activity.h android/native_window.h android/native_window.h android/ndk-version.h \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
android/native_window.h
twice?
android/window.h | ||
|
||
headerFilter = ** | ||
|
||
# TODO: make it uniform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does anything prevent this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, fixed.
linkerNoDebugFlags.android_arm64 = -Wl,-S | ||
|
||
# Android X64, based on NDK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not critical, but comment is wrong.
And in some other places too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong in which part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, below are definitions for ARM64, not X64.
No description provided.