Commit d226510f authored by Georg Koppen's avatar Georg Koppen
Browse files

Bug 28119: Tor Browser for aarch64

Thanks to boklm for help with this patch.
parent b4414487
......@@ -11,6 +11,9 @@ release-android-armv7: submodule-update
release-android-x86: submodule-update
$(rbm) build release --target release --target torbrowser-android-x86
release-android-aarch64: submodule-update
$(rbm) build release --target release --target torbrowser-android-aarch64
release-linux-x86_64: submodule-update
$(rbm) build release --target release --target torbrowser-linux-x86_64
......@@ -41,6 +44,9 @@ alpha-android-armv7: submodule-update
alpha-android-x86: submodule-update
$(rbm) build release --target alpha --target torbrowser-android-x86
alpha-android-aarch64: submodule-update
$(rbm) build release --target alpha --target torbrowser-android-aarch64
alpha-linux-x86_64: submodule-update
$(rbm) build release --target alpha --target torbrowser-linux-x86_64
......@@ -71,6 +77,9 @@ nightly-android-armv7: submodule-update
nightly-android-x86: submodule-update
$(rbm) build release --target nightly --target torbrowser-android-x86
nightly-android-aarch64: submodule-update
$(rbm) build release --target nightly --target torbrowser-android-aarch64
nightly-linux-x86_64: submodule-update
$(rbm) build release --target nightly --target torbrowser-linux-x86_64
......@@ -101,6 +110,9 @@ alpha_nightly-android-armv7: submodule-update
alpha_nightly-android-x86: submodule-update
$(rbm) build release --target alpha_nightly --target torbrowser-android-x86
alpha_nightly-android-aarch64: submodule-update
$(rbm) build release --target alpha_nightly --target torbrowser-android-aarch64
alpha_nightly-linux-x86_64: submodule-update
$(rbm) build release --target alpha_nightly --target torbrowser-linux-x86_64
......@@ -128,6 +140,9 @@ testbuild-android-armv7: submodule-update
testbuild-android-x86: submodule-update
$(rbm) build release --target testbuild --target torbrowser-android-x86
testbuild-android-aarch64: submodule-update
$(rbm) build release --target testbuild --target torbrowser-android-aarch64
testbuild-linux-x86_64: submodule-update
$(rbm) build release --target testbuild --target torbrowser-linux-x86_64
......
......@@ -18,11 +18,9 @@ cd $NDK_HOME
mv android-ndk-r15c/* .
rm -fR android-ndk-r15c
# The architectures we support
archs="arm x86"
for arch in $archs; do
./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api") %] --arch $arch --install-dir=./$arch
done
./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_armv7") %] --arch arm --install-dir=./arm
./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_x86") %] --arch x86 --install-dir=./x86
./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_aarch64") %] --arch arm64 --install-dir=./arm64
# Tool Archives
cd $SDK_HOME
......
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-aarch64-linux-android
mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser"
export MOZILLA_OFFICIAL=1
ac_add_options --enable-optimize
ac_add_options --enable-official-branding
ac_add_options --enable-application=mobile/android
ac_add_options --target=aarch64-linux-android
ac_add_options --with-android-ndk=/var/tmp/dist/android-toolchain/android-ndk
ac_add_options --with-android-sdk=/var/tmp/dist/android-toolchain/android-sdk-linux
ac_add_options --with-gradle=/var/tmp/dist/android-toolchain/gradle/gradle-4.1/bin/gradle
ac_add_options --with-android-version=21
# Android NDK does not contain llvm-config so set clang path in options
ac_add_options --with-libclang-path=/var/tmp/dist/android-toolchain/android-ndk/arm64/lib64
ac_add_options --with-clang-path=/var/tmp/dist/android-toolchain/android-ndk/arm64/bin/clang
ac_add_options --with-android-distribution-directory=@TOPSRCDIR@/mobile/android/torbrowser
ac_add_options --with-l10n-base=/var/tmp/dist/locales
# We do not use Tor Launcher on Android:
ac_add_options --disable-tor-launcher
if [ -z "${TB_BUILD_WITH_UPDATER}" ]; then
# Because Google Play will likely be the primary distribution medium,
# we disable updating and rely on Google Play by default. The
# Developer Policy explicitly prohibits in-app updating:
# An app distributed via Google Play may not modify, replace, or
# update itself using any method other than Google Plays update
# mechanism.
# https://play.google.com/about/privacy-security-deception/malicious-behavior/
ac_add_options --disable-tor-browser-update
ac_add_options --disable-signmar
ac_add_options --disable-verify-mar
fi
ac_add_options --enable-strip
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-rust-debug
ac_add_options --disable-maintenance-service
ac_add_options --disable-crashreporter
ac_add_options --disable-webrtc
ac_add_options --without-google-play-services
# Let's make sure no preference is enabling either Adobe's or Google's CDM.
ac_add_options --disable-eme
......@@ -10,6 +10,9 @@ mkdir -p "$destdir"
[% IF c("var/torbrowser-android-x86") -%]
mv [% c('input_files_by_name/android-x86') %]/* "$destdir"/
[% END -%]
[% IF c("var/torbrowser-android-aarch64") -%]
mv [% c('input_files_by_name/android-aarch64') %]/* "$destdir"/
[% END -%]
[% IF c("var/torbrowser-windows-i686") -%]
mv [% c('input_files_by_name/windows-i686') %]/* "$destdir"/
mv [% c('input_files_by_name/windows-expert-bundle') %]/* "$destdir"/
......
......@@ -24,6 +24,9 @@ targets:
torbrowser-android-x86:
var:
torbrowser-android-x86: 1
torbrowser-android-aarch64:
var:
torbrowser-android-aarch64: 1
torbrowser-linux-x86_64:
var:
torbrowser-linux-x86_64: 1
......@@ -117,6 +120,13 @@ input_files:
- '[% c("var/build_target") %]'
- torbrowser-android-x86
- name: android-aarch64
project: tor-browser
enable: '[% c("var/torbrowser-android-aarch64") %]'
target:
- '[% c("var/build_target") %]'
- torbrowser-android-aarch64
- name: linux-x86_64
project: tor-browser
enable: '[% c("var/torbrowser-linux-x86_64") %]'
......
......@@ -30,6 +30,10 @@ targets:
var:
configure_opt: --enable-local-rust --enable-vendor --enable-extended --release-channel=stable --sysconfdir=etc --target=i686-linux-android --set=target.i686-linux-android.cc=$ANDROID_NDK_HOME/x86/bin/i686-linux-android-gcc
android-aarch64:
var:
configure_opt: --enable-local-rust --enable-vendor --enable-extended --release-channel=stable --sysconfdir=etc --target=aarch64-linux-android --set=target.aarch64-linux-android.cc=$ANDROID_NDK_HOME/arm64/bin/aarch64-linux-android-gcc
linux:
var:
rust_arch: x86_64
......
......@@ -24,13 +24,16 @@ zip -d $apk lib/\*
zip_src => [ 'lib/x86/*' ],
zip_args => '$apk',
}) %]
[% END %]
[% IF c("var/android-armv7") %]
[% ELSIF c("var/android-armv7") %]
[% c('zip', {
zip_src => [ 'lib/armeabi-v7a/*' ],
zip_args => '$apk',
}) %]
[% ELSIF c("var/android-aarch64") %]
[% c('zip', {
zip_src => [ 'lib/arm64-v8a/*' ],
zip_args => '$apk',
}) %]
[% END %]
rm -fR lib
......
......@@ -190,12 +190,24 @@ targets:
var:
android-x86: 1
osname: android-x86
torbrowser-android-aarch64:
- android-aarch64
- android
android-aarch64:
arch: aarch64
var:
android-aarch64: 1
osname: android-aarch64
android:
var:
android: 1
compiler: android-toolchain
# API 16 is the minimum we currently support for Tor Browser on Android
android_min_api: 16
android_min_api: '[% GET c("var/android_min_api_" _ c("arch")) %]'
# API 21 is the minimum we currently support for arm64 on Android
android_min_api_aarch64: 21
android_min_api_armv7: 16
android_min_api_x86: 16
snowflake: 0
container:
suite: stretch
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment