Skip to content

Commit

Permalink
Remove the text relocation from the build
Browse files Browse the repository at this point in the history
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
  • Loading branch information
irbull committed Dec 23, 2018
1 parent 319816a commit d6421e4
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 42 deletions.
1 change: 1 addition & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'signing'

group = 'com.eclipsesource.j2v8'
archivesBaseName = 'j2v8'
version = '4.8.2'
version = '5.1.0-SNAPSHOT'

configurations {
archives {
Expand Down
27 changes: 0 additions & 27 deletions cmake/NodeJsUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -128,40 +128,13 @@ 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
${njs_out_v8}/libv8_libplatform.a
${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
# <LinkerGroup>
-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
# </LinkerGroup>
)

set (njs_${config_name}_libs ${njs_libs} PARENT_SCOPE)
#}
#-----------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docker/android/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG sys_image=debian:jessie
ARG sys_image=debian:jessie-slim

FROM $sys_image

Expand All @@ -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 && \
Expand Down
2 changes: 1 addition & 1 deletion docker/android/android.arm.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker/android/android.x86.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
9 changes: 4 additions & 5 deletions docker/shared/install.cmake.sh
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
-->
<os>linux</os>
<os>macos</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</properties>

<groupId>com.eclipsesource.j2v8</groupId>
<artifactId>j2v8_linux_x86_64</artifactId>
<version>4.8.0-SNAPSHOT</version>
<artifactId>j2v8_macos_x86_64</artifactId>
<version>5.1.0-SNAPSHOT</version>
<packaging>bundle</packaging>

<name>j2v8_linux_x86_64</name>
<name>j2v8_macos_x86_64</name>
<description>J2V8 is a set of Java bindings for V8</description>
<url>https://github.com/eclipsesource/j2v8</url>
<licenses>
Expand Down Expand Up @@ -173,4 +173,4 @@
</build>
</profile>
</profiles>
</project>
</project>

0 comments on commit d6421e4

Please sign in to comment.