aboutsummaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-12-10 18:56:43 +0100
committerSven Gothel <[email protected]>2019-12-10 18:56:43 +0100
commitb6a91a035c14f1e4d142517f311007e48ea9c0c1 (patch)
tree1c4913130dc7d3872a506230eec4fd1d1dd16022 /make
parent74e5bbe097a07d1275a2d6452d1e2336a8d5c44a (diff)
Bug 1417 - Android: Complete 1st round: make/lib/gluegen-cpptask-android-<abi>.xml and scripts
All aligned now - gluegen-cpptasks-android-aarch64.xml - gluegen-cpptasks-android-armv6.xml (this has ld flag --no-undefined disabled, due to internal missing symbols) - gluegen-cpptasks-android-x86.xml
Diffstat (limited to 'make')
-rw-r--r--make/lib/gluegen-cpptasks-android-aarch64.xml50
-rw-r--r--make/lib/gluegen-cpptasks-android-armv6.xml129
-rw-r--r--make/lib/gluegen-cpptasks-android-x86.xml120
-rwxr-xr-xmake/scripts/make.gluegen.all.android-armv6-cross.sh43
-rwxr-xr-xmake/scripts/make.gluegen.all.android-x86-cross.sh48
-rw-r--r--make/scripts/setenv-android-tools.sh3
6 files changed, 197 insertions, 196 deletions
diff --git a/make/lib/gluegen-cpptasks-android-aarch64.xml b/make/lib/gluegen-cpptasks-android-aarch64.xml
index 4b6401b..2ebe9ee 100644
--- a/make/lib/gluegen-cpptasks-android-aarch64.xml
+++ b/make/lib/gluegen-cpptasks-android-aarch64.xml
@@ -35,18 +35,17 @@
<compiler id="compiler.cfg.android" name="clang">
<compilerarg value="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT}" />
- <!-- compilerarg value="-v" / -->
+ <compilerarg value="-v" />
<compilerarg value="-fpic" />
- <!-- compilerarg value="-fPIE" / --> <!-- not for shared libs, won't produce symbols -->
- <!-- compilerarg value="-pie" / --> <!-- not for shared libs, won't produce symbols -->
<!-- from sdk cmake start -->
<compilerarg value="-fdata-sections" />
<compilerarg value="-ffunction-sections" />
<compilerarg value="-funwind-tables" />
<compilerarg value="-fstack-protector-strong" />
- <!-- compilerarg value="-no-canonical-prefixes" / --> <!-- will disallow creating shared library -->
+ <compilerarg value="-no-canonical-prefixes" />
+ <compilerarg value="-nostdinc++" />
<!-- from sdk cmake end -->
<compilerarg value="-Wa,--noexecstack" />
@@ -59,25 +58,21 @@
<!-- compilerarg value="-mfloat-abi=softfp" / -->
<!-- Generic ARM Flags -->
+ <compilerarg value="-fno-strict-aliasing"/> <!-- be safe -->
+
<compilerarg value="-O2" unless="c.compiler.use-debug" />
<!-- compilerarg value="-g" unless="c.compiler.use-debug" / -->
<compilerarg value="-fomit-frame-pointer" unless="c.compiler.use-debug"/>
- <compilerarg value="-fstrict-aliasing" unless="c.compiler.use-debug"/>
<!-- compilerarg value="-funswitch-loops" unless="c.compiler.use-debug"/ not supported -->
<!-- compilerarg value="-finline-limit=300" unless="c.compiler.use-debug"/ not supported -->
<compilerarg value="-O0" if="c.compiler.use-debug" />
<compilerarg value="-g" if="c.compiler.use-debug" />
<compilerarg value="-fno-omit-frame-pointer" if="c.compiler.use-debug" />
- <compilerarg value="-fno-strict-aliasing" if="c.compiler.use-debug" />
<!-- includepath path="${env.ANDROID_TOOLCHAIN_SYSROOT_INC}" / -->
<defineset>
<define name="__unix__" />
- <!-- define name="__ARM_ARCH_5__" />
- <define name="__ARM_ARCH_5T__" />
- <define name="__ARM_ARCH_5E__" />
- <define name="__ARM_ARCH_5TE__" / -->
<define name="__LP64__" /> <!-- default pre-defined macro for 64bit unix -->
<define name="__aarch64__" /> <!-- default pre-defined macro for armv8-a, 64bit -->
@@ -90,39 +85,36 @@
<linker id="linker.cfg.android" name="clang">
<linkerarg value="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT}" />
- <!-- linkerarg value="-Wl,-L,${env.ANDROID_TOOLCHAIN_SYSROOT_LIB_0}" / -->
- <linkerarg value="-Wl,-L,${env.ANDROID_TOOLCHAIN_SYSROOT_LIB_1}" />
+ <!-- linkerarg value="-L${env.ANDROID_TOOLCHAIN_SYSROOT_LIB_0}" / -->
+ <linkerarg value="-L${env.ANDROID_TOOLCHAIN_SYSROOT_LIB_1}" />
+ <linkerarg value="-Wl,-rpath-link=${env.ANDROID_TOOLCHAIN_SYSROOT_LIB_1}" />
- <!-- linkerarg value="-v" / -->
+ <linkerarg value="-v" />
<linkerarg value="-fpic" />
- <!-- linkerarg value="-fPIE" / --> <!-- not for shared libs, won't produce symbols -->
- <!-- linkerarg value="-pie" / --> <!-- not for shared libs, won't produce symbols -->
- <!-- linkerarg value="-no-canonical-prefixes" / --> <!-- will disallow creating shared library -->
<!-- from sdk cmake start -->
<linkerarg value="-Wl,--build-id" />
- <linkerarg value="-Wl,--warn-shared-textrel" />
- <!-- linkerarg value="-Wl,- -fatal-warnings" / -->
+ <!-- linkerarg value="-Wl,- -no-warn-shared-textrel" / unrecognized option -->
+ <linkerarg value="-Wl,--fatal-warnings" />
+ <linkerarg value="-nostdlib" />
+ <linkerarg value="-nostdlib++" />
<!-- from sdk cmake end -->
<linkerarg value="-fno-use-linker-plugin" />
+ <linkerarg value="-target" />
+ <linkerarg value="${env.ANDROID_LLVM_TRIPLE}" /> <!-- aarch64-none-linux-android -->
<!-- linkerarg value="-mabi=lp64" />
<linkerarg value="-mlittle-endian" />
<linkerarg value="-march=armv8-a" / -->
<!-- linkerarg value="-mfloat-abi=softfp" / -->
- <linkerarg value="-nostdlib" />
<linkerarg value="-Bdynamic" />
<linkerarg value="-Wl,-dynamic-linker,/system/bin/linker" />
<linkerarg value="-Wl,-z,nocopyreloc" />
- <linkerarg value="--demangle" />
- <linkerarg value="--gc-sections" />
- <linkerarg value="--no-undefined" />
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
+ <linkerarg value="--no-undefined" />
<!-- libset libs="c,m,dl,log" / -->
<libset libs="c,m,dl" />
@@ -136,16 +128,16 @@
<property name="linker.cfg.id.base" value="linker.cfg.android" />
<property name="java.includes.dir.platform" value="${java.includes.dir}/x11" />
<available property="java.lib.dir.platform" value="${java.home.dir}/jre/lib/i386"
- file="${java.home.dir}/jre/lib/i386/libjava.so"/>
+ file="${java.home.dir}/jre/lib/i386/libjava.so"/>
<available property="java.lib.dir.platform" value="${java.home.dir}/lib/i386"
- file="${java.home.dir}/lib/i386/libjava.so"/>
+ file="${java.home.dir}/lib/i386/libjava.so"/>
<property name="java.lib.dir.platform" value="${java.home.dir}/lib"/> <!-- new default -->
</target>
<target name="declare.linux.android">
- <echo message="android.arm" />
- <property name="compiler.cfg.id" value="compiler.cfg.android" />
- <property name="linker.cfg.id" value="linker.cfg.android" />
+ <echo message="android.${env.ANDROID_ABI}" />
+ <property name="compiler.cfg.id" value="compiler.cfg.android" />
+ <property name="linker.cfg.id" value="linker.cfg.android" />
</target>
</project>
diff --git a/make/lib/gluegen-cpptasks-android-armv6.xml b/make/lib/gluegen-cpptasks-android-armv6.xml
index 738c70d..4e211c8 100644
--- a/make/lib/gluegen-cpptasks-android-armv6.xml
+++ b/make/lib/gluegen-cpptasks-android-armv6.xml
@@ -23,7 +23,7 @@
<property name="isAndroidARMv6" value="true" />
<property name="jvmDataModel.arg" value="-Djnlp.no.jvm.data.model.set=true" />
<property name="isCrosscompilation" value="true" />
- <property name="android.abi" value="armeabi" />
+ <property name="android.abi" value="${env.ANDROID_ABI}" /> <!-- armeabi-v7a -->
<property name="isAbiEabiGnuArmel" value="true" />
<echo message="gluegen.cpptasks.detect.os.custom: GLUEGEN_CPPTASKS_FILE 'gluegen-cpptasks-android-armv6' done"/>
</target>
@@ -32,53 +32,52 @@
<target name="gluegen.cpptasks.configure.compiler" depends="setup.java.home.dir,declare.linux.android">
<echo message="Custom forced compiler Android NDK, linker.cfg.android" />
- <compiler id="compiler.cfg.android" name="gcc">
- <compilerarg value="--sysroot=${TARGET_PLATFORM_SYSROOT}" />
- <!-- The default search dirs for 'gcc from $NDK_TOOLCHAIN_ROOT/$TARGET_TRIPLE/bin will not find
- subprograms properly (see gcc -print-search-dirs). Not sure if this is a bug in the NDK
- or not. Need to explicitly indicate where subprograms are with -B.
- NOTE: This is not necessary if using '$TARGET_TRIPLE-gcc' from $NDK_TOOLCHAIN_ROOT/bin. -->
- <compilerarg value="-B${env.NDK_TOOLCHAIN_ROOT}/libexec/gcc/${env.TARGET_TRIPLE}/${env.GCC_VERSION}" />
+ <compiler id="compiler.cfg.android" name="clang">
+ <compilerarg value="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT}" />
+
+ <compilerarg value="-v" />
<compilerarg value="-fpic" />
+
+ <!-- from sdk cmake start -->
+ <compilerarg value="-fdata-sections" />
<compilerarg value="-ffunction-sections" />
<compilerarg value="-funwind-tables" />
- <compilerarg value="-fstack-protector" />
- <!-- compilerarg value="-no-canonical-prefixes" / --> <!-- will disallow creating shared library -->
+ <compilerarg value="-fstack-protector-strong" />
+ <compilerarg value="-no-canonical-prefixes" />
+ <compilerarg value="-nostdinc++" />
+ <!-- from sdk cmake end -->
+
<compilerarg value="-Wa,--noexecstack" />
- <compilerarg value="-march=armv6" />
+ <compilerarg value="-target" />
+ <compilerarg value="${env.ANDROID_LLVM_TRIPLE}" /> <!-- armv7-none-linux-androideabi -->
+ <compilerarg value="-mfpu=neon" /> <!-- with NEON by default since NDK r21 -->
+ <!-- compilerarg value="-march=armv6" />
<compilerarg value="-mfloat-abi=softfp" />
- <compilerarg value="-marm" />
+ <compilerarg value="-marm" / -->
<!-- Generic ARM Flags -->
+ <compilerarg value="-fno-strict-aliasing"/> <!-- be safe -->
+
<compilerarg value="-O2" unless="c.compiler.use-debug" />
<!-- compilerarg value="-g" unless="c.compiler.use-debug" /-->
<compilerarg value="-fomit-frame-pointer" unless="c.compiler.use-debug"/>
- <compilerarg value="-fstrict-aliasing" unless="c.compiler.use-debug"/>
- <compilerarg value="-funswitch-loops" unless="c.compiler.use-debug"/>
- <compilerarg value="-finline-limit=300" unless="c.compiler.use-debug"/>
-
- <!-- THUMB Flags ..
- <compilerarg value="-Os" unless="c.compiler.use-debug" />
- <compilerarg value="-g" unless="c.compiler.use-debug" />
- <compilerarg value="-fomit-frame-pointer" unless="c.compiler.use-debug"/>
- <compilerarg value="-fno-strict-aliasing" unless="c.compiler.use-debug" />
- <compilerarg value="-finline-limit=64" unless="c.compiler.use-debug"/>
- -->
+ <!-- compilerarg value="-funswitch-loops" unless="c.compiler.use-debug"/ not supported -->
+ <!-- compilerarg value="-finline-limit=300" unless="c.compiler.use-debug"/ not supported -->
<compilerarg value="-O0" if="c.compiler.use-debug" />
<compilerarg value="-g" if="c.compiler.use-debug" />
<compilerarg value="-fno-omit-frame-pointer" if="c.compiler.use-debug" />
- <compilerarg value="-fno-strict-aliasing" if="c.compiler.use-debug" />
- <includepath path="${env.NDK_TOOLCHAIN_ROOT}/lib/gcc/${env.TARGET_TRIPLE}/${env.GCC_VERSION}/include" /> <!-- for stdarg.h -->
+ <!-- includepath path="${env.ANDROID_TOOLCHAIN_SYSROOT_INC}" / -->
<defineset>
<define name="__unix__" />
<define name="__ARM_ARCH_5__" />
<define name="__ARM_ARCH_5T__" />
<define name="__ARM_ARCH_5E__" />
<define name="__ARM_ARCH_5TE__" />
+ <define name="HAVE_NEON" />
<define name="ANDROID" />
<define name="_DEBUG" if="c.compiler.use-debug"/>
<define name="DEBUG" if="c.compiler.use-debug"/>
@@ -86,40 +85,42 @@
</defineset>
</compiler>
- <linker id="linker.cfg.android" name="gcc">
- <linkerarg value="--sysroot=${TARGET_PLATFORM_SYSROOT}" />
-
- <linkerarg value="-fpic" />
- <linkerarg value="-ffunction-sections" />
- <linkerarg value="-funwind-tables" />
- <linkerarg value="-fstack-protector" />
- <!-- linkerarg value="-no-canonical-prefixes" / --> <!-- will disallow creating shared library -->
- <linkerarg value="-Wa,--noexecstack" />
-
- <linkerarg value="-fno-use-linker-plugin" />
-
- <linkerarg value="-march=armv6" />
- <linkerarg value="-mfloat-abi=softfp" />
- <linkerarg value="-marm" />
-
- <linkerarg value="-nostdlib" />
- <linkerarg value="-Bdynamic" />
- <linkerarg value="-Wl,-dynamic-linker,/system/bin/linker" />
- <linkerarg value="-Wl,-z,nocopyreloc" />
-
- <linkerarg value="--demangle" />
- <linkerarg value="--gc-sections" />
- <linkerarg value="--no-undefined" />
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
- <!-- The gcc from $NDK_TOOLCHAIN_ROOT/$TARGET_TRIPLE/bin needs to be told
- where to find libgcc as the default location (gcc -print-search-dirs)
- is not correct. Not sure if this is a bug in the NDK or not. We also
- enforce that libgcc is linked after source files but before other shared
- libraries. -->
- <libset dir="${env.NDK_TOOLCHAIN_ROOT}/lib/gcc/${env.TARGET_TRIPLE}/${env.GCC_VERSION}" libs="gcc" />
- <!-- libset libs="c,m,dl,log" / -->
- <libset libs="c,m,dl" />
+ <linker id="linker.cfg.android" name="clang">
+ <linkerarg value="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT}" />
+ <!-- linkerarg value="-L${env.ANDROID_TOOLCHAIN_SYSROOT_LIB_0}" / -->
+ <linkerarg value="-L${env.ANDROID_TOOLCHAIN_SYSROOT_LIB_1}" />
+ <linkerarg value="-Wl,-rpath-link=${env.ANDROID_TOOLCHAIN_SYSROOT_LIB_1}" />
+
+ <linkerarg value="-v" />
+
+ <linkerarg value="-fpic" />
+
+ <!-- from sdk cmake start -->
+ <linkerarg value="-Wl,--build-id" />
+ <linkerarg value="-Wl,--no-warn-shared-textrel" />
+ <linkerarg value="-Wl,--fatal-warnings" />
+ <linkerarg value="-nostdlib" />
+ <linkerarg value="-nostdlib++" />
+ <!-- from sdk cmake end -->
+
+ <linkerarg value="-fno-use-linker-plugin" />
+
+ <linkerarg value="-target" />
+ <linkerarg value="${env.ANDROID_LLVM_TRIPLE}" /> <!-- armv7-none-linux-androideabi -->
+ <linkerarg value="-mfpu=neon" /> <!-- with NEON by default since NDK r21 -->
+ <!--
+ <linkerarg value="-march=armv6" />
+ <linkerarg value="-mfloat-abi=softfp" />
+ <linkerarg value="-marm" /> -->
+
+ <linkerarg value="-Bdynamic" />
+ <linkerarg value="-Wl,-dynamic-linker,/system/bin/linker" />
+ <linkerarg value="-Wl,-z,nocopyreloc" />
+
+ <!-- linkerarg value="- -no-undefined" / -->
+
+ <!-- libset libs="c,m,dl,log" / -->
+ <libset libs="c,m,dl" />
</linker>
</target>
@@ -130,16 +131,16 @@
<property name="linker.cfg.id.base" value="linker.cfg.android" />
<property name="java.includes.dir.platform" value="${java.includes.dir}/x11" />
<available property="java.lib.dir.platform" value="${java.home.dir}/jre/lib/i386"
- file="${java.home.dir}/jre/lib/i386/libjava.so"/>
+ file="${java.home.dir}/jre/lib/i386/libjava.so"/>
<available property="java.lib.dir.platform" value="${java.home.dir}/lib/i386"
- file="${java.home.dir}/lib/i386/libjava.so"/>
+ file="${java.home.dir}/lib/i386/libjava.so"/>
<property name="java.lib.dir.platform" value="${java.home.dir}/lib"/> <!-- new default -->
</target>
<target name="declare.linux.android">
- <echo message="android.arm" />
- <property name="compiler.cfg.id" value="compiler.cfg.android" />
- <property name="linker.cfg.id" value="linker.cfg.android" />
+ <echo message="android.${env.ANDROID_ABI}" />
+ <property name="compiler.cfg.id" value="compiler.cfg.android" />
+ <property name="linker.cfg.id" value="linker.cfg.android" />
</target>
</project>
diff --git a/make/lib/gluegen-cpptasks-android-x86.xml b/make/lib/gluegen-cpptasks-android-x86.xml
index 7fbd44e..bcdc76c 100644
--- a/make/lib/gluegen-cpptasks-android-x86.xml
+++ b/make/lib/gluegen-cpptasks-android-x86.xml
@@ -23,7 +23,7 @@
<property name="isAndroidX86" value="true" />
<property name="jvmDataModel.arg" value="-Djnlp.no.jvm.data.model.set=true" />
<property name="isCrosscompilation" value="true" />
- <property name="android.abi" value="x86" />
+ <property name="android.abi" value="${env.ANDROID_ABI}" /> <!-- x86 -->
<echo message="gluegen.cpptasks.detect.os.custom: GLUEGEN_CPPTASKS_FILE 'gluegen-cpptasks-android-x86' done"/>
</target>
@@ -31,42 +31,45 @@
<target name="gluegen.cpptasks.configure.compiler" depends="setup.java.home.dir,declare.linux.android">
<echo message="Custom forced compiler Android NDK, linker.cfg.android" />
- <compiler id="compiler.cfg.android" name="gcc">
- <compilerarg value="--sysroot=${TARGET_PLATFORM_SYSROOT}" />
- <!-- The default search dirs for 'gcc from $NDK_TOOLCHAIN_ROOT/$TARGET_TRIPLE/bin will not find
- subprograms properly (see gcc -print-search-dirs). Not sure if this is a bug in the NDK
- or not. Need to explicitly indicate where subprograms are with -B.
- NOTE: This is not necessary if using '$TARGET_TRIPLE-gcc' from $NDK_TOOLCHAIN_ROOT/bin. -->
- <compilerarg value="-B${env.NDK_TOOLCHAIN_ROOT}/libexec/gcc/${env.TARGET_TRIPLE}/${env.GCC_VERSION}" />
+ <compiler id="compiler.cfg.android" name="clang">
+ <compilerarg value="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT}" />
+
+ <compilerarg value="-v" />
<compilerarg value="-fpic" />
- <!-- compilerarg value="-fPIE" / --> <!-- not for shared libs, won't produce symbols -->
- <!-- compilerarg value="-pie" / --> <!-- not for shared libs, won't produce symbols -->
+
+ <!-- from sdk cmake start -->
+ <compilerarg value="-fdata-sections" />
<compilerarg value="-ffunction-sections" />
<compilerarg value="-funwind-tables" />
- <compilerarg value="-fno-stack-protector" />
- <!-- compilerarg value="-no-canonical-prefixes" / --> <!-- will disallow creating shared library -->
+ <compilerarg value="-fstack-protector-strong" />
+ <compilerarg value="-no-canonical-prefixes" />
+ <compilerarg value="-nostdinc++" />
+ <!-- from sdk cmake end -->
+
<compilerarg value="-Wa,--noexecstack" />
- <compilerarg value="-mtune=atom" />
+ <compilerarg value="-target" />
+ <compilerarg value="${env.ANDROID_LLVM_TRIPLE}" /> <!-- i686-none-linux-android -->
+ <!-- compilerarg value="-mtune=atom" />
<compilerarg value="-mssse3" />
<compilerarg value="-mfpmath=sse" />
- <compilerarg value="-mlong-double-80" />
+ <compilerarg value="-mlong-double-80" / -->
<!-- Generic Flags -->
+ <compilerarg value="-fno-strict-aliasing"/> <!-- be safe -->
+
<compilerarg value="-O2" unless="c.compiler.use-debug" />
<!-- compilerarg value="-g" unless="c.compiler.use-debug" / -->
<compilerarg value="-fomit-frame-pointer" unless="c.compiler.use-debug"/>
- <compilerarg value="-fno-strict-aliasing" unless="c.compiler.use-debug"/>
- <compilerarg value="-funswitch-loops" unless="c.compiler.use-debug"/>
- <compilerarg value="-finline-limit=300" unless="c.compiler.use-debug"/>
+ <!-- compilerarg value="-funswitch-loops" unless="c.compiler.use-debug"/ not supported -->
+ <!-- compilerarg value="-finline-limit=300" unless="c.compiler.use-debug"/ not supported -->
<compilerarg value="-O0" if="c.compiler.use-debug" />
<compilerarg value="-g" if="c.compiler.use-debug" />
<compilerarg value="-fno-omit-frame-pointer" if="c.compiler.use-debug" />
- <compilerarg value="-fno-strict-aliasing" if="c.compiler.use-debug" />
- <includepath path="${env.NDK_TOOLCHAIN_ROOT}/lib/gcc/${env.TARGET_TRIPLE}/${env.GCC_VERSION}/include" /> <!-- for stdarg.h -->
+ <!-- includepath path="${env.ANDROID_TOOLCHAIN_SYSROOT_INC}" / -->
<defineset>
<define name="__unix__" />
@@ -77,38 +80,41 @@
</defineset>
</compiler>
- <linker id="linker.cfg.android" name="gcc">
- <linkerarg value="--sysroot=${TARGET_PLATFORM_SYSROOT}" />
-
- <linkerarg value="-fpic" />
- <!-- linkerarg value="-fPIE" / --> <!-- not for shared libs, won't produce symbols -->
- <!-- linkerarg value="-pie" / --> <!-- not for shared libs, won't produce symbols -->
- <!-- linkerarg value="-no-canonical-prefixes" / --> <!-- will disallow creating shared library -->
-
- <linkerarg value="-fno-use-linker-plugin" />
-
- <linkerarg value="-mtune=atom" />
- <linkerarg value="-mssse3" />
- <linkerarg value="-mfpmath=sse" />
- <linkerarg value="-mlong-double-80" />
-
- <linkerarg value="-nostdlib" />
- <linkerarg value="-Bdynamic" />
- <linkerarg value="-Wl,-dynamic-linker,/system/bin/linker" />
- <linkerarg value="-Wl,-z,nocopyreloc" />
-
- <linkerarg value="--demangle" />
- <linkerarg value="--gc-sections" />
- <linkerarg value="--no-undefined" />
- <linkerarg value="-static-libgcc"/>
- <!-- The gcc from $NDK_TOOLCHAIN_ROOT/$TARGET_TRIPLE/bin needs to be told
- where to find libgcc as the default location (gcc -print-search-dirs)
- is not correct. Not sure if this is a bug in the NDK or not. We also
- enforce that libgcc is linked after source files but before other shared
- libraries. -->
- <libset dir="${env.NDK_TOOLCHAIN_ROOT}/lib/gcc/${env.TARGET_TRIPLE}/${env.GCC_VERSION}" libs="gcc" />
- <!-- libset libs="c,m,dl,log" / -->
- <libset libs="c,m,dl" />
+ <linker id="linker.cfg.android" name="clang">
+ <linkerarg value="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT}" />
+ <!-- linkerarg value="-L${env.ANDROID_TOOLCHAIN_SYSROOT_LIB_0}" / -->
+ <linkerarg value="-L${env.ANDROID_TOOLCHAIN_SYSROOT_LIB_1}" />
+ <linkerarg value="-Wl,-rpath-link=${env.ANDROID_TOOLCHAIN_SYSROOT_LIB_1}" />
+
+ <linkerarg value="-v" />
+
+ <linkerarg value="-fpic" />
+
+ <!-- from sdk cmake start -->
+ <linkerarg value="-Wl,--build-id" />
+ <linkerarg value="-Wl,--no-warn-shared-textrel" />
+ <linkerarg value="-Wl,--fatal-warnings" />
+ <linkerarg value="-nostdlib" />
+ <linkerarg value="-nostdlib++" />
+ <!-- from sdk cmake end -->
+
+ <linkerarg value="-fno-use-linker-plugin" />
+
+ <linkerarg value="-target" />
+ <linkerarg value="${env.ANDROID_LLVM_TRIPLE}" /> <!-- i686-none-linux-android -->
+ <!-- linkerarg value="-mtune=atom" />
+ <linkerarg value="-mssse3" />
+ <linkerarg value="-mfpmath=sse" />
+ <linkerarg value="-mlong-double-80" / -->
+
+ <linkerarg value="-Bdynamic" />
+ <linkerarg value="-Wl,-dynamic-linker,/system/bin/linker" />
+ <linkerarg value="-Wl,-z,nocopyreloc" />
+
+ <linkerarg value="--no-undefined" />
+
+ <!-- libset libs="c,m,dl,log" / -->
+ <libset libs="c,m,dl" />
</linker>
</target>
@@ -117,18 +123,18 @@
<echo message="Custom forced Linux.x86 cross compile android" />
<property name="compiler.cfg.id.base" value="compiler.cfg.android" />
<property name="linker.cfg.id.base" value="linker.cfg.android" />
- <property name="java.includes.dir.platform" value="${java.includes.dir}/linux" />
+ <property name="java.includes.dir.platform" value="${java.includes.dir}/x11" />
<available property="java.lib.dir.platform" value="${java.home.dir}/jre/lib/i386"
- file="${java.home.dir}/jre/lib/i386/libjava.so"/>
+ file="${java.home.dir}/jre/lib/i386/libjava.so"/>
<available property="java.lib.dir.platform" value="${java.home.dir}/lib/i386"
- file="${java.home.dir}/lib/i386/libjava.so"/>
+ file="${java.home.dir}/lib/i386/libjava.so"/>
<property name="java.lib.dir.platform" value="${java.home.dir}/lib"/> <!-- new default -->
</target>
<target name="declare.linux.android">
- <echo message="android.x86" />
- <property name="compiler.cfg.id" value="compiler.cfg.android" />
- <property name="linker.cfg.id" value="linker.cfg.android" />
+ <echo message="android.${env.ANDROID_ABI}" />
+ <property name="compiler.cfg.id" value="compiler.cfg.android" />
+ <property name="linker.cfg.id" value="linker.cfg.android" />
</target>
</project>
diff --git a/make/scripts/make.gluegen.all.android-armv6-cross.sh b/make/scripts/make.gluegen.all.android-armv6-cross.sh
index 89161c6..ebbd84c 100755
--- a/make/scripts/make.gluegen.all.android-armv6-cross.sh
+++ b/make/scripts/make.gluegen.all.android-armv6-cross.sh
@@ -2,14 +2,30 @@
SDIR=`dirname $0`
-if [ -e $SDIR/setenv-build-jogamp-x86_64.sh ] ; then
- . $SDIR/setenv-build-jogamp-x86_64.sh
+if [ -e ${SDIR}/setenv-build-jogamp-x86_64.sh ] ; then
+ . ${SDIR}/setenv-build-jogamp-x86_64.sh
fi
-if [ -e $SDIR/setenv-android-tools.sh ] ; then
- . $SDIR/setenv-android-tools.sh
+LOGF=make.gluegen.all.android-armv6-cross.log
+rm -f ${LOGF}
+
+export ANDROID_HOME=/opt-linux-x86_64/android-sdk-linux_x86_64
+export ANDROID_API_LEVEL=24
+export ANDROID_HOST_TAG=linux-x86_64
+export ANDROID_ABI=armeabi-v7a
+
+if [ -e ${SDIR}/setenv-android-tools.sh ] ; then
+ . ${SDIR}/setenv-android-tools.sh >> $LOGF 2>&1
+else
+ echo "${SDIR}/setenv-android-tools.sh doesn't exist!" 2>&1 | tee -a ${LOGF}
+ exit 1
fi
+export GLUEGEN_CPPTASKS_FILE="lib/gluegen-cpptasks-android-armv6.xml"
+export PATH=${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_NAME}/bin:${ANDROID_TOOLCHAIN_ROOT}/bin:${ANDROID_HOME}/platform-tools:${ANDROID_BUILDTOOLS_ROOT}:${PATH}
+echo PATH ${PATH} 2>&1 | tee -a ${LOGF}
+echo clang `which clang` 2>&1 | tee -a ${LOGF}
+
export NODE_LABEL=.
export HOST_UID=jogamp
@@ -26,32 +42,19 @@ export TARGET_ADB_PORT=5555
export TARGET_ROOT=/data/projects
export TARGET_ANT_HOME=/usr/share/ant
-export ANDROID_VERSION=24
export SOURCE_LEVEL=1.8
export TARGET_LEVEL=1.8
export TARGET_RT_JAR=/opt-share/jre1.8.0_212/lib/rt.jar
-export GCC_VERSION=4.9
-HOST_ARCH=linux-x86_64
-export TARGET_TRIPLE=arm-linux-androideabi
-
-export NDK_TOOLCHAIN_ROOT=$NDK_ROOT/toolchains/${TARGET_TRIPLE}-${GCC_VERSION}/prebuilt/${HOST_ARCH}
-export TARGET_PLATFORM_SYSROOT=${NDK_ROOT}/platforms/android-${ANDROID_VERSION}/arch-arm
-
-# Need to add toolchain bins to the PATH.
-export PATH="$NDK_TOOLCHAIN_ROOT/$TARGET_TRIPLE/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH"
-
-export GLUEGEN_CPPTASKS_FILE="lib/gluegen-cpptasks-android-armv6.xml"
-
#export JUNIT_DISABLED="true"
#export JUNIT_RUN_ARG0="-Dnewt.test.Screen.disableScreenMode"
-which gcc 2>&1 | tee make.gluegen.all.android-armv6-cross.log
-
#export JOGAMP_JAR_CODEBASE="Codebase: *.jogamp.org"
export JOGAMP_JAR_CODEBASE="Codebase: *.goethel.localnet"
#BUILD_ARCHIVE=true \
ant \
-Drootrel.build=build-android-armv6 \
- $* 2>&1 | tee -a make.gluegen.all.android-armv6-cross.log
+ -Dgcc.compat.compiler=clang \
+ $* 2>&1 | tee -a ${LOGF}
+
diff --git a/make/scripts/make.gluegen.all.android-x86-cross.sh b/make/scripts/make.gluegen.all.android-x86-cross.sh
index d90bc2c..eb0e15b 100755
--- a/make/scripts/make.gluegen.all.android-x86-cross.sh
+++ b/make/scripts/make.gluegen.all.android-x86-cross.sh
@@ -2,14 +2,30 @@
SDIR=`dirname $0`
-if [ -e $SDIR/setenv-build-jogamp-x86_64.sh ] ; then
- . $SDIR/setenv-build-jogamp-x86_64.sh
+if [ -e ${SDIR}/setenv-build-jogamp-x86_64.sh ] ; then
+ . ${SDIR}/setenv-build-jogamp-x86_64.sh
fi
-if [ -e $SDIR/setenv-android-tools.sh ] ; then
- . $SDIR/setenv-android-tools.sh
+LOGF=make.gluegen.all.android-x86-cross.log
+rm -f ${LOGF}
+
+export ANDROID_HOME=/opt-linux-x86_64/android-sdk-linux_x86_64
+export ANDROID_API_LEVEL=24
+export ANDROID_HOST_TAG=linux-x86_64
+export ANDROID_ABI=x86
+
+if [ -e ${SDIR}/setenv-android-tools.sh ] ; then
+ . ${SDIR}/setenv-android-tools.sh >> $LOGF 2>&1
+else
+ echo "${SDIR}/setenv-android-tools.sh doesn't exist!" 2>&1 | tee -a ${LOGF}
+ exit 1
fi
+export GLUEGEN_CPPTASKS_FILE="lib/gluegen-cpptasks-android-x86.xml"
+export PATH=${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_NAME}/bin:${ANDROID_TOOLCHAIN_ROOT}/bin:${ANDROID_HOME}/platform-tools:${ANDROID_BUILDTOOLS_ROOT}:${PATH}
+echo PATH ${PATH} 2>&1 | tee -a ${LOGF}
+echo clang `which clang` 2>&1 | tee -a ${LOGF}
+
export NODE_LABEL=.
export HOST_UID=jogamp
@@ -26,37 +42,19 @@ export TARGET_ADB_PORT=5555
export TARGET_ROOT=/data/projects
export TARGET_ANT_HOME=/usr/share/ant
-export ANDROID_VERSION=24
export SOURCE_LEVEL=1.8
export TARGET_LEVEL=1.8
export TARGET_RT_JAR=/opt-share/jre1.8.0_212/lib/rt.jar
-export GCC_VERSION=4.9
-HOST_ARCH=linux-x86_64
-export TARGET_TRIPLE=i686-linux-android
-export TOOLCHAIN_NAME=x86
-
-export NDK_TOOLCHAIN_ROOT=$NDK_ROOT/toolchains/${TOOLCHAIN_NAME}-${GCC_VERSION}/prebuilt/${HOST_ARCH}
-export TARGET_PLATFORM_SYSROOT=${NDK_ROOT}/platforms/android-${ANDROID_VERSION}/arch-x86
-
-# Need to add toolchain bins to the PATH.
-# May need to create symbolic links within $NDK_TOOLCHAIN_ROOT/$TARGET_TRIPLE/bin
-# cd $NDK_TOOLCHAIN_ROOT/$TARGET_TRIPLE/bin
-# ln -s ../../bin/i686-linux-android-gcc gcc
-export PATH="$NDK_TOOLCHAIN_ROOT/$TARGET_TRIPLE/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH"
-
-export GLUEGEN_CPPTASKS_FILE="lib/gluegen-cpptasks-android-x86.xml"
-
#export JUNIT_DISABLED="true"
#export JUNIT_RUN_ARG0="-Dnewt.test.Screen.disableScreenMode"
-echo PATH $PATH 2>&1 | tee make.gluegen.all.android-x86-cross.log
-echo gcc `which gcc` 2>&1 | tee -a make.gluegen.all.android-x86-cross.log
-
#export JOGAMP_JAR_CODEBASE="Codebase: *.jogamp.org"
export JOGAMP_JAR_CODEBASE="Codebase: *.goethel.localnet"
#BUILD_ARCHIVE=true \
ant \
-Drootrel.build=build-android-x86 \
- $* 2>&1 | tee -a make.gluegen.all.android-x86-cross.log
+ -Dgcc.compat.compiler=clang \
+ $* 2>&1 | tee -a ${LOGF}
+
diff --git a/make/scripts/setenv-android-tools.sh b/make/scripts/setenv-android-tools.sh
index b0e6144..7f7dd56 100644
--- a/make/scripts/setenv-android-tools.sh
+++ b/make/scripts/setenv-android-tools.sh
@@ -25,7 +25,7 @@
# - ANDROID_HOST_TAG - defaults to linux-x86_64
#
# - ANDROID_ABI - defaults to x86_64, one of
-# armeabi-v7a
+# armeabi-v7a (with NEON by default since NDK r21)
# arm64-v8a
# x86_64
# x86
@@ -97,6 +97,7 @@ if [ -z "${ANDROID_ABI}" ] ; then
echo "Setting undefined ANDROID_ABI to ${ANDROID_ABI} default!"
fi
if [ "${ANDROID_ABI}" = "armeabi-v7a" ] ; then
+ # with NEON by default since NDK r21
ANDROID_SYSROOT_ABI=arm
#CMAKE_SYSTEM_PROCESSOR=armv7-a
ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi