-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path0013-android-ndk-version-bump.patch
120 lines (111 loc) · 5.1 KB
/
0013-android-ndk-version-bump.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
From 1b978a697e1bdb3144bc08f998d125ac593fa971 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <[email protected]>
Date: Thu, 23 May 2024 08:02:49 +0200
Subject: [PATCH 13/16] android ndk version bump
---
contrib/depends/hosts/android.mk | 16 +++++++++++++---
contrib/depends/packages/android_ndk.mk | 20 ++++++++++++++------
contrib/depends/packages/boost.mk | 1 +
contrib/depends/toolchain.cmake.in | 11 ++++++-----
4 files changed, 34 insertions(+), 14 deletions(-)
diff --git a/contrib/depends/hosts/android.mk b/contrib/depends/hosts/android.mk
index d6f8b99dd..e1c99aef3 100644
--- a/contrib/depends/hosts/android.mk
+++ b/contrib/depends/hosts/android.mk
@@ -1,12 +1,22 @@
ANDROID_API=21
-
+host_toolchain=nonexistent
ifeq ($(host_arch),arm)
-host_toolchain=arm-linux-androideabi-
+host_toolchain=armv7a-linux-androideabi${ANDROID_API}-
+endif
+ifeq ($(host_arch),x86_64)
+host_toolchain=x86_64-linux-android${ANDROID_API}-
+endif
+ifeq ($(host_arch),i686)
+host_toolchain=i686-linux-android${ANDROID_API}-
+endif
+ifeq ($(host_arch),aarch64)
+host_toolchain=aarch64-linux-android${ANDROID_API}-
endif
android_CC=$(host_toolchain)clang
android_CXX=$(host_toolchain)clang++
-android_RANLIB=:
+android_RANLIB=llvm-ranlib
+android_AR=llvm-ar
android_CFLAGS=-pipe
android_CXXFLAGS=$(android_CFLAGS)
diff --git a/contrib/depends/packages/android_ndk.mk b/contrib/depends/packages/android_ndk.mk
index 5deff76c7..1ad250653 100644
--- a/contrib/depends/packages/android_ndk.mk
+++ b/contrib/depends/packages/android_ndk.mk
@@ -1,8 +1,10 @@
package=android_ndk
-$(package)_version=17b
+$(package)_version=26d
$(package)_download_path=https://dl.google.com/android/repository/
-$(package)_file_name=android-ndk-r$($(package)_version)-linux-x86_64.zip
-$(package)_sha256_hash=5dfbbdc2d3ba859fed90d0e978af87c71a91a5be1f6e1c40ba697503d48ccecd
+$(package)_file_name=android-ndk-r$($(package)_version)-linux.zip
+$(package)_sha256_hash=eefeafe7ccf177de7cc57158da585e7af119bb7504a63604ad719e4b2a328b54
+
+$(package)_version_apiversion=21
define $(package)_set_vars
$(package)_config_opts_arm=--arch arm
@@ -17,8 +19,14 @@ define $(package)_extract_cmds
endef
define $(package)_stage_cmds
- android-ndk-r$($(package)_version)/build/tools/make_standalone_toolchain.py --api 21 \
- --install-dir $(build_prefix) --stl=libc++ $($(package)_config_opts) &&\
- mv $(build_prefix) $($(package)_staging_dir)/$(host_prefix)
+ mkdir -p $(build_prefix) &&\
+ echo $(build_prefix)/toolchain && \
+ android-ndk-r$($(package)_version)/build/tools/make_standalone_toolchain.py --api $($(package)_version_apiversion) \
+ --install-dir $(build_prefix)/toolchain --stl=libc++ $($(package)_config_opts) &&\
+ mv $(build_prefix)/toolchain $($(package)_staging_dir)/$(host_prefix)/native && \
+ cp $($(package)_staging_dir)/$(host_prefix)/native/bin/llvm-ar $($(package)_staging_dir)/$(host_prefix)/native/bin/$(host)$($(package)_version_apiversion)-ar &&\
+ cp $($(package)_staging_dir)/$(host_prefix)/native/bin/llvm-ranlib $($(package)_staging_dir)/$(host_prefix)/native/bin/$(host)$($(package)_version_apiversion)-ranlib &&\
+ cp $($(package)_staging_dir)/$(host_prefix)/native/bin/llvm-ar $($(package)_staging_dir)/$(host_prefix)/native/bin/$(host)-ar &&\
+ cp $($(package)_staging_dir)/$(host_prefix)/native/bin/llvm-ranlib $($(package)_staging_dir)/$(host_prefix)/native/bin/$(host)-ranlib
endef
diff --git a/contrib/depends/packages/boost.mk b/contrib/depends/packages/boost.mk
index fd06c5393..c17e863cc 100644
--- a/contrib/depends/packages/boost.mk
+++ b/contrib/depends/packages/boost.mk
@@ -25,6 +25,7 @@ $(package)_archiver_darwin=$($(package)_libtool)
$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test,date_time,regex,serialization,locale
$(package)_cxxflags=-std=c++11
$(package)_cxxflags_linux=-fPIC
+$(package)_cxxflags_android=-fPIC
$(package)_cxxflags_freebsd=-fPIC
endef
diff --git a/contrib/depends/toolchain.cmake.in b/contrib/depends/toolchain.cmake.in
index f26655d68..96a95ceb8 100644
--- a/contrib/depends/toolchain.cmake.in
+++ b/contrib/depends/toolchain.cmake.in
@@ -104,16 +104,17 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
SET(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a")
SET(CMAKE_SYSTEM_PROCESSOR "armv7-a")
SET(CMAKE_ANDROID_ARM_MODE ON)
- SET(CMAKE_C_COMPILER_TARGET arm-linux-androideabi)
- SET(CMAKE_CXX_COMPILER_TARGET arm-linux-androideabi)
- SET(_CMAKE_TOOLCHAIN_PREFIX arm-linux-androideabi-)
+ SET(CMAKE_C_COMPILER_TARGET arm-linux-androideabi21)
+ SET(CMAKE_CXX_COMPILER_TARGET arm-linux-androideabi21)
+ SET(_CMAKE_TOOLCHAIN_PREFIX arm-linux-androideabi21-)
elseif(ARCHITECTURE STREQUAL "aarch64")
SET(CMAKE_ANDROID_ARCH_ABI "arm64-v8a")
SET(CMAKE_SYSTEM_PROCESSOR "aarch64")
endif()
SET(CMAKE_ANDROID_STANDALONE_TOOLCHAIN @prefix@/native)
- SET(CMAKE_C_COMPILER "${_CMAKE_TOOLCHAIN_PREFIX}clang")
- SET(CMAKE_CXX_COMPILER "${_CMAKE_TOOLCHAIN_PREFIX}clang++")
+ SET(_ANDROID_STANDALONE_TOOLCHAIN_API 21)
+ SET(CMAKE_C_COMPILER @CC@)
+ SET(CMAKE_CXX_COMPILER @CXX@)
else()
SET(CMAKE_C_COMPILER @CC@)
SET(CMAKE_CXX_COMPILER @CXX@)
--
2.39.2