GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

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

Bug 27210: Add support for x86 on Android

parent abcc56a2
......@@ -8,6 +8,9 @@ release: submodule-update
release-android-armv7: submodule-update
$(rbm) build release --target release --target torbrowser-android-armv7
release-android-x86: submodule-update
$(rbm) build release --target release --target torbrowser-android-x86
release-linux-x86_64: submodule-update
$(rbm) build release --target release --target torbrowser-linux-x86_64
......@@ -32,6 +35,9 @@ alpha: submodule-update
alpha-android-armv7: submodule-update
$(rbm) build release --target alpha --target torbrowser-android-armv7
alpha-android-x86: submodule-update
$(rbm) build release --target alpha --target torbrowser-android-x86
alpha-linux-x86_64: submodule-update
$(rbm) build release --target alpha --target torbrowser-linux-x86_64
......@@ -56,6 +62,9 @@ nightly: submodule-update
nightly-android-armv7: submodule-update
$(rbm) build release --target nightly --target torbrowser-android-armv7
nightly-android-x86: submodule-update
$(rbm) build release --target nightly --target torbrowser-android-x86
nightly-linux-x86_64: submodule-update
$(rbm) build release --target nightly --target torbrowser-linux-x86_64
......@@ -80,6 +89,9 @@ alpha_nightly: submodule-update
alpha_nightly-android-armv7: submodule-update
$(rbm) build release --target alpha_nightly --target torbrowser-android-armv7
alpha_nightly-android-x86: submodule-update
$(rbm) build release --target alpha_nightly --target torbrowser-android-x86
alpha_nightly-linux-x86_64: submodule-update
$(rbm) build release --target alpha_nightly --target torbrowser-linux-x86_64
......@@ -101,6 +113,9 @@ testbuild: submodule-update
testbuild-android-armv7: submodule-update
$(rbm) build release --target testbuild --target torbrowser-android-armv7
testbuild-android-x86: submodule-update
$(rbm) build release --target testbuild --target torbrowser-android-x86
testbuild-linux-x86_64: submodule-update
$(rbm) build release --target testbuild --target torbrowser-linux-x86_64
......
......@@ -17,8 +17,14 @@ unzip -qq [% c("input_files_by_name/gradle_bin") %] -d $GRADLE_HOME
cd $NDK_HOME
mv android-ndk-r15c/* .
rm -fR android-ndk-r15c
# API 16 is the minimum we currently support for Tor Browser on Android
./build/tools/make_standalone_toolchain.py --api 16 --arch arm --install-dir=./arm
# The architectures we support
archs="arm x86"
for arch in $archs; do
# API 16 is the minimum we currently support for Tor Browser on Android for
# 32bit.
./build/tools/make_standalone_toolchain.py --api 16 --arch $arch --install-dir=./$arch
done
# Tool Archives
cd $SDK_HOME
......
......@@ -41,7 +41,7 @@ targets:
torbrowser_update_channel: default
branding_directory: browser/branding/nightly
android-armv7:
android:
var:
arch_deps:
- openjdk-8-jdk
......
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-i386-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=i386-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=16
ac_add_options --with-branding=mobile/android/branding/torbrowser
# 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/x86/lib64
ac_add_options --with-clang-path=/var/tmp/dist/android-toolchain/android-ndk/x86/bin/clang
ac_add_options --with-android-distribution-directory=@TOPSRCDIR@/mobile/android/torbrowser
ac_add_options --with-l10n-base=/var/tmp/dist/locales
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
......@@ -23,7 +23,12 @@ done
# Build OrbotService Native Libraries
pushd /var/tmp/build/[% project %]-[% c('version') %]/orbotservice/src/main
/var/tmp/dist/android-toolchain/android-ndk/ndk-build
mv libs/armeabi-v7a/pdnsd libs/armeabi-v7a/pdnsd.so
[% IF c("var/android-armv7") %]
arch=armeabi-v7a
[% ELSE %]
arch=x86
[% END %]
mv libs/$arch/pdnsd libs/$arch/pdnsd.so
popd
# Build Android Libraries and Apps
......
......@@ -24,7 +24,7 @@ var:
gradle_dependencies_version: 1
targets:
android-armv7:
android:
var:
arch_deps:
- openjdk-8-jdk
......
......@@ -7,6 +7,9 @@ mkdir -p "$destdir"
[% IF c("var/torbrowser-android-armv7") -%]
mv [% c('input_files_by_name/android-armv7') %]/* "$destdir"/
[% END -%]
[% IF c("var/torbrowser-android-x86") -%]
mv [% c('input_files_by_name/android-x86') %]/* "$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"/
......
......@@ -15,9 +15,13 @@ targets:
- torbrowser-windows-x86_64
- torbrowser-osx-x86_64
- torbrowser-android-armv7
- torbrowser-android-x86
torbrowser-android-armv7:
var:
torbrowser-android-armv7: 1
torbrowser-android-x86:
var:
torbrowser-android-x86: 1
torbrowser-linux-x86_64:
var:
torbrowser-linux-x86_64: 1
......@@ -91,6 +95,13 @@ input_files:
- '[% c("var/build_target") %]'
- torbrowser-android-armv7
- name: android-x86
project: tor-browser
enable: '[% c("var/torbrowser-android-x86") %]'
target:
- '[% c("var/build_target") %]'
- torbrowser-android-x86
- name: linux-x86_64
project: tor-browser
enable: '[% c("var/torbrowser-linux-x86_64") %]'
......
......@@ -67,8 +67,11 @@ cd /var/tmp/build/rustc-[% c('version') %]-src
[% END %]
[% IF c("var/android") %]
patch -p1 < $rootdir/0001-Make-sure-dl_iterate_phdr-is-undefined-on-Android.patch
patch -p1 < $rootdir/replace_pagesize_in_mmap.patch
# The additional Rust patch is not necessary for x86.
[% IF c("var/android-armv7") %]
patch -p1 < $rootdir/0001-Make-sure-dl_iterate_phdr-is-undefined-on-Android.patch
[% END %]
[% END %]
mkdir build
......
......@@ -15,15 +15,21 @@ var:
use_container: 1
targets:
android-armv7:
android:
var:
rust_arch: x86_64
arch_deps:
- libssl-dev
- pkg-config
- zlib1g-dev
android-armv7:
var:
configure_opt: --enable-local-rust --enable-vendor --enable-extended --release-channel=stable --sysconfdir=etc --target=armv7-linux-androideabi --set=target.armv7-linux-androideabi.cc=$ANDROID_NDK_HOME/arm/bin/arm-linux-androideabi-gcc
android-x86:
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
linux:
var:
arch_deps:
......@@ -92,7 +98,7 @@ input_files:
enable: '[% c("var/windows-i686") && !c("input_file_var/unwind_128") %]'
- filename: unwind_128.patch
enable: '[% c("input_file_var/unwind_128") %]'
- filename: 0001-Make-sure-dl_iterate_phdr-is-undefined-on-Android.patch
enable: '[% c("var/android") %]'
- filename: replace_pagesize_in_mmap.patch
enable: '[% c("var/android") %]'
- filename: 0001-Make-sure-dl_iterate_phdr-is-undefined-on-Android.patch
enable: '[% c("var/android-armv7") %]'
......@@ -41,7 +41,7 @@ targets:
windows-x86_64:
var:
mar_osname: win64
android-armv7:
android:
build: '[% INCLUDE build.android %]'
var:
arch_deps:
......
......@@ -159,11 +159,23 @@ targets:
torbrowser-android-armv7:
- android-armv7
- android
android-armv7:
arch: armv7
var:
android: 1
android-armv7: 1
osname: android-armv7
torbrowser-android-x86:
- android-x86
- android
android-x86:
arch: x86
var:
android-x86: 1
osname: android-x86
android:
var:
android: 1
compiler: android-toolchain
snowflake: 0
fteproxy: 0
......@@ -178,6 +190,7 @@ targets:
- libtool
- zip
- unzip
torbrowser-linux-x86_64:
- linux-x86_64
- linux
......
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