Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for arm64-v8a on Android #380

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions build_system/build_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
"node_enabled": True,
},
},
{
"name": "android-arm64 @ Docker",
"params": {
"target": c.target_android,
"arch": c.arch_arm64,
"docker": True,
"node_enabled": True,
},
},
# ALPINE LINUX builds
{
"name": "alpine-linux-x64 @ Docker",
Expand Down
1 change: 1 addition & 0 deletions build_system/build_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@
c.arch_x86,
c.arch_x64,
c.arch_arm,
c.arch_arm64
]
7 changes: 4 additions & 3 deletions build_system/config_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import build_utils as b
import cmake_utils as cmu

android_config = PlatformConfig(c.target_android, [c.arch_x86, c.arch_arm])
android_config = PlatformConfig(c.target_android, [c.arch_x86, c.arch_arm, c.arch_arm64])

android_config.set_cross_configs({
"docker": DockerBuildStep(
Expand All @@ -21,13 +21,14 @@

android_config.set_file_abis({
c.arch_arm: "armeabi-v7a",
c.arch_x86: "x86"
c.arch_x86: "x86",
c.arch_arm64: "arm64-v8a"
})

#-----------------------------------------------------------------------
def build_node_js(config):
return [
"""android-gcc-toolchain $ARCH --api 17 --host gcc-lpthread -C \
"""android-gcc-toolchain $ARCH --api 21 --host gcc-lpthread -C \

Choose a reason for hiding this comment

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

Only need to set api to 21 when build arm64, maybe return different config for different abi.

sh -c \" \\
cd ./node; \\
./configure \\
Expand Down
1 change: 1 addition & 0 deletions build_system/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
arch_x86 = 'x86'
arch_x64 = 'x64'
arch_arm = 'arm'
arch_arm64 = 'arm64'

# atomic build-steps
build_node_js = 'nodejs'
Expand Down
2 changes: 1 addition & 1 deletion build_system/docker_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def health_check(self, config):
if (server_match is None or server_match.group(1) is None):
utils.cli_exit("ERROR: Unable to determine docker server version from version string: \n\n" + version_str)

version_match = re.search(r"^ OS/Arch:\s+(.*)$", server_match.group(1), re.MULTILINE)
version_match = re.search(r"^ OS/Arch:\s+(.*)$", server_match.group(1), re.MULTILINE)

if (version_match is None):
utils.cli_exit("ERROR: Unable to determine docker server platform from version string: \n\n" + version_str)
Expand Down
2 changes: 1 addition & 1 deletion docker/android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN mkdir /usr/local/android-sdk/tools/keymaps && \
touch /usr/local/android-sdk/tools/keymaps/en-us

# install the required license for sdk-build-tools
RUN mkdir -p $ANDROID_HOME/licenses && echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55\n" > $ANDROID_HOME/licenses/android-sdk-license
RUN mkdir -p $ANDROID_HOME/licenses && echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55\nd56f5187479451eabf01fb78af6dfcb131a6481e\n" > $ANDROID_HOME/licenses/android-sdk-license

# java must be installed at this point, because the following android CLI commands depend on it
COPY ./shared/install.jdk.sh /temp/docker/shared
Expand Down
7 changes: 7 additions & 0 deletions docker/android/android.arm64.toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set(CMAKE_SYSTEM_NAME Android)
set(CMAKE_SYSTEM_VERSION 21) # API level

set(CMAKE_ANDROID_ARCH arm)
set(CMAKE_ANDROID_ARCH_ABI arm64-v8a)
set(CMAKE_ANDROID_NDK /build/android-ndk-r13b/)
set(CMAKE_ANDROID_STL_TYPE gnustl_static)
2 changes: 1 addition & 1 deletion jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
APP_ABI := armeabi-v7a x86
APP_ABI := armeabi-v7a x86 arm64-v8a
APP_PLATFORM := android-15
APP_STL=gnustl_static