aboutsummaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-01-30 07:04:39 +0100
committerSven Gothel <[email protected]>2015-01-30 07:04:39 +0100
commit30933c60156c67a9624fefae2be6504300ce71bb (patch)
treed69de1e3568cb72655680124ac8f36ca614d05e5 /make
parentb6e3878d253abab0dc864279eb1ae01fff220acf (diff)
Bug 1122: Add AArch64 support (Android, GNU/Linux and in general)
- Add AArch64 detection via - Elf Parser - Android properties - Java properties - Android: Validate CPUType.Family _and_ ABIType - MachineDescription - Remove redundant Type ID and its field - Reuse X86_64_UNIX for AArch64 (static config) New ARCH 'aarch64' for ant: <os arch> armv8a aarch64 New CPUType.ARM64 (ARM): java: os.arch aarch64 arm64 New CPUType.ARMv8_A (ARM): java: os.arch armv8-a arm64-v8a New ABIType: EABI_AARCH64
Diffstat (limited to 'make')
-rwxr-xr-xmake/gluegen-cpptasks-base.xml69
-rw-r--r--make/lib/gluegen-cpptasks-android-aarch64.xml123
-rwxr-xr-xmake/scripts/adb-install-all-arm64-v8a.sh2
-rwxr-xr-xmake/scripts/adb-reinstall-all-arm64-v8a.sh5
-rwxr-xr-xmake/scripts/make.gluegen.all.android-aarch64-cross.sh62
5 files changed, 258 insertions, 3 deletions
diff --git a/make/gluegen-cpptasks-base.xml b/make/gluegen-cpptasks-base.xml
index 222cad7..e896fc0 100755
--- a/make/gluegen-cpptasks-base.xml
+++ b/make/gluegen-cpptasks-base.xml
@@ -21,7 +21,7 @@
- isI386
- isAMD64
- is64Bit
- - isAbiEabiGnuArmel (implicit if isAndroidARMv6 or isLinuxARMv6)
+ - isAbiEabiGnuArmel (implicit if isAndroidARMv6 or isAndroidARM64)
- isAbiEabiGnuArmhf (shall be declared explicit)
- isUnix
- isX11
@@ -32,6 +32,7 @@
- isIA64
- isAndroid
- isAndroidARMv6
+ - isAndroidARM64
- isAndroidARMv6Armel (set in gluegen.cpptasks.detected.os.2)
- isAndroidARMv6Armhf (set in gluegen.cpptasks.detected.os.2)
- isLinux
@@ -39,6 +40,7 @@
- isLinuxIA64
- isLinuxX86
- isLinuxARMv6
+ - isLinuxARM64
- isLinuxARMv6Armel (set in gluegen.cpptasks.detected.os.2)
- isLinuxARMv6Armhf (set in gluegen.cpptasks.detected.os.2)
- isLinuxAlpha
@@ -125,6 +127,7 @@
- compiler.cfg.linux.x86
- compiler.cfg.linux.amd64
- compiler.cfg.linux.armv6
+ - compiler.cfg.linux.aarch64
- compiler.cfg.linux.alpha
- compiler.cfg.linux.hppa
- compiler.cfg.linux.mips
@@ -146,6 +149,7 @@
- linker.cfg.linux.x86
- linker.cfg.linux.amd64
- linker.cfg.linux.armv6
+ - linker.cfg.linux.aarch64
- linker.cfg.linux.alpha
- linker.cfg.linux.hppa
- linker.cfg.linux.mips
@@ -255,6 +259,8 @@
<istrue value="${isAMD64}" />
<os arch="IA64" />
<os arch="sparcv9" />
+ <os arch="armv8a" />
+ <os arch="aarch64" />
</or>
</condition>
@@ -324,6 +330,15 @@
</or>
</and>
</condition>
+ <condition property="isAndroidARM64">
+ <and>
+ <istrue value="${isAndroid}" />
+ <or>
+ <os arch="armv8a" />
+ <os arch="aarch64" />
+ </or>
+ </and>
+ </condition>
<condition property="isLinuxARMv6">
<and>
<istrue value="${isLinux}" />
@@ -334,12 +349,23 @@
</or>
</and>
</condition>
+ <condition property="isLinuxARM64">
+ <and>
+ <istrue value="${isLinux}" />
+ <or>
+ <os arch="armv8a" />
+ <os arch="aarch64" />
+ </or>
+ </and>
+ </condition>
<condition property="isAbiEabiGnuArmel">
<and>
<isfalse value="${isAbiEabiGnuArmhf}" />
<or>
<istrue value="${isAndroidARMv6}" />
+ <istrue value="${isAndroidARM64}" />
<istrue value="${isLinuxARMv6}" />
+ <istrue value="${isLinuxARM64}" />
</or>
</and>
</condition>
@@ -559,6 +585,7 @@
<echo message="IA64=${isIA64}" />
<echo message="Android=${isAndroid}" />
<echo message="AndroidARMv6=${isAndroidARMv6}" />
+ <echo message="AndroidARM64=${isAndroidARM64}" />
<echo message="AndroidARMv6Armel=${isAndroidARMv6Armel}" />
<echo message="AndroidARMv6Armhf=${isAndroidARMv6Armhf}" />
<echo message="Linux=${isLinux}" />
@@ -566,6 +593,7 @@
<echo message="LinuxIA64=${isLinuxIA64}" />
<echo message="LinuxX86=${isLinuxX86}" />
<echo message="LinuxARMv6=${isLinuxARMv6}" />
+ <echo message="LinuxARM64=${isLinuxARM64}" />
<echo message="LinuxARMv6Armel=${isLinuxARMv6Armel}" />
<echo message="LinuxARMv6Armhf=${isLinuxARMv6Armhf}" />
<echo message="LinuxAlpha=${isLinuxAlpha}" />
@@ -629,6 +657,10 @@
<property name="os.and.arch" value="linux-armv6hf" />
</target>
+ <target name="gluegen.cpptasks.detect.os.linux.aarch64" unless="gluegen.cpptasks.detected.os.2" if="isLinuxARM64">
+ <property name="os.and.arch" value="linux-aarch64" />
+ </target>
+
<target name="gluegen.cpptasks.detect.os.linux.alpha" unless="gluegen.cpptasks.detected.os.2" if="isLinuxAlpha">
<property name="os.and.arch" value="linux-alpha" />
</target>
@@ -669,7 +701,11 @@
<property name="os.and.arch" value="android-armv6hf" />
</target>
- <target name="gluegen.cpptasks.detect.os.linux" depends="gluegen.cpptasks.detect.os.linux.amd64,gluegen.cpptasks.detect.os.linux.ia64,gluegen.cpptasks.detect.os.linux.x86,gluegen.cpptasks.detect.os.linux.armv6.armel,gluegen.cpptasks.detect.os.linux.armv6.armhf,gluegen.cpptasks.detect.os.android.armv6.armel,gluegen.cpptasks.detect.os.android.armv6.armhf,gluegen.cpptasks.detect.os.linux.alpha,gluegen.cpptasks.detect.os.linux.hppa,gluegen.cpptasks.detect.os.linux.mips,gluegen.cpptasks.detect.os.linux.mipsel,gluegen.cpptasks.detect.os.linux.ppc,gluegen.cpptasks.detect.os.linux.s390,gluegen.cpptasks.detect.os.linux.s390x,gluegen.cpptasks.detect.os.linux.sparc" unless="gluegen.cpptasks.detected.os.2" />
+ <target name="gluegen.cpptasks.detect.os.android.aarch64" unless="gluegen.cpptasks.detected.os.2" if="isAndroidARM64">
+ <property name="os.and.arch" value="android-aarch64" />
+ </target>
+
+ <target name="gluegen.cpptasks.detect.os.linux" depends="gluegen.cpptasks.detect.os.linux.amd64,gluegen.cpptasks.detect.os.linux.ia64,gluegen.cpptasks.detect.os.linux.x86,gluegen.cpptasks.detect.os.linux.armv6.armel,gluegen.cpptasks.detect.os.linux.armv6.armhf,gluegen.cpptasks.detect.os.android.armv6.armel,gluegen.cpptasks.detect.os.linux.aarch64,gluegen.cpptasks.detect.os.android.armv6.armhf,gluegen.cpptasks.detect.os.android.aarch64,gluegen.cpptasks.detect.os.linux.alpha,gluegen.cpptasks.detect.os.linux.hppa,gluegen.cpptasks.detect.os.linux.mips,gluegen.cpptasks.detect.os.linux.mipsel,gluegen.cpptasks.detect.os.linux.ppc,gluegen.cpptasks.detect.os.linux.s390,gluegen.cpptasks.detect.os.linux.s390x,gluegen.cpptasks.detect.os.linux.sparc" unless="gluegen.cpptasks.detected.os.2" />
<target name="gluegen.cpptasks.detect.os.osx" unless="gluegen.cpptasks.detected.os.2" if="isOSX">
<property name="native.library.suffix" value="*lib" />
@@ -977,6 +1013,19 @@
<compilerarg value="${gluegen.root.abs-path}/make/stub_includes/platform/glibc-compat-symbols.h" />
</compiler>
+ <compiler id="compiler.cfg.linux.aarch64" name="${gcc.compat.compiler}">
+ <defineset>
+ <define name="__unix__"/>
+ <define name="__X11__" if="isX11"/>
+ <define name="_DEBUG" if="c.compiler.use-debug"/>
+ <define name="DEBUG" if="c.compiler.use-debug"/>
+ <define name="NDEBUG" unless="c.compiler.use-debug"/>
+ </defineset>
+ <compilerarg value="-fpic" />
+ <compilerarg value="-include"/>
+ <compilerarg value="${gluegen.root.abs-path}/make/stub_includes/platform/glibc-compat-symbols.h" />
+ </compiler>
+
<compiler id="compiler.cfg.android" name="${gcc.compat.compiler}">
<!-- shall be defined in custom ${gluegen-cpptasks.file} ! -->
</compiler>
@@ -1188,6 +1237,13 @@
<linkerarg value="-static-libgcc" if="isGCC"/>
</linker>
+ <linker id="linker.cfg.linux.aarch64" name="${gcc.compat.compiler}">
+ <linkerarg value="-fpic" />
+ <linkerarg value="-nostdlib" />
+ <linkerarg value="-Bdynamic" />
+ <linkerarg value="-static-libgcc" if="isGCC"/>
+ </linker>
+
<linker id="linker.cfg.linux.alpha" name="${gcc.compat.compiler}">
</linker>
@@ -1390,6 +1446,13 @@
<property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/arm" />
</target>
+ <target name="gluegen.cpptasks.declare.compiler.linux.aarch64" if="isLinuxARM64">
+ <echo message="Linux.aarch64" />
+ <property name="compiler.cfg.id.base" value="compiler.cfg.linux.aarch64" />
+ <property name="linker.cfg.id.base" value="linker.cfg.linux.aarch64" />
+ <property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/arm" />
+ </target>
+
<target name="gluegen.cpptasks.declare.compiler.linux.ia64" if="isLinuxIA64">
<echo message="Linux.IA64" />
<property name="compiler.cfg.id.base" value="compiler.cfg.linux" />
@@ -1446,7 +1509,7 @@
<property name="java.lib.dir.platform" value="${java.home.dir}/jre/lib/sparc" />
</target>
- <target name="gluegen.cpptasks.declare.compiler.linux" depends="gluegen.cpptasks.declare.compiler.linux.x86,gluegen.cpptasks.declare.compiler.linux.amd64,gluegen.cpptasks.declare.compiler.linux.ia64,gluegen.cpptasks.declare.compiler.linux.armv6,gluegen.cpptasks.declare.compiler.linux.alpha,gluegen.cpptasks.declare.compiler.linux.hppa,gluegen.cpptasks.declare.compiler.linux.mips,gluegen.cpptasks.declare.compiler.linux.mipsel,gluegen.cpptasks.declare.compiler.linux.ppc,gluegen.cpptasks.declare.compiler.linux.s390,gluegen.cpptasks.declare.compiler.linux.s390x,gluegen.cpptasks.declare.compiler.linux.sparc" if="isLinux">
+ <target name="gluegen.cpptasks.declare.compiler.linux" depends="gluegen.cpptasks.declare.compiler.linux.x86,gluegen.cpptasks.declare.compiler.linux.amd64,gluegen.cpptasks.declare.compiler.linux.ia64,gluegen.cpptasks.declare.compiler.linux.armv6,gluegen.cpptasks.declare.compiler.linux.aarch64,gluegen.cpptasks.declare.compiler.linux.alpha,gluegen.cpptasks.declare.compiler.linux.hppa,gluegen.cpptasks.declare.compiler.linux.mips,gluegen.cpptasks.declare.compiler.linux.mipsel,gluegen.cpptasks.declare.compiler.linux.ppc,gluegen.cpptasks.declare.compiler.linux.s390,gluegen.cpptasks.declare.compiler.linux.s390x,gluegen.cpptasks.declare.compiler.linux.sparc" if="isLinux">
<property name="java.includes.dir.platform" value="${java.includes.dir}/linux" />
</target>
diff --git a/make/lib/gluegen-cpptasks-android-aarch64.xml b/make/lib/gluegen-cpptasks-android-aarch64.xml
new file mode 100644
index 0000000..7096ecc
--- /dev/null
+++ b/make/lib/gluegen-cpptasks-android-aarch64.xml
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ This is an example of how to add custom compiler/linker
+ arguments for a crosscompiler.
+
+ You can use such files with setting the property 'gluegen-cpptasks.file', ie:
+
+ -Dgluegen-cpptasks.file=`pwd`/lib/gluegen-cpptasks-linux-32bit.xml
+
+ In case you want to compile for 32bit on a 64bit machine,
+ you might also need to set the 'os.arch' to 'x86'.
+ Example: gluegen/make/make.gluegen.all.linux-x86.sh
+ -->
+
+<project name="GlueGen-cpptasks-android-aarch64" basedir="." >
+
+<!-- Set OS and ARCH for crosscompilation compiler configuration -->
+<target name="gluegen.cpptasks.detect.os.custom">
+ <property name="gluegen.cpptasks.detected.os" value="true" />
+ <property name="isUnix" value="true" />
+ <property name="isAndroid" value="true" />
+ <property name="isAndroidARMv6" value="false" />
+ <property name="isAndroidARM64" value="true" />
+ <property name="jvmDataModel.arg" value="-Djnlp.no.jvm.data.model.set=true" />
+ <property name="isCrosscompilation" value="true" />
+ <property name="android.abi" value="arm64-v8a" />
+ <property name="isAbiEabiGnuArmel" value="true" />
+ <echo message="gluegen.cpptasks.detect.os.custom: GLUEGEN_CPPTASKS_FILE 'gluegen-cpptasks-android-aarch64' done"/>
+</target>
+
+<import file="${gluegen.root.abs-path}/make/gluegen-cpptasks-base.xml" optional="false" />
+
+<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=${env.TARGET_PLATFORM_ROOT}" />
+ <!-- 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}" />
+
+ <compilerarg value="-ffunction-sections" />
+ <compilerarg value="-funwind-tables" />
+ <compilerarg value="-fstack-protector" />
+ <compilerarg value="-fpic" />
+
+ <compilerarg value="-mabi=lp64" />
+ <compilerarg value="-mlittle-endian" />
+ <compilerarg value="-march=armv8-a" />
+ <!-- compilerarg value="-mfloat-abi=softfp" / -->
+
+ <compilerarg value="-g" if="c.compiler.use-debug" />
+ <compilerarg value="-O0" if="c.compiler.use-debug" />
+ <compilerarg value="-Os" unless="c.compiler.use-debug" />
+ <!--<compilerarg value="-O2" /> -->
+
+ <compilerarg value="-fomit-frame-pointer" />
+ <compilerarg value="-fno-strict-aliasing" />
+ <!-- compilerarg value="-finline-limit=64" /-->
+ <compilerarg value="-Wa,--noexecstack" />
+ <includepath path="${env.NDK_TOOLCHAIN_ROOT}/lib/gcc/${env.TARGET_TRIPLE}/${env.GCC_VERSION}/include" /> <!-- for stdarg.h -->
+ <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="ANDROID" />
+ <define name="_DEBUG" if="c.compiler.use-debug"/>
+ <define name="DEBUG" if="c.compiler.use-debug"/>
+ <define name="NDEBUG" unless="c.compiler.use-debug"/>
+ </defineset>
+ </compiler>
+
+ <linker id="linker.cfg.android" name="gcc">
+ <linkerarg value="--sysroot=${env.TARGET_PLATFORM_ROOT}" />
+ <linkerarg value="-fpic" />
+ <linkerarg value="-fno-use-linker-plugin" />
+
+ <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"/>
+ <!-- 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" />
+ </linker>
+
+</target>
+
+<target name="gluegen.cpptasks.declare.compiler" depends="setup.java.home.dir">
+ <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.lib.dir.platform" value="${java.home.dir}/jre/lib/i386" />
+ <property name="java.includes.dir.platform" value="${java.includes.dir}/linux" />
+</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" />
+</target>
+
+</project>
+
+
diff --git a/make/scripts/adb-install-all-arm64-v8a.sh b/make/scripts/adb-install-all-arm64-v8a.sh
new file mode 100755
index 0000000..46bf24b
--- /dev/null
+++ b/make/scripts/adb-install-all-arm64-v8a.sh
@@ -0,0 +1,2 @@
+adb $* install ../build-android-aarch64/jogamp-android-launcher.apk
+adb $* install ../build-android-aarch64/gluegen-rt-android-arm64-v8a.apk
diff --git a/make/scripts/adb-reinstall-all-arm64-v8a.sh b/make/scripts/adb-reinstall-all-arm64-v8a.sh
new file mode 100755
index 0000000..2627cc8
--- /dev/null
+++ b/make/scripts/adb-reinstall-all-arm64-v8a.sh
@@ -0,0 +1,5 @@
+sdir=`dirname $0`
+
+$sdir/adb-uninstall-all.sh $*
+$sdir/adb-install-all-arm64-v8a.sh $*
+
diff --git a/make/scripts/make.gluegen.all.android-aarch64-cross.sh b/make/scripts/make.gluegen.all.android-aarch64-cross.sh
new file mode 100755
index 0000000..6d46779
--- /dev/null
+++ b/make/scripts/make.gluegen.all.android-aarch64-cross.sh
@@ -0,0 +1,62 @@
+#! /bin/sh
+
+SDIR=`dirname $0`
+
+if [ -e $SDIR/setenv-build-jogl-x86_64.sh ] ; then
+ . $SDIR/setenv-build-jogl-x86_64.sh
+fi
+
+if [ -e $SDIR/setenv-android-tools.sh ] ; then
+ . $SDIR/setenv-android-tools.sh
+fi
+
+export NODE_LABEL=.
+
+export HOST_UID=jogamp
+# jogamp02 - 10.1.0.122
+export HOST_IP=10.1.0.122
+export HOST_RSYNC_ROOT=PROJECTS/JOGL
+
+export TARGET_UID=jogamp
+export TARGET_IP=panda02
+#export TARGET_IP=jautab03
+#export TARGET_IP=jauphone04
+export TARGET_ADB_PORT=5555
+# needs executable bit (probably su)
+export TARGET_ROOT=/data/projects
+export TARGET_ANT_HOME=/usr/share/ant
+
+export ANDROID_VERSION=21
+export SOURCE_LEVEL=1.6
+export TARGET_LEVEL=1.6
+export TARGET_RT_JAR=/opt-share/jre1.6.0_30/lib/rt.jar
+
+#export GCC_VERSION=4.4.3
+export GCC_VERSION=4.9
+HOST_ARCH=linux-x86_64
+export TARGET_TRIPLE=aarch64-linux-android
+
+export NDK_TOOLCHAIN_ROOT=$NDK_ROOT/toolchains/${TARGET_TRIPLE}-${GCC_VERSION}/prebuilt/${HOST_ARCH}
+export TARGET_PLATFORM_ROOT=${NDK_ROOT}/platforms/android-${ANDROID_VERSION}/arch-arm64
+
+# 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/aarch64-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-aarch64.xml"
+
+#export JUNIT_DISABLED="true"
+#export JUNIT_RUN_ARG0="-Dnewt.test.Screen.disableScreenMode"
+
+echo PATH $PATH 2>&1 | tee make.gluegen.all.android-aarch64-cross.log
+echo gcc `which gcc` 2>&1 | tee -a make.gluegen.all.android-aarch64-cross.log
+
+#export JOGAMP_JAR_CODEBASE="Codebase: *.jogamp.org"
+export JOGAMP_JAR_CODEBASE="Codebase: *.goethel.localnet"
+
+#BUILD_ARCHIVE=true \
+ant \
+ -Drootrel.build=build-android-aarch64 \
+ $* 2>&1 | tee -a make.gluegen.all.android-aarch64-cross.log