From 977302da7e0e74c44d24e7d0d216a25bd2c06716 Mon Sep 17 00:00:00 2001 From: Rechi Date: Mon, 24 Sep 2018 11:00:00 +0200 Subject: [android] defining _GLIBCXX_USE_C99_MATH_TR1 isn't required since d32bd6656f --- tools/depends/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac index ca6a96c4c1..efd3a3b754 100644 --- a/tools/depends/configure.ac +++ b/tools/depends/configure.ac @@ -196,7 +196,7 @@ case $host in platform_cc=clang platform_cxx=clang++ deps_dir="$use_host-$use_ndk_api-$build_type" - platform_cflags="-DANDROID -D__ANDROID_API__=$use_ndk_api -fexceptions -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fPIC -DPIC -D_GLIBCXX_USE_C99_MATH_TR1" + platform_cflags="-DANDROID -D__ANDROID_API__=$use_ndk_api -fexceptions -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fPIC -DPIC" optimize_flags="-Os" platform_ldflags="-Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -L$prefix/$deps_dir/lib/android-$use_ndk_api" -- cgit v1.2.3 From 50f6be20c9407d233295fb46d3be07900eb2773f Mon Sep 17 00:00:00 2001 From: Rechi Date: Mon, 24 Sep 2018 11:00:00 +0200 Subject: [docs] correct android after 939755a81b & dc8e0a02fe --- docs/README.Android.md | 16 ++++++++-------- tools/depends/README.md | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/README.Android.md b/docs/README.Android.md index 013e0c7b72..b754bf81a6 100644 --- a/docs/README.Android.md +++ b/docs/README.Android.md @@ -85,7 +85,7 @@ unzip $HOME/Downloads/sdk-tools-linux-4333796.zip -d $HOME/android-tools/android Extract Android NDK: ``` -unzip $HOME/Downloads/android-ndk-r16b-linux-x86_64.zip -d $HOME/android-tools +unzip $HOME/Downloads/android-ndk-r16-linux-x86_64.zip -d $HOME/android-tools ``` ### 3.2. Configure Android SDK @@ -103,12 +103,12 @@ To be able to build Kodi and the libraries it depends on for the Android platfor Change to Android NDK tools directory: ``` -cd $HOME/android-tools/android-ndk-r16b/build/tools +cd $HOME/android-tools/android-ndk-r16/build/tools ``` Set up the aarch64 toolchain: ``` -./make-standalone-toolchain.sh --install-dir=$HOME/android-tools/aarch64-linux-androideabi-4.9-vanilla/android-21 --platform=android-21 --toolchain=arm-linux-androideabi-4.9 --stl=libc++ +./make-standalone-toolchain.sh --install-dir=$HOME/android-tools/aarch64-linux-android-4.9-vanilla/android-21 --platform=android-21 --toolchain=aarch64-linux-android-4.9 --stl=libc++ ``` Set up the arm toolchain: @@ -118,7 +118,7 @@ Set up the arm toolchain: Set up the x86 toolchain: ``` -./make-standalone-toolchain.sh --install-dir=$HOME/android-tools/x86-linux-androideabi-4.9-vanilla/android-21 --platform=android-21 --toolchain=arm-linux-androideabi-4.9 --stl=libc++ +./make-standalone-toolchain.sh --install-dir=$HOME/android-tools/x86-linux-android-4.9-vanilla/android-21 --platform=android-21 --toolchain=x86-linux-android-4.9 --stl=libc++ ``` **NOTE:** You only need the toolchain for your target architecture but toolchains are installed in different directories and will not interfere with each other. @@ -137,7 +137,7 @@ keytool -genkey -keystore ~/.android/debug.keystore -v -alias androiddebugkey -d * Whenever you want to compile/develop you need to mount the image * `open ~/android-dev.dmg` * Once you have your hdd image with case sensitive hfs+ file system execute all the steps inside of this filesystem. You need to adapt all paths in this guide so that they match your local environment. As an example here is a configure line that demonstrates possible paths: - * `./configure --with-tarballs=/Users/Shared/xbmc-depends/tarballs --host=arm-linux-androideabi --with-sdk-path=/Volumes/android-dev/android/android-sdk-macosx --with-ndk-path=/Volumes/android-dev/android/android-ndk-r16b --with-toolchain=/Volumes/android-dev/android/android-toolchain-arm/android-21 --prefix=/Volumes/android-dev/android/xbmc-depends` + * `./configure --with-tarballs=/Users/Shared/xbmc-depends/tarballs --host=arm-linux-androideabi --with-sdk-path=/Volumes/android-dev/android/android-sdk-macosx --with-ndk-path=/Volumes/android-dev/android/android-ndk-r16 --with-toolchain=/Volumes/android-dev/android/android-toolchain-arm/android-21 --prefix=/Volumes/android-dev/android/xbmc-depends` **[back to top](#table-of-contents)** | **[back to section top](#3-prerequisites)** @@ -163,17 +163,17 @@ cd $HOME/kodi/tools/depends Configure build for aarch64: ``` -./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=aarch64-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16b --with-toolchain=$HOME/android-tools/aarch64-linux-androideabi-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends +./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=aarch64-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16 --with-toolchain=$HOME/android-tools/aarch64-linux-android-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends ``` Or configure build for arm: ``` -./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=arm-linux-androideabi --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16b --with-toolchain=$HOME/android-tools/arm-linux-androideabi-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends +./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=arm-linux-androideabi --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16 --with-toolchain=$HOME/android-tools/arm-linux-androideabi-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends ``` Or configure build for x86: ``` -./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=i686-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16b --with-toolchain=$HOME/android-tools/x86-linux-androideabi-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends +./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=i686-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16 --with-toolchain=$HOME/android-tools/x86-linux-android-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends ``` Build tools and dependencies: diff --git a/tools/depends/README.md b/tools/depends/README.md index 71f1248480..7f75d71461 100644 --- a/tools/depends/README.md +++ b/tools/depends/README.md @@ -39,13 +39,13 @@ Paths below are examples. If you want to build Kodi, follow our **[build guides] ### Android **arm** -`./configure --with-tarballs=/opt/xbmc-tarballs --host=arm-linux-androideabi --with-sdk-path=/opt/android-sdk-linux --with-ndk-path=/opt/android-ndk-r16b --with-toolchain=/opt/arm-linux-androideabi-4.9-vanilla/android-21 --prefix=/opt/xbmc-depends` +`./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=arm-linux-androideabi --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16 --with-toolchain=$HOME/android-tools/arm-linux-androideabi-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends` **aarch64** -`./configure --with-tarballs=/opt/xbmc-tarballs --host=aarch64-linux-android-4.9 --with-sdk-path=/opt/android-sdk-linux --with-ndk-path=/opt/android-ndk-r16b --with-toolchain=/opt/aarch64-linux-android-4.9-vanilla/android-21 --prefix=/opt/xbmc-depends` +`./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=aarch64-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16 --with-toolchain=$HOME/android-tools/aarch64-linux-android-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends` **x86** -`./configure --with-tarballs=/opt/xbmc-tarballs --host=i686-linux-android --with-sdk-path=/opt/android-sdk-linux --with-ndk-path=/opt/android-ndk-r16b --with-toolchain=/opt/x86-linux-4.9-vanilla/android-21 --prefix=/opt/xbmc-depends` +`./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=i686-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16 --with-toolchain=$HOME/android-tools/x86-linux-android-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends` ### Linux **ARM (codesourcery/lenaro/etc)** -- cgit v1.2.3 From 27a57a614f44e201b7a81b5b0d8823fea35b16d0 Mon Sep 17 00:00:00 2001 From: Rechi Date: Mon, 24 Sep 2018 11:00:00 +0200 Subject: [depends] libffi: fix arm assembler syntax --- tools/depends/target/libffi/armAssembler.patch | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tools/depends/target/libffi/armAssembler.patch b/tools/depends/target/libffi/armAssembler.patch index 3fff6ed693..1165adac18 100644 --- a/tools/depends/target/libffi/armAssembler.patch +++ b/tools/depends/target/libffi/armAssembler.patch @@ -1,5 +1,14 @@ --- a/src/arm/sysv.S +++ b/src/arm/sysv.S +@@ -360,7 +360,7 @@ + cmp r0, #3 + sub ip, fp, #64 + flddle d0, [ip] +- fldmiadgt ip, {d0-d7} ++ vldmiagt ip, {d0-d7} + + LSYM(Lbase_args): + @ move first 4 parameters in registers @@ -396,7 +396,7 @@ beq LSYM(Lepilogue_vfp) @@ -9,3 +18,34 @@ beq LSYM(Lepilogue_vfp) cmp r3, #FFI_TYPE_FLOAT +@@ -409,7 +409,7 @@ + + cmp r3, #FFI_TYPE_STRUCT_VFP_FLOAT + cmpne r3, #FFI_TYPE_STRUCT_VFP_DOUBLE +- fstmiadeq r2, {d0-d3} ++ vstmiaeq r2, {d0-d3} + + LSYM(Lepilogue_vfp): + RETLDM "r0-r3,fp" +@@ -420,7 +420,7 @@ + + + ARM_FUNC_START(ffi_closure_VFP) +- fstmfdd sp!, {d0-d7} ++ vstmdb sp!, {d0-d7} + @ r0-r3, then d0-d7 + UNWIND .pad #80 + add ip, sp, #80 +@@ -470,10 +470,10 @@ + ldmia sp, {r0, r1} + b .Lclosure_epilogue_vfp + .Lretfloat_struct_vfp: +- fldmiad sp, {d0-d1} ++ vldmia sp, {d0-d1} + b .Lclosure_epilogue_vfp + .Lretdouble_struct_vfp: +- fldmiad sp, {d0-d3} ++ vldmia sp, {d0-d3} + b .Lclosure_epilogue_vfp + + .ffi_closure_VFP_end: -- cgit v1.2.3 From ce328e95df78f73303052571d46018b6e64cb153 Mon Sep 17 00:00:00 2001 From: Rechi Date: Mon, 24 Sep 2018 11:00:00 +0200 Subject: [android] use ndk 18 --- docs/README.Android.md | 20 ++++++++++---------- tools/android/packaging/Makefile.in | 4 ++++ tools/buildsteps/defaultenv | 2 +- tools/depends/README.md | 6 +++--- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/docs/README.Android.md b/docs/README.Android.md index b754bf81a6..a2d4d14ea7 100644 --- a/docs/README.Android.md +++ b/docs/README.Android.md @@ -65,7 +65,7 @@ sudo apt install autoconf build-essential curl default-jdk gawk git gperf lib32s **[back to top](#table-of-contents)** ## 3. Prerequisites -Building Kodi for Android requires Android NDK revision 16. For the SDK just use the latest available. +Building Kodi for Android requires Android NDK revision 18. For the SDK just use the latest available. * **[Android SDK](https://developer.android.com/studio/index.html)** (Look for `Get just the command line tools`) * **[Android NDK](https://developer.android.com/ndk/downloads/index.html)** @@ -85,7 +85,7 @@ unzip $HOME/Downloads/sdk-tools-linux-4333796.zip -d $HOME/android-tools/android Extract Android NDK: ``` -unzip $HOME/Downloads/android-ndk-r16-linux-x86_64.zip -d $HOME/android-tools +unzip $HOME/Downloads/android-ndk-r18-linux-x86_64.zip -d $HOME/android-tools ``` ### 3.2. Configure Android SDK @@ -103,22 +103,22 @@ To be able to build Kodi and the libraries it depends on for the Android platfor Change to Android NDK tools directory: ``` -cd $HOME/android-tools/android-ndk-r16/build/tools +cd $HOME/android-tools/android-ndk-r18/build/tools ``` Set up the aarch64 toolchain: ``` -./make-standalone-toolchain.sh --install-dir=$HOME/android-tools/aarch64-linux-android-4.9-vanilla/android-21 --platform=android-21 --toolchain=aarch64-linux-android-4.9 --stl=libc++ +./make-standalone-toolchain.sh --install-dir=$HOME/android-tools/aarch64-linux-android-vanilla/android-21 --platform=android-21 --toolchain=aarch64-linux-android ``` Set up the arm toolchain: ``` -./make-standalone-toolchain.sh --install-dir=$HOME/android-tools/arm-linux-androideabi-4.9-vanilla/android-21 --platform=android-21 --toolchain=arm-linux-androideabi-4.9 --stl=libc++ +./make-standalone-toolchain.sh --install-dir=$HOME/android-tools/arm-linux-androideabi-vanilla/android-21 --platform=android-21 --toolchain=arm-linux-androideabi ``` Set up the x86 toolchain: ``` -./make-standalone-toolchain.sh --install-dir=$HOME/android-tools/x86-linux-android-4.9-vanilla/android-21 --platform=android-21 --toolchain=x86-linux-android-4.9 --stl=libc++ +./make-standalone-toolchain.sh --install-dir=$HOME/android-tools/x86-linux-android-vanilla/android-21 --platform=android-21 --toolchain=x86-linux-android ``` **NOTE:** You only need the toolchain for your target architecture but toolchains are installed in different directories and will not interfere with each other. @@ -137,7 +137,7 @@ keytool -genkey -keystore ~/.android/debug.keystore -v -alias androiddebugkey -d * Whenever you want to compile/develop you need to mount the image * `open ~/android-dev.dmg` * Once you have your hdd image with case sensitive hfs+ file system execute all the steps inside of this filesystem. You need to adapt all paths in this guide so that they match your local environment. As an example here is a configure line that demonstrates possible paths: - * `./configure --with-tarballs=/Users/Shared/xbmc-depends/tarballs --host=arm-linux-androideabi --with-sdk-path=/Volumes/android-dev/android/android-sdk-macosx --with-ndk-path=/Volumes/android-dev/android/android-ndk-r16 --with-toolchain=/Volumes/android-dev/android/android-toolchain-arm/android-21 --prefix=/Volumes/android-dev/android/xbmc-depends` + * `./configure --with-tarballs=/Users/Shared/xbmc-depends/tarballs --host=arm-linux-androideabi --with-sdk-path=/Volumes/android-dev/android/android-sdk-macosx --with-ndk-path=/Volumes/android-dev/android/android-ndk-r18 --with-toolchain=/Volumes/android-dev/android/android-toolchain-arm/android-21 --prefix=/Volumes/android-dev/android/xbmc-depends` **[back to top](#table-of-contents)** | **[back to section top](#3-prerequisites)** @@ -163,17 +163,17 @@ cd $HOME/kodi/tools/depends Configure build for aarch64: ``` -./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=aarch64-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16 --with-toolchain=$HOME/android-tools/aarch64-linux-android-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends +./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=aarch64-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r18 --with-toolchain=$HOME/android-tools/aarch64-linux-android-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends ``` Or configure build for arm: ``` -./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=arm-linux-androideabi --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16 --with-toolchain=$HOME/android-tools/arm-linux-androideabi-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends +./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=arm-linux-androideabi --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r18 --with-toolchain=$HOME/android-tools/arm-linux-androideabi-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends ``` Or configure build for x86: ``` -./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=i686-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16 --with-toolchain=$HOME/android-tools/x86-linux-android-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends +./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=i686-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r18 --with-toolchain=$HOME/android-tools/x86-linux-android-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends ``` Build tools and dependencies: diff --git a/tools/android/packaging/Makefile.in b/tools/android/packaging/Makefile.in index d3987ec237..07776ce320 100644 --- a/tools/android/packaging/Makefile.in +++ b/tools/android/packaging/Makefile.in @@ -45,6 +45,10 @@ endif # libc++ STLLIB=$(TOOLCHAIN)/$(HOST)/lib/libc++_shared.so +# https://android.googlesource.com/platform/ndk/+/fe0fe5dc32682d1811d32492c3055becb512c147/build/tools/make_standalone_toolchain.py#308 +ifeq ($(findstring armeabi-v7a,$(CPU)),armeabi-v7a) + STLLIB=$(TOOLCHAIN)/$(HOST)/lib/armv7-a/libc++_shared.so +endif #older ndk x86 GDBPATH=$(NDKROOT)/toolchains/$(ARCH)-$(GCC_VERSION)/prebuilt/gdbserver diff --git a/tools/buildsteps/defaultenv b/tools/buildsteps/defaultenv index cd11615ad0..4310a1405c 100644 --- a/tools/buildsteps/defaultenv +++ b/tools/buildsteps/defaultenv @@ -34,7 +34,7 @@ case $XBMC_PLATFORM_DIR in ;; android) - DEFAULT_NDK_VERSION="16" + DEFAULT_NDK_VERSION="18" DEFAULT_NDK_API="21" DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends DEFAULT_CONFIGURATION="Debug" diff --git a/tools/depends/README.md b/tools/depends/README.md index 7f75d71461..16398334d0 100644 --- a/tools/depends/README.md +++ b/tools/depends/README.md @@ -39,13 +39,13 @@ Paths below are examples. If you want to build Kodi, follow our **[build guides] ### Android **arm** -`./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=arm-linux-androideabi --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16 --with-toolchain=$HOME/android-tools/arm-linux-androideabi-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends` +`./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=arm-linux-androideabi --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r18 --with-toolchain=$HOME/android-tools/arm-linux-androideabi-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends` **aarch64** -`./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=aarch64-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16 --with-toolchain=$HOME/android-tools/aarch64-linux-android-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends` +`./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=aarch64-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r18 --with-toolchain=$HOME/android-tools/aarch64-linux-android-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends` **x86** -`./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=i686-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r16 --with-toolchain=$HOME/android-tools/x86-linux-android-4.9-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends` +`./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=i686-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r18 --with-toolchain=$HOME/android-tools/x86-linux-android-vanilla/android-21 --prefix=$HOME/android-tools/xbmc-depends` ### Linux **ARM (codesourcery/lenaro/etc)** -- cgit v1.2.3