diff options
Diffstat (limited to 'make/lib/gluegen-cpptasks-android-armv6.xml')
-rw-r--r-- | make/lib/gluegen-cpptasks-android-armv6.xml | 135 |
1 files changed, 84 insertions, 51 deletions
diff --git a/make/lib/gluegen-cpptasks-android-armv6.xml b/make/lib/gluegen-cpptasks-android-armv6.xml index 733f623..ca95a96 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,39 +32,57 @@ <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}" /> + <compiler id="compiler.cfg.android" name="clang"> + <!-- compilerarg value="-isystem"/> LLVM's C++ STL + <compilerarg value="${env.ANDROID_TOOLCHAIN_SYSROOT1_INC_STL}" / --> + <compilerarg value="-isystem"/> + <compilerarg value="${env.ANDROID_TOOLCHAIN_SYSROOT1_INC}" /> + <compilerarg value="-isystem"/> + <compilerarg value="${env.ANDROID_TOOLCHAIN_SYSROOT1_INC_ARCH}" /> + <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="-fpic" /> + <compilerarg value="-fstack-protector-strong" /> + <compilerarg value="-no-canonical-prefixes" /> + <compilerarg value="-nostdinc++" /> + <!-- from sdk cmake end --> - <compilerarg value="-march=armv6" /> + <compilerarg value="-Wa,--noexecstack" /> + + <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" / --> - <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" /> --> + <!-- Generic ARM Flags --> + <compilerarg value="-fno-strict-aliasing"/> <!-- be safe --> - <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 --> + <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="-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" /> + + <!-- includepath path="${env.ANDROID_TOOLCHAIN_SYSROOT1_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"/> @@ -72,31 +90,42 @@ </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="-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"/> - <!-- 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 id="linker.cfg.android" name="clang"> + <linkerarg value="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT0}" /> <!-- libs in std FS layout, but no include files --> + <linkerarg value="-L${env.ANDROID_TOOLCHAIN_SYSROOT1_LIB1}" /> + <linkerarg value="-Wl,-rpath-link=${env.ANDROID_TOOLCHAIN_SYSROOT1_LIB1}" /> + <linkerarg value="-L${env.ANDROID_TOOLCHAIN_SYSROOT1_LIB2}" /> + + <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> @@ -105,14 +134,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.lib.dir.platform" value="${java.home.dir}/jre/lib/i386" /> - <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"/> + <available property="java.lib.dir.platform" value="${java.home.dir}/lib/i386" + 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> |