aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlwin Esch <alwin.esch@web.de>2020-02-17 23:05:31 +0100
committerAlwin Esch <alwin.esch@web.de>2020-02-17 23:05:31 +0100
commitfda4184fccfa2df1d46924c250407b6e03e8ab65 (patch)
treef7cb3559937175a7144d3bd6b8b1949b56f981ff
parent05d5568796f01bfb8f88d2b135c22203629f80f8 (diff)
[build][depends] add support for x86_64-linux-android
Previously, only an "i686-linux-android" was used which actually only corresponds to the 32bit CPU. In reference to this https://developer.android.com/ndk/guides/other_build_systems at 64bit "x86_64-linux-android" is used.
-rw-r--r--CMakeLists.txt5
-rw-r--r--cmake/modules/FindLibDvd.cmake2
-rw-r--r--cmake/scripts/android/ArchSetup.cmake3
-rw-r--r--cmake/scripts/common/PrepareEnv.cmake2
-rw-r--r--docs/README.Android.md5
-rw-r--r--tools/android/packaging/Makefile.in4
-rw-r--r--tools/depends/.gitignore2
-rw-r--r--tools/depends/README.md3
-rw-r--r--tools/depends/configure.ac2
-rw-r--r--tools/depends/target/ffmpeg/CMakeLists.txt2
-rw-r--r--tools/depends/target/ffmpeg/Makefile8
-rw-r--r--xbmc/cores/DllLoader/ldt_keeper.c2
12 files changed, 35 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2fb6bf5bed..433560fdfc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -319,6 +319,11 @@ if(NOT CORE_SYSTEM_NAME STREQUAL android)
else()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
add_library(${APP_NAME_LC} SHARED ${CORE_MAIN_SOURCE} "${RESOURCES}" ${OTHER_FILES})
+ if(CPU MATCHES x86_64)
+ # Statically resolve global references to shared library (ie. ffmpeg) definitions.
+ # Related to https://stackoverflow.com/questions/46307266/including-objects-to-a-shared-library-from-a-c-archive-a
+ set_target_properties(${APP_NAME_LC} PROPERTIES LINK_FLAGS "-Wl,-Bsymbolic")
+ endif()
endif()
add_dependencies(${APP_NAME_LC} ${APP_NAME_LC}-libraries export-files pack-skins)
whole_archive(_MAIN_LIBRARIES ${core_DEPENDS})
diff --git a/cmake/modules/FindLibDvd.cmake b/cmake/modules/FindLibDvd.cmake
index 7358e40ee7..44e7e92cb2 100644
--- a/cmake/modules/FindLibDvd.cmake
+++ b/cmake/modules/FindLibDvd.cmake
@@ -89,6 +89,8 @@ else()
set(HOST_ARCH aarch64-linux-android)
elseif(ARCH STREQUAL i486-linux)
set(HOST_ARCH i686-linux-android)
+ elseif(ARCH STREQUAL x86_64)
+ set(HOST_ARCH x86_64-linux-android)
endif()
elseif(CORE_SYSTEM_NAME STREQUAL windowsstore)
set(LIBDVD_ADDITIONAL_ARGS "-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}" "-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}")
diff --git a/cmake/scripts/android/ArchSetup.cmake b/cmake/scripts/android/ArchSetup.cmake
index f18db6c0d5..1e529de05d 100644
--- a/cmake/scripts/android/ArchSetup.cmake
+++ b/cmake/scripts/android/ArchSetup.cmake
@@ -27,6 +27,9 @@ else()
elseif(CPU STREQUAL i686)
set(ARCH i486-linux)
set(NEON False)
+ elseif(CPU STREQUAL x86_64)
+ set(ARCH x86_64)
+ set(NEON False)
else()
message(SEND_ERROR "Unknown CPU: ${CPU}")
endif()
diff --git a/cmake/scripts/common/PrepareEnv.cmake b/cmake/scripts/common/PrepareEnv.cmake
index ed0c11e02a..a547d82cc1 100644
--- a/cmake/scripts/common/PrepareEnv.cmake
+++ b/cmake/scripts/common/PrepareEnv.cmake
@@ -49,6 +49,8 @@ if(CORE_SYSTEM_NAME STREQUAL android)
set(PLATFORM_TAG ${PLATFORM_TAG}-aarch64)
elseif (CPU MATCHES "i686")
set(PLATFORM_TAG ${PLATFORM_TAG}-i686)
+ elseif (CPU MATCHES "x86_64")
+ set(PLATFORM_TAG ${PLATFORM_TAG}-x86_64)
else()
message(FATAL_ERROR "Unsupported architecture")
endif()
diff --git a/docs/README.Android.md b/docs/README.Android.md
index 0a85d64476..847db7ef28 100644
--- a/docs/README.Android.md
+++ b/docs/README.Android.md
@@ -151,6 +151,11 @@ 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-r20 --prefix=$HOME/android-tools/xbmc-depends
```
+Or configure build for x86_64:
+```
+./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=x86_64-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r20 --prefix=$HOME/android-tools/xbmc-depends
+```
+
Build tools and dependencies:
```
make -j$(getconf _NPROCESSORS_ONLN)
diff --git a/tools/android/packaging/Makefile.in b/tools/android/packaging/Makefile.in
index b610f6f490..243d49a276 100644
--- a/tools/android/packaging/Makefile.in
+++ b/tools/android/packaging/Makefile.in
@@ -27,7 +27,9 @@ endif
#this fixes a android ndk fuckup where the paths to
#prebuilt stuff follow different name schemes for
#arm and x86
-ifeq ($(findstring x86,$(CPU)),x86)
+ifeq ($(findstring x86_64,$(CPU)),x86_64)
+ ARCH=x86_64
+else ifeq ($(findstring x86,$(CPU)),x86)
ARCH=x86
else ifeq ($(findstring arm64,$(CPU)),arm64)
ARCH=arm64
diff --git a/tools/depends/.gitignore b/tools/depends/.gitignore
index 787782f73f..04c3de2166 100644
--- a/tools/depends/.gitignore
+++ b/tools/depends/.gitignore
@@ -13,6 +13,7 @@
/target/*/.installed-*
/target/*/native/*
/target/*/x86/*
+/target/*/x86_64-linux-android-*/*
/target/*/x86_64-linux-gnu-*/*
/target/*/armeabi-v7a-*/*
/target/*/arm*-linux-gnueabihf-*/*
@@ -21,6 +22,7 @@
/target/*/aarch64-linux-*/*
/target/*/macosx*.*_x86_64-target-*/
/target/*/macosx*.*_x86_64-target-*/*
+/target/*/i686-linux-android-*/*
/target/*/iphoneos*.*_arm*-target-*/
/target/*/iphoneos*.*_arm*-target-*/*
/target/*/iphonesimulator*.*_x86_64*-target-*/
diff --git a/tools/depends/README.md b/tools/depends/README.md
index 940a9e15cc..9aa9422171 100644
--- a/tools/depends/README.md
+++ b/tools/depends/README.md
@@ -44,6 +44,9 @@ Paths below are examples. If you want to build Kodi, follow our **[build guides]
**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-r20 --prefix=$HOME/android-tools/xbmc-depends`
+**x86_64**
+`./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=x86_64-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-ndk-r20 --prefix=$HOME/android-tools/xbmc-depends`
+
### Linux
**ARM (codesourcery/lenaro/etc)**
`./configure --with-toolchain=/opt/toolchains/my-example-toolchain/ --prefix=/opt/xbmc-deps --host=arm-linux-gnueabi`
diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac
index 21cdc0269a..ddf4040a5d 100644
--- a/tools/depends/configure.ac
+++ b/tools/depends/configure.ac
@@ -262,7 +262,7 @@ case $host in
platform_cflags+=" -march=armv8-a -mtune=cortex-a53"
fi
;;
- i*86*-linux-android*)
+ i*86*-linux-android*|x86_64*-linux-android*)
if test "x$use_cpu" = "xauto"; then
use_cpu=$host_cpu
fi
diff --git a/tools/depends/target/ffmpeg/CMakeLists.txt b/tools/depends/target/ffmpeg/CMakeLists.txt
index 5ee90c4b79..9227dc9427 100644
--- a/tools/depends/target/ffmpeg/CMakeLists.txt
+++ b/tools/depends/target/ffmpeg/CMakeLists.txt
@@ -59,6 +59,8 @@ elseif(CORE_SYSTEM_NAME STREQUAL android)
list(APPEND ffmpeg_conf --cpu=cortex-a53 --arch=aarch64)
elseif(CPU MATCHES arm)
list(APPEND ffmpeg_conf --cpu=cortex-a9)
+ elseif(CPU MATCHES x86_64)
+ list(APPEND ffmpeg_conf --cpu=x86_64 --enable-pic)
else()
list(APPEND ffmpeg_conf --cpu=i686 --disable-mmx)
endif()
diff --git a/tools/depends/target/ffmpeg/Makefile b/tools/depends/target/ffmpeg/Makefile
index 731109ff24..c5f5c2a370 100644
--- a/tools/depends/target/ffmpeg/Makefile
+++ b/tools/depends/target/ffmpeg/Makefile
@@ -37,8 +37,12 @@ ifeq ($(OS), android)
ifeq ($(findstring arm, $(CPU)), arm)
ffmpg_config += --cpu=cortex-a9
else
- ffmpg_config += --cpu=i686 --disable-mmx
- ffmpg_config += --extra-cflags=-no-integrated-as --extra-cflags=-mno-stackrealign
+ ifeq ($(CPU), x86_64)
+ ffmpg_config += --cpu=x86_64 --enable-pic
+ else
+ ffmpg_config += --cpu=i686 --disable-mmx
+ endif
+ ffmpg_config += --extra-cflags='-no-integrated-as -mno-stackrealign'
endif
endif
ffmpg_config += --target-os=linux --extra-libs=-liconv --disable-linux-perf
diff --git a/xbmc/cores/DllLoader/ldt_keeper.c b/xbmc/cores/DllLoader/ldt_keeper.c
index 0e6bc81bf7..c84fed02ad 100644
--- a/xbmc/cores/DllLoader/ldt_keeper.c
+++ b/xbmc/cores/DllLoader/ldt_keeper.c
@@ -49,7 +49,7 @@
#ifdef __cplusplus
extern "C" {
#endif
-#if defined(TARGET_ANDROID) && defined(__i386__) && !defined(modify_ldt)
+#if defined(TARGET_ANDROID) && (defined(__i386__) || defined(__x86_64__)) && !defined(modify_ldt)
#define modify_ldt(a,b,c) syscall( __NR_modify_ldt, a, b, c);
#else
int modify_ldt(int func, void *ptr, unsigned long bytecount);