summaryrefslogtreecommitdiffstats
path: root/make/lib
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-01-30 20:50:02 +0100
committerSven Gothel <[email protected]>2015-01-30 20:50:02 +0100
commit3caf446e29a3934900b9983dfd72cb8aa0d9e8d7 (patch)
tree6400dad527db09db50b6f3691f22ec3c85acd7c6 /make/lib
parent6eba192bec7cc6258fbc0c97b448fe4a4d45de9a (diff)
Bug 1122: Reflect __LP64__ and _aarch64__ in GlueGen's stdint/stddef and Android compilerflags
Diffstat (limited to 'make/lib')
-rw-r--r--make/lib/gluegen-cpptasks-android-aarch64.xml44
-rw-r--r--make/lib/gluegen-cpptasks-android-armv6.xml40
-rw-r--r--make/lib/gluegen-cpptasks-android-armv7.xml1
3 files changed, 63 insertions, 22 deletions
diff --git a/make/lib/gluegen-cpptasks-android-aarch64.xml b/make/lib/gluegen-cpptasks-android-aarch64.xml
index 7096ecc..fcf2875 100644
--- a/make/lib/gluegen-cpptasks-android-aarch64.xml
+++ b/make/lib/gluegen-cpptasks-android-aarch64.xml
@@ -41,25 +41,34 @@
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="-fpic" />
+ <!-- compilerarg value="-fPIE" / --> <!-- not for shared libs, won't produce symbols -->
+ <!-- compilerarg value="-pie" / --> <!-- not for shared libs, won't produce symbols -->
<compilerarg value="-ffunction-sections" />
<compilerarg value="-funwind-tables" />
<compilerarg value="-fstack-protector" />
- <compilerarg value="-fpic" />
+ <!-- compilerarg value="-no-canonical-prefixes" / --> <!-- will disallow creating shared library -->
+ <compilerarg value="-Wa,--noexecstack" />
- <compilerarg value="-mabi=lp64" />
+
+ <!-- compilerarg value="-mabi=lp64" />
<compilerarg value="-mlittle-endian" />
- <compilerarg value="-march=armv8-a" />
+ <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" /> -->
+ <!-- Generic ARM Flags -->
+ <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"/>
+
+ <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" />
- <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__" />
@@ -67,6 +76,9 @@
<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 -->
+
<define name="ANDROID" />
<define name="_DEBUG" if="c.compiler.use-debug"/>
<define name="DEBUG" if="c.compiler.use-debug"/>
@@ -76,12 +88,17 @@
<linker id="linker.cfg.android" name="gcc">
<linkerarg value="--sysroot=${env.TARGET_PLATFORM_ROOT}" />
+
<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="-mabi=lp64" />
+ <!-- linkerarg value="-mabi=lp64" />
<linkerarg value="-mlittle-endian" />
- <linkerarg value="-march=armv8-a" />
+ <linkerarg value="-march=armv8-a" / -->
<!-- linkerarg value="-mfloat-abi=softfp" / -->
<linkerarg value="-nostdlib" />
@@ -99,6 +116,7 @@
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>
diff --git a/make/lib/gluegen-cpptasks-android-armv6.xml b/make/lib/gluegen-cpptasks-android-armv6.xml
index 733f623..bcb3f53 100644
--- a/make/lib/gluegen-cpptasks-android-armv6.xml
+++ b/make/lib/gluegen-cpptasks-android-armv6.xml
@@ -40,24 +40,38 @@
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="-fpic" />
<compilerarg value="-ffunction-sections" />
<compilerarg value="-funwind-tables" />
<compilerarg value="-fstack-protector" />
- <compilerarg value="-fpic" />
+ <!-- compilerarg value="-no-canonical-prefixes" / --> <!-- will disallow creating shared library -->
+ <compilerarg value="-Wa,--noexecstack" />
<compilerarg value="-march=armv6" />
<compilerarg value="-mfloat-abi=softfp" />
<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="-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="-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" />
- <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__" />
@@ -74,7 +88,14 @@
<linker id="linker.cfg.android" name="gcc">
<linkerarg value="--sysroot=${env.TARGET_PLATFORM_ROOT}" />
+
<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" />
@@ -96,6 +117,7 @@
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>
diff --git a/make/lib/gluegen-cpptasks-android-armv7.xml b/make/lib/gluegen-cpptasks-android-armv7.xml
index d854d4f..d13c190 100644
--- a/make/lib/gluegen-cpptasks-android-armv7.xml
+++ b/make/lib/gluegen-cpptasks-android-armv7.xml
@@ -96,6 +96,7 @@
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}/armv7-a" libs="gcc" />
+ <!-- libset libs="c,m,dl,log" / -->
<libset libs="c,m,dl" />
</linker>