diff options
author | Sven Gothel <[email protected]> | 2019-12-23 23:50:54 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-12-23 23:50:54 +0100 |
commit | 26d06324312b8fe6980ff29ab9d443cc5ec2657f (patch) | |
tree | fb3a870d228964f93671c6c1217d93fbb3331fdb /make/lib | |
parent | 53ae28fd2bc501b5de54fdbdf915d88f823eb11a (diff) |
Bug 1417 - Android: Classify SYSROOTs in NDK for native libraries (link) and headers (compile)
Utilizing '-sysroot' with the linker, we require standard FS layout.
'~/Android/Sdk/ndk/20.1.5948944/platforms/android-24/arch-arm64'
contains the proper std FS layout for libraries under usr/lib,
but lacks the header files.
We call this 'ANDROID_TOOLCHAIN_SYSROOT0' and shall be used for linking.
'~/Android/Sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/linux-x86_64/sysroot'
native libraries are not under std FS layout,
but headers are under std FS layout for compilation under usr/include.
We call this 'ANDROID_TOOLCHAIN_SYSROOT1' and shall be used for compilation.
Identified while working on openal-soft Android compilation,
where we need to pass ANDROID_TOOLCHAIN_SYSROOT0
Diffstat (limited to 'make/lib')
-rw-r--r-- | make/lib/gluegen-cpptasks-android-aarch64.xml | 11 | ||||
-rw-r--r-- | make/lib/gluegen-cpptasks-android-armv6.xml | 11 | ||||
-rw-r--r-- | make/lib/gluegen-cpptasks-android-x86.xml | 11 |
3 files changed, 15 insertions, 18 deletions
diff --git a/make/lib/gluegen-cpptasks-android-aarch64.xml b/make/lib/gluegen-cpptasks-android-aarch64.xml index 2ebe9ee..ec9efd1 100644 --- a/make/lib/gluegen-cpptasks-android-aarch64.xml +++ b/make/lib/gluegen-cpptasks-android-aarch64.xml @@ -33,7 +33,7 @@ <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="clang"> - <compilerarg value="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT}" /> + <compilerarg value="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT1}" /> <!-- include files, but libs not in std FS layout --> <compilerarg value="-v" /> @@ -70,7 +70,7 @@ <compilerarg value="-g" if="c.compiler.use-debug" /> <compilerarg value="-fno-omit-frame-pointer" if="c.compiler.use-debug" /> - <!-- includepath path="${env.ANDROID_TOOLCHAIN_SYSROOT_INC}" / --> + <!-- includepath path="${env.ANDROID_TOOLCHAIN_SYSROOT1_INC}" / --> <defineset> <define name="__unix__" /> <define name="__LP64__" /> <!-- default pre-defined macro for 64bit unix --> @@ -84,10 +84,9 @@ </compiler> <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="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT0}" /> <!-- libs in std FS layout, but no include files --> + <linkerarg value="-L${env.ANDROID_TOOLCHAIN_SYSROOT0_LIB}" /> + <linkerarg value="-Wl,-rpath-link=${env.ANDROID_TOOLCHAIN_SYSROOT0_LIB}" /> <linkerarg value="-v" /> diff --git a/make/lib/gluegen-cpptasks-android-armv6.xml b/make/lib/gluegen-cpptasks-android-armv6.xml index 4e211c8..850d444 100644 --- a/make/lib/gluegen-cpptasks-android-armv6.xml +++ b/make/lib/gluegen-cpptasks-android-armv6.xml @@ -33,7 +33,7 @@ <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="clang"> - <compilerarg value="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT}" /> + <compilerarg value="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT1}" /> <!-- include files, but libs not in std FS layout --> <compilerarg value="-v" /> @@ -70,7 +70,7 @@ <compilerarg value="-g" if="c.compiler.use-debug" /> <compilerarg value="-fno-omit-frame-pointer" if="c.compiler.use-debug" /> - <!-- includepath path="${env.ANDROID_TOOLCHAIN_SYSROOT_INC}" / --> + <!-- includepath path="${env.ANDROID_TOOLCHAIN_SYSROOT1_INC}" / --> <defineset> <define name="__unix__" /> <define name="__ARM_ARCH_5__" /> @@ -86,10 +86,9 @@ </compiler> <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="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT0}" /> <!-- libs in std FS layout, but no include files --> + <linkerarg value="-L${env.ANDROID_TOOLCHAIN_SYSROOT0_LIB}" /> + <linkerarg value="-Wl,-rpath-link=${env.ANDROID_TOOLCHAIN_SYSROOT0_LIB}" /> <linkerarg value="-v" /> diff --git a/make/lib/gluegen-cpptasks-android-x86.xml b/make/lib/gluegen-cpptasks-android-x86.xml index bcdc76c..ef33daa 100644 --- a/make/lib/gluegen-cpptasks-android-x86.xml +++ b/make/lib/gluegen-cpptasks-android-x86.xml @@ -32,7 +32,7 @@ <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="clang"> - <compilerarg value="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT}" /> + <compilerarg value="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT1}" /> <!-- include files, but libs not in std FS layout --> <compilerarg value="-v" /> @@ -69,7 +69,7 @@ <compilerarg value="-g" if="c.compiler.use-debug" /> <compilerarg value="-fno-omit-frame-pointer" if="c.compiler.use-debug" /> - <!-- includepath path="${env.ANDROID_TOOLCHAIN_SYSROOT_INC}" / --> + <!-- includepath path="${env.ANDROID_TOOLCHAIN_SYSROOT1_INC}" / --> <defineset> <define name="__unix__" /> @@ -81,10 +81,9 @@ </compiler> <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="--sysroot=${env.ANDROID_TOOLCHAIN_SYSROOT0}" /> <!-- libs in std FS layout, but no include files --> + <linkerarg value="-L${env.ANDROID_TOOLCHAIN_SYSROOT0_LIB}" /> + <linkerarg value="-Wl,-rpath-link=${env.ANDROID_TOOLCHAIN_SYSROOT0_LIB}" /> <linkerarg value="-v" /> |