Skip to content

Commit 5ce7fa6

Browse files
committed
Switch NDK from r10e to r12b
This CL completely removes --android_compiler option since we now only support Clang toolchain for Android target binaries. GCC toolchain bundled in Android NDK is going to be deprecated shortly [1]. This Cl also adds following build targets on Travis-CI. - Android (arm64) - Android (x86) - Android (x86_64) - Android (mips) - Android (mips64) Closes #273. [1]: https://android.googlesource.com/platform/ndk.git/+/fb83ea8bf716ef262ca9f03b2102ebcbb147b38a BUG=#273 TEST=compile REF_BUG= REF_CL=131555947,133352265,134314373 REF_TIME=2016-08-28T22:29:30-07:00 REF_TIME_RAW=1472448570 -0700
1 parent d44d064 commit 5ce7fa6

File tree

7 files changed

+55
-110
lines changed

7 files changed

+55
-110
lines changed

.travis.yml

+29-14
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ language: cpp
3939
compiler: clang
4040

4141
env:
42-
- TARGET_PLATFORM=Android
42+
- TARGET_PLATFORM=Android_arm
43+
- TARGET_PLATFORM=Android_arm64
44+
- TARGET_PLATFORM=Android_x86
45+
- TARGET_PLATFORM=Android_x86_64
46+
- TARGET_PLATFORM=Android_mips
47+
- TARGET_PLATFORM=Android_mips64
4348
- TARGET_PLATFORM=Linux
4449
- TARGET_PLATFORM=NaCl
4550
- TARGET_PLATFORM=Mac
@@ -49,7 +54,7 @@ before_install:
4954
- if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y clang python pkg-config curl bzip2 unzip make; fi
5055
- if [ $TARGET_PLATFORM == Linux ]; then sudo apt-get install -y libibus-1.0-dev libglib2.0-dev libqt4-dev libgtk2.0-dev libxcb-xfixes0-dev; fi
5156
- if [ $TARGET_PLATFORM == NaCl ]; then sudo apt-get install -y libc6-i386 lib32stdc++6; fi
52-
- if [ $TARGET_PLATFORM == Android ]; then sudo apt-get install --no-install-recommends openjdk-7-jdk openjdk-7-jre-headless libjsr305-java ant zip libc6-i386 lib32stdc++6 lib32ncurses5 lib32z1; fi
57+
- if [ ${TARGET_PLATFORM:0:7} == Android ]; then sudo apt-get install --no-install-recommends openjdk-7-jdk openjdk-7-jre-headless libjsr305-java ant zip libc6-i386 lib32stdc++6 lib32ncurses5 lib32z1; fi
5358

5459
install:
5560
- if [ $TRAVIS_OS_NAME == linux ]; then git -C src/third_party clone https://chromium.googlesource.com/chromium/tools/depot_tools.git; fi
@@ -59,20 +64,20 @@ install:
5964
- if [ $TARGET_PLATFORM == Mac ]; then git -C src/third_party clone https://chromium.googlesource.com/chromium/tools/depot_tools.git; fi
6065
- if [ $TARGET_PLATFORM == Mac ]; then export PATH="$PATH":`pwd`/src/third_party/depot_tools; fi
6166
- if [ $TARGET_PLATFORM == NaCl ]; then cd src/third_party && curl -LO http://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/nacl_sdk.zip && unzip nacl_sdk.zip && rm nacl_sdk.zip && cd nacl_sdk && ./naclsdk install pepper_45 && cd ../../../; fi
62-
- if [ $TARGET_PLATFORM == Android ]; then jdk_switcher use openjdk7; fi
63-
- if [ $TARGET_PLATFORM == Android ]; then cd src/third_party && curl -L http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin -O && chmod u+x android-ndk-r10e-linux-x86_64.bin && ./android-ndk-r10e-linux-x86_64.bin > /dev/null && rm android-ndk-r10e-linux-x86_64.bin && curl -L http://dl.google.com/android/android-sdk_r24.1.2-linux.tgz | tar -zx && cd ../../; fi
64-
- if [ $TARGET_PLATFORM == Android ]; then export ANDROID_NDK_HOME=`pwd`/src/third_party/android-ndk-r10e ; fi
65-
- if [ $TARGET_PLATFORM == Android ]; then export ANDROID_HOME=`pwd`/src/third_party/android-sdk-linux ; fi
66-
- if [ $TARGET_PLATFORM == Android ]; then export PATH="$PATH":${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_NDK_HOME}; fi
67-
- if [ $TARGET_PLATFORM == Android ]; then echo y | android update sdk --all --force --no-ui --filter android-22; fi
68-
- if [ $TARGET_PLATFORM == Android ]; then echo y | android update sdk --all --force --no-ui --filter build-tools-22.0.0; fi
69-
- if [ $TARGET_PLATFORM == Android ]; then echo y | android update sdk --all --force --no-ui --filter extra-android-support; fi
70-
- if [ $TARGET_PLATFORM == Android ]; then echo y | android update sdk --all --force --no-ui --filter platform-tool; fi
67+
- if [ ${TARGET_PLATFORM:0:7} == Android ]; then jdk_switcher use openjdk7; fi
68+
- if [ ${TARGET_PLATFORM:0:7} == Android ]; then cd src/third_party && curl -LO http://dl.google.com/android/repository/android-ndk-r12b-linux-x86_64.zip && unzip -q android-ndk-r12b-linux-x86_64.zip && rm android-ndk-r12b-linux-x86_64.zip && curl -L http://dl.google.com/android/android-sdk_r24.1.2-linux.tgz | tar -zx && cd ../../; fi
69+
- if [ ${TARGET_PLATFORM:0:7} == Android ]; then export ANDROID_NDK_HOME=`pwd`/src/third_party/android-ndk-r12b ; fi
70+
- if [ ${TARGET_PLATFORM:0:7} == Android ]; then export ANDROID_HOME=`pwd`/src/third_party/android-sdk-linux ; fi
71+
- if [ ${TARGET_PLATFORM:0:7} == Android ]; then export PATH="$PATH":${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_NDK_HOME}; fi
72+
- if [ ${TARGET_PLATFORM:0:7} == Android ]; then echo y | android update sdk --all --force --no-ui --filter android-22; fi
73+
- if [ ${TARGET_PLATFORM:0:7} == Android ]; then echo y | android update sdk --all --force --no-ui --filter build-tools-22.0.0; fi
74+
- if [ ${TARGET_PLATFORM:0:7} == Android ]; then echo y | android update sdk --all --force --no-ui --filter extra-android-support; fi
75+
- if [ ${TARGET_PLATFORM:0:7} == Android ]; then echo y | android update sdk --all --force --no-ui --filter platform-tool; fi
7176

7277
script:
7378
- cd ./src
74-
- if [ $TARGET_PLATFORM == Android ]; then python build_mozc.py gyp --target_platform=Android; fi
75-
- if [ $TARGET_PLATFORM == Android ]; then python build_mozc.py build -c Release package; fi
79+
- if [ ${TARGET_PLATFORM:0:7} == Android ]; then python build_mozc.py gyp --target_platform=Android --android_arch=${TARGET_PLATFORM:8:6}; fi
80+
- if [ ${TARGET_PLATFORM:0:7} == Android ]; then python build_mozc.py build -c Release package; fi
7681
- if [ $TARGET_PLATFORM == Linux ]; then python build_mozc.py gyp --target_platform=Linux; fi
7782
- if [ $TARGET_PLATFORM == Linux ]; then python build_mozc.py build -c Release package; fi
7883
- if [ $TARGET_PLATFORM == Linux ]; then python build_mozc.py runtests -c Release; fi
@@ -87,7 +92,17 @@ matrix:
8792
- os: linux
8893
env: TARGET_PLATFORM=Mac
8994
- os: osx
90-
env: TARGET_PLATFORM=Android
95+
env: TARGET_PLATFORM=Android_arm
96+
- os: osx
97+
env: TARGET_PLATFORM=Android_arm64
98+
- os: osx
99+
env: TARGET_PLATFORM=Android_x86
100+
- os: osx
101+
env: TARGET_PLATFORM=Android_x86_64
102+
- os: osx
103+
env: TARGET_PLATFORM=Android_mips
104+
- os: osx
105+
env: TARGET_PLATFORM=Android_mips64
91106
- os: osx
92107
env: TARGET_PLATFORM=Linux
93108
- os: osx

docker/ubuntu14.04/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ RUN mkdir -p /home/mozc_builder/work
5353
WORKDIR /home/mozc_builder/work
5454

5555
## Android SDK/NDK
56-
RUN curl -L http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin -O && chmod u+x android-ndk-r10e-linux-x86_64.bin && ./android-ndk-r10e-linux-x86_64.bin && rm android-ndk-r10e-linux-x86_64.bin
56+
RUN curl -LO http://dl.google.com/android/repository/android-ndk-r12b-linux-x86_64.zip && unzip android-ndk-r12b-linux-x86_64.zip && rm android-ndk-r12b-linux-x86_64.zip
5757
RUN curl -L http://dl.google.com/android/android-sdk_r24.1.2-linux.tgz | tar -zx
58-
ENV ANDROID_NDK_HOME /home/mozc_builder/work/android-ndk-r10e
58+
ENV ANDROID_NDK_HOME /home/mozc_builder/work/android-ndk-r12b
5959
ENV ANDROID_HOME /home/mozc_builder/work/android-sdk-linux
6060
ENV PATH $PATH:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_NDK_HOME}
6161
RUN echo y | android update sdk --all --force --no-ui --filter android-22

src/android/android.gyp

+6-5
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,13 @@
234234
'type': 'none',
235235
'variables': {
236236
'make_standalone_toolchain_commands': [
237-
'bash',
238-
'<(android_ndk_home)/build/tools/make-standalone-toolchain.sh',
239-
'--toolchain=<(toolchain)',
240-
'--stl=libcxx',
237+
'python',
238+
'<(android_ndk_home)/build/tools/make_standalone_toolchain.py',
239+
'--force',
240+
'--arch=<(android_arch)',
241+
'--stl=libc++',
241242
'--install-dir=<(mozc_build_tools_dir)/ndk-standalone-toolchain/<(android_arch)',
242-
'--platform=<(platform)',
243+
'--api=<(ndk_target_api_level)',
243244
],
244245
'make_standalone_toolchain_result': '<!(<(make_standalone_toolchain_commands))',
245246
},

src/android/android_env.gypi

+12-60
Original file line numberDiff line numberDiff line change
@@ -83,88 +83,40 @@
8383
'font_dir': '<(third_party_dir)/noto_font',
8484
},
8585
}],
86-
['android_arch=="arm" and android_compiler=="gcc"', {
86+
['android_arch=="arm"', {
8787
'variables': {
8888
'abi': 'armeabi-v7a',
89-
'toolchain': 'arm-linux-androideabi-4.9',
90-
'platform': 'android-14',
89+
'ndk_target_api_level': '14',
9190
},
9291
}],
93-
['android_arch=="arm" and android_compiler=="clang"', {
94-
'variables': {
95-
'abi': 'armeabi-v7a',
96-
'toolchain': 'arm-linux-androideabi-clang3.5',
97-
'platform': 'android-14',
98-
},
99-
}],
100-
['android_arch=="x86" and android_compiler=="gcc"', {
101-
'variables': {
102-
'abi': 'x86',
103-
'toolchain': 'x86-4.9',
104-
'platform': 'android-14',
105-
},
106-
}],
107-
['android_arch=="x86" and android_compiler=="clang"', {
92+
['android_arch=="x86"', {
10893
'variables': {
10994
'abi': 'x86',
110-
'toolchain': 'x86-clang3.5',
111-
'platform': 'android-14',
112-
},
113-
}],
114-
['android_arch=="mips" and android_compiler=="gcc"', {
115-
'variables': {
116-
'abi': 'mips',
117-
'toolchain': 'mipsel-linux-android-4.9',
118-
'platform': 'android-14',
95+
'ndk_target_api_level': '14',
11996
},
12097
}],
121-
['android_arch=="mips" and android_compiler=="clang"', {
98+
['android_arch=="mips"', {
12299
'variables': {
123100
'abi': 'mips',
124-
'toolchain': 'mipsel-linux-android-clang3.5',
125-
'platform': 'android-14',
101+
'ndk_target_api_level': '14',
126102
},
127103
}],
128-
['android_arch=="arm64" and android_compiler=="gcc"', {
104+
['android_arch=="arm64"', {
129105
'variables': {
130106
'abi': 'arm64-v8a',
131-
'toolchain': 'aarch64-linux-android-4.9',
132-
'platform': 'android-21',
107+
'ndk_target_api_level': '21',
133108
},
134109
}],
135-
['android_arch=="arm64" and android_compiler=="clang"', {
136-
'variables': {
137-
'abi': 'arm64-v8a',
138-
'toolchain': 'aarch64-linux-android-clang3.5',
139-
'platform': 'android-21',
140-
},
141-
}],
142-
['android_arch=="x86_64" and android_compiler=="gcc"', {
143-
'variables': {
144-
'abi': 'x86_64',
145-
'toolchain': 'x86_64-4.9',
146-
'platform': 'android-21',
147-
},
148-
}],
149-
['android_arch=="x86_64" and android_compiler=="clang"', {
110+
['android_arch=="x86_64"', {
150111
'variables': {
151112
'abi': 'x86_64',
152-
'toolchain': 'x86_64-clang3.5',
153-
'platform': 'android-21',
154-
},
155-
}],
156-
['android_arch=="mips64" and android_compiler=="gcc"', {
157-
'variables': {
158-
'abi': 'mips64',
159-
'toolchain': 'mips64el-linux-android-4.9',
160-
'platform': 'android-21',
113+
'ndk_target_api_level': '21',
161114
},
162115
}],
163-
['android_arch=="mips64" and android_compiler=="clang"', {
116+
['android_arch=="mips64"', {
164117
'variables': {
165118
'abi': 'mips64',
166-
'toolchain': 'mips64el-linux-android-4.9',
167-
'platform': 'android-21',
119+
'ndk_target_api_level': '21',
168120
},
169121
}],
170122
],

src/build_mozc.py

-6
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,6 @@ def ParseGypOptions(args):
297297
default='arm',
298298
help='[Android build only] Android architecture '
299299
'(arm, x86, mips)')
300-
parser.add_option('--android_compiler', dest='android_compiler',
301-
type='choice',
302-
choices=('gcc', 'clang'),
303-
default='gcc',
304-
help='[Android build only] Compiler')
305300
parser.add_option('--android_application_id', dest='android_application_id',
306301
default='org.mozc.android.inputmethod.japanese',
307302
help='[Android build only] Android\'s application id'
@@ -642,7 +637,6 @@ def GypMain(options, unused_args):
642637

643638
gyp_options.extend(['-D', 'android_home=%s' % android_home])
644639
gyp_options.extend(['-D', 'android_arch=%s' % options.android_arch])
645-
gyp_options.extend(['-D', 'android_compiler=%s' % options.android_compiler])
646640
gyp_options.extend(['-D', 'android_ndk_home=%s' % android_ndk_home])
647641
gyp_options.extend(['-D', 'android_application_id=%s' %
648642
options.android_application_id])

src/data/version/mozc_version_template.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
MAJOR=2
3232
MINOR=18
33-
BUILD=2598
33+
BUILD=2599
3434
REVISION=102
3535
# This version represents the version of Mozc IME engine (converter, predictor,
3636
# etc.). This version info is included both in the Mozc server and in the Mozc

src/gyp/common.gypi

+5-22
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,9 @@
115115
'compiler_host': 'clang',
116116
'compiler_host_version_int': 303, # Clang 3.3 or higher
117117
}],
118-
['target_platform=="Android" and android_compiler=="clang"', {
118+
['target_platform=="Android"', {
119119
'compiler_target': 'clang',
120-
'compiler_target_version_int': 305, # Clang 3.5 or higher
121-
'compiler_host': 'clang',
122-
'compiler_host_version_int': 304, # Clang 3.4 or higher
123-
}],
124-
['target_platform=="Android" and android_compiler=="gcc"', {
125-
'compiler_target': 'gcc',
126-
'compiler_target_version_int': 409, # GCC 4.9 or higher
120+
'compiler_target_version_int': 308, # Clang 3.8 or higher
127121
'compiler_host': 'clang',
128122
'compiler_host_version_int': 304, # Clang 3.4 or higher
129123
}],
@@ -312,6 +306,7 @@
312306
],
313307
'ldflags': [
314308
'-llog',
309+
'-static-libstdc++',
315310
],
316311
'conditions': [
317312
['android_arch=="arm"', {
@@ -494,25 +489,13 @@
494489
'toolchain_prefix': 'mips64el-linux-android',
495490
},
496491
}],
497-
['android_compiler=="gcc"', {
498-
'variables': {
499-
'c_compiler': 'gcc',
500-
'cxx_compiler': 'g++',
501-
}
502-
}],
503-
['android_compiler=="clang"', {
504-
'variables': {
505-
'c_compiler': 'clang',
506-
'cxx_compiler': 'clang++',
507-
}
508-
}],
509492
],
510493
# To use clang only CC and CXX should point clang directly.
511494
# c.f., https://android.googlesource.com/platform/ndk/+/tools_ndk_r9d/docs/text/STANDALONE-TOOLCHAIN.text
512495
'make_global_settings': [
513496
['AR', '<(ndk_bin_dir)/<(toolchain_prefix)-ar'],
514-
['CC', '<(ndk_bin_dir)/<(toolchain_prefix)-<(c_compiler)'],
515-
['CXX', '<(ndk_bin_dir)/<(toolchain_prefix)-<(cxx_compiler)'],
497+
['CC', '<(ndk_bin_dir)/<(toolchain_prefix)-clang'],
498+
['CXX', '<(ndk_bin_dir)/<(toolchain_prefix)-clang++'],
516499
['LD', '<(ndk_bin_dir)/<(toolchain_prefix)-ld'],
517500
['NM', '<(ndk_bin_dir)/<(toolchain_prefix)-nm'],
518501
['READELF', '<(ndk_bin_dir)/<(toolchain_prefix)-readelf'],

0 commit comments

Comments
 (0)