From d6421e48d20d8db5d3e438c0ffedc9e132d1f6ec Mon Sep 17 00:00:00 2001 From: Ian Bull Date: Sun, 23 Dec 2018 13:16:31 -0800 Subject: [PATCH] Remove the text relocation from the build The x86 binaries were failing at runtime on Android because of text relocation that existed in the shared object. The text relocation was a result of the openssl library. This libary is not needed for J2V8 so it was removed. This change-set also updates the NDK to version 14 and updates the version of CMake that is used during the build. With this change-set applied, x86 and ARM builds should now work. The version was set to 5.1.0-SNAPSHOT, as we had lots of failed builds during 5.0. Change-Id: I1bef1e0226ddf2e209b48d3f6467bb287acc421f --- .classpath | 1 + build.gradle | 2 +- cmake/NodeJsUtils.cmake | 27 ---------------------- docker/android/Dockerfile | 4 ++-- docker/android/android.arm.toolchain.cmake | 2 +- docker/android/android.x86.toolchain.cmake | 2 +- docker/shared/install.cmake.sh | 9 ++++---- pom.xml | 10 ++++---- 8 files changed, 15 insertions(+), 42 deletions(-) diff --git a/.classpath b/.classpath index 1710c0b63..7b5edac37 100644 --- a/.classpath +++ b/.classpath @@ -10,6 +10,7 @@ + diff --git a/build.gradle b/build.gradle index 6193032e8..ff363c54b 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'signing' group = 'com.eclipsesource.j2v8' archivesBaseName = 'j2v8' -version = '4.8.2' +version = '5.1.0-SNAPSHOT' configurations { archives { diff --git a/cmake/NodeJsUtils.cmake b/cmake/NodeJsUtils.cmake index 5f6c3b9d3..276869210 100644 --- a/cmake/NodeJsUtils.cmake +++ b/cmake/NodeJsUtils.cmake @@ -128,14 +128,6 @@ function (get_njs_libs nodejs_dir config_name fail_on_missing_libs) # Node.js link libraries set (njs_libs - # node libs - ${njs_out_deps}/uv/libuv.a - ${njs_out_deps}/openssl/libopenssl.a - ${njs_out_deps}/http_parser/libhttp_parser.a - ${njs_out_deps}/gtest/libgtest.a - ${njs_out_deps}/zlib/libzlib.a - ${njs_out_deps}/cares/libcares.a - # v8 libs ${njs_out_v8}/libv8_base.a ${njs_out_v8}/libv8_nosnapshot.a @@ -143,25 +135,6 @@ function (get_njs_libs nodejs_dir config_name fail_on_missing_libs) ${njs_out_v8}/libv8_libbase.a ${njs_out_v8}/libv8_libsampler.a ) - - # verify that all required Node.js libs actually exist - if (${fail_on_missing_libs}) - assert_nodejs_libs_exist(${njs_libs} ${njs_out_target}/libnode.a) - endif() - - # finalize linker settings - set (njs_libs - # - -Wl,--start-group - # the carefree libs - ${njs_libs} - - # Node.js libs that require special linker treatments - -Wl,--whole-archive ${njs_out_target}/libnode.a -Wl,--no-whole-archive - -Wl,--end-group - # - ) - set (njs_${config_name}_libs ${njs_libs} PARENT_SCOPE) #} #----------------------------------------------------------------------- diff --git a/docker/android/Dockerfile b/docker/android/Dockerfile index c9cb7fcf2..c8279d43b 100644 --- a/docker/android/Dockerfile +++ b/docker/android/Dockerfile @@ -1,4 +1,4 @@ -ARG sys_image=debian:jessie +ARG sys_image=debian:jessie-slim FROM $sys_image @@ -15,7 +15,7 @@ RUN ./install.debian.packages.sh ENV ANDROID_HOME "/usr/local/android-sdk" -ENV NDK_VERSION "r13b" +ENV NDK_VERSION "r14b" ENV NDK_NAME "android-ndk-$NDK_VERSION-linux-x86_64" RUN echo "Preparing Android NDK..." && \ mkdir -p /build && \ diff --git a/docker/android/android.arm.toolchain.cmake b/docker/android/android.arm.toolchain.cmake index 21a0aa3b7..5b7bac3d0 100644 --- a/docker/android/android.arm.toolchain.cmake +++ b/docker/android/android.arm.toolchain.cmake @@ -3,7 +3,7 @@ set(CMAKE_SYSTEM_VERSION 17) # API level set(CMAKE_ANDROID_ARCH arm) set(CMAKE_ANDROID_ARCH_ABI armeabi-v7a) -set(CMAKE_ANDROID_NDK /build/android-ndk-r13b/) +set(CMAKE_ANDROID_NDK /build/android-ndk-r14b/) set(CMAKE_ANDROID_STL_TYPE gnustl_static) # ARM specific settings diff --git a/docker/android/android.x86.toolchain.cmake b/docker/android/android.x86.toolchain.cmake index 819684b67..a30e264e8 100644 --- a/docker/android/android.x86.toolchain.cmake +++ b/docker/android/android.x86.toolchain.cmake @@ -3,5 +3,5 @@ set(CMAKE_SYSTEM_VERSION 17) # API level set(CMAKE_ANDROID_ARCH x86) set(CMAKE_ANDROID_ARCH_ABI x86) -set(CMAKE_ANDROID_NDK /build/android-ndk-r13b/) +set(CMAKE_ANDROID_NDK /build/android-ndk-r14b/) set(CMAKE_ANDROID_STL_TYPE gnustl_static) diff --git a/docker/shared/install.cmake.sh b/docker/shared/install.cmake.sh index 8f9ea88c6..71e00f052 100755 --- a/docker/shared/install.cmake.sh +++ b/docker/shared/install.cmake.sh @@ -1,7 +1,6 @@ - echo "Preparing CMake..." -curl https://cmake.org/files/v3.8/cmake-3.8.1-Linux-x86_64.sh -O +curl https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2-Linux-x86_64.sh -O -L mkdir /opt/cmake -chmod +x cmake-3.8.1-Linux-x86_64.sh -./cmake-3.8.1-Linux-x86_64.sh --prefix=/opt/cmake --skip-license -rm -rf cmake-3.8.1-Linux-x86_64.sh +chmod +x cmake-3.13.2-Linux-x86_64.sh +./cmake-3.13.2-Linux-x86_64.sh --prefix=/opt/cmake --skip-license +rm -rf cmake-3.13.2-Linux-x86_64.sh diff --git a/pom.xml b/pom.xml index d4d933fa9..09ed4a925 100644 --- a/pom.xml +++ b/pom.xml @@ -15,17 +15,17 @@ If you want to specify a different version string for the JAR bundle, please change the values in build_settings.py instead. --> - linux + macos gtk x86_64 com.eclipsesource.j2v8 - j2v8_linux_x86_64 - 4.8.0-SNAPSHOT + j2v8_macos_x86_64 + 5.1.0-SNAPSHOT bundle - j2v8_linux_x86_64 + j2v8_macos_x86_64 J2V8 is a set of Java bindings for V8 https://github.com/eclipsesource/j2v8 @@ -173,4 +173,4 @@ - \ No newline at end of file +