summaryrefslogtreecommitdiffstats
path: root/make/lib/gluegen-cpptasks-android-x86.xml
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/lib/gluegen-cpptasks-android-x86.xml
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/lib/gluegen-cpptasks-android-x86.xml')
-rw-r--r--make/lib/gluegen-cpptasks-android-x86.xml120
1 files changed, 63 insertions, 57 deletions
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>