Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Refactor Android, android_x64 support. #3306

Merged
merged 6 commits into from
Sep 4, 2019
Merged

Refactor Android, android_x64 support. #3306

merged 6 commits into from
Sep 4, 2019

Conversation

olonho
Copy link
Contributor

@olonho olonho commented Sep 2, 2019

No description provided.

@olonho
Copy link
Contributor Author

olonho commented Sep 3, 2019

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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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")
}
Copy link
Collaborator

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?

Copy link
Contributor Author

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)}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in ClangArgs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Copy link
Collaborator

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 = \
Copy link
Collaborator

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.

Copy link
Contributor Author

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 \
Copy link
Collaborator

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does anything prevent this?

Copy link
Contributor Author

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.
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong in which part?

Copy link
Contributor

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.

@olonho olonho merged commit 66b813a into master Sep 4, 2019
@olonho olonho deleted the better_android branch September 4, 2019 11:50
@olonho olonho restored the better_android branch September 5, 2019 08:33
@olonho olonho deleted the better_android branch September 30, 2019 21:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants