boklm pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits: 3a0f6937 by NoisyCoil at 2024-11-21T11:04:34+01:00 Bug 41266: Add the linux-aarch64 target to Firefox
- - - - - 2def046d by NoisyCoil at 2024-11-21T11:04:40+01:00 Bug 41266: Do not require SSE2 support on non-x86 targets in start-browser
- - - - - 32a0ef3c by NoisyCoil at 2024-11-21T11:04:42+01:00 Bug 41266: Add the linux-aarch64 target to release and Makefile
- - - - - 860ce1a5 by NoisyCoil at 2024-11-21T11:04:43+01:00 Bug 41266: Add linux-aarch64 to browser-all{,-desktop} if testbuild or nightly
Also, add a 'browser-all-target' target to make this possible.
Co-authored-by: Nicolas Vigier <boklm@torproject.org>
- - - - -
7 changed files:
- Makefile - projects/browser/RelativeLink/start-browser - projects/firefox/build - projects/firefox/config - projects/firefox/mozconfig - projects/release/build - projects/release/config
Changes:
===================================== Makefile ===================================== @@ -36,6 +36,9 @@ torbrowser-release-linux-x86_64-asan: submodule-update torbrowser-release-linux-i686: submodule-update $(rbm) build release --target release --target browser-linux-i686 --target torbrowser
+torbrowser-release-linux-aarch64: submodule-update + $(rbm) build release --target release --target browser-linux-aarch64 --target torbrowser + torbrowser-release-windows-i686: submodule-update $(rbm) build release --target release --target browser-windows-i686 --target torbrowser
@@ -75,6 +78,9 @@ torbrowser-alpha-linux-x86_64: submodule-update torbrowser-alpha-linux-x86_64-asan: submodule-update $(rbm) build release --target alpha --target browser-linux-x86_64-asan --target torbrowser
+torbrowser-alpha-linux-aarch64: submodule-update + $(rbm) build release --target alpha --target browser-linux-aarch64 --target torbrowser + torbrowser-alpha-linux-i686: submodule-update $(rbm) build release --target alpha --target browser-linux-i686 --target torbrowser
@@ -117,6 +123,9 @@ torbrowser-nightly-linux-x86_64: submodule-update torbrowser-nightly-linux-x86_64-asan: submodule-update $(rbm) build release --target nightly --target browser-linux-x86_64-asan --target torbrowser
+torbrowser-nightly-linux-aarch64: submodule-update + $(rbm) build release --target nightly --target browser-linux-aarch64 --target torbrowser + torbrowser-nightly-linux-i686: submodule-update $(rbm) build release --target nightly --target browser-linux-i686 --target torbrowser
@@ -162,6 +171,9 @@ torbrowser-testbuild-linux-x86_64-asan: submodule-update torbrowser-testbuild-linux-i686: submodule-update $(rbm) build release --target testbuild --target browser-linux-i686 --target torbrowser
+torbrowser-testbuild-linux-aarch64: submodule-update + $(rbm) build release --target testbuild --target browser-linux-aarch64 --target torbrowser + torbrowser-testbuild-windows-x86_64: submodule-update $(rbm) build release --target testbuild --target browser-windows-x86_64 --target torbrowser
@@ -274,6 +286,9 @@ basebrowser-release-linux-x86_64-asan: submodule-update basebrowser-release-linux-i686: submodule-update $(rbm) build release --target release --target browser-linux-i686 --target basebrowser
+basebrowser-release-linux-aarch64: submodule-update + $(rbm) build release --target release --target browser-linux-aarch64 --target basebrowser + basebrowser-release-windows-i686: submodule-update $(rbm) build release --target release --target browser-windows-i686 --target basebrowser
@@ -316,6 +331,9 @@ basebrowser-alpha-linux-x86_64-asan: submodule-update basebrowser-alpha-linux-i686: submodule-update $(rbm) build release --target alpha --target browser-linux-i686 --target basebrowser
+basebrowser-alpha-linux-aarch64: submodule-update + $(rbm) build release --target alpha --target browser-linux-aarch64 --target basebrowser + basebrowser-alpha-windows-i686: submodule-update $(rbm) build release --target alpha --target browser-windows-i686 --target basebrowser
@@ -358,6 +376,9 @@ basebrowser-nightly-linux-x86_64-asan: submodule-update basebrowser-nightly-linux-i686: submodule-update $(rbm) build release --target nightly --target browser-linux-i686 --target basebrowser
+basebrowser-nightly-linux-aarch64: submodule-update + $(rbm) build release --target nightly --target browser-linux-aarch64 --target basebrowser + basebrowser-nightly-windows-i686: submodule-update $(rbm) build release --target nightly --target browser-windows-i686 --target basebrowser
@@ -400,6 +421,9 @@ basebrowser-testbuild-linux-x86_64-asan: submodule-update basebrowser-testbuild-linux-i686: submodule-update $(rbm) build release --target testbuild --target browser-linux-i686 --target basebrowser
+basebrowser-testbuild-linux-aarch64: submodule-update + $(rbm) build release --target testbuild --target browser-linux-aarch64 --target basebrowser + basebrowser-testbuild-windows-x86_64: submodule-update $(rbm) build release --target testbuild --target browser-windows-x86_64 --target basebrowser
@@ -440,6 +464,9 @@ mullvadbrowser-release-linux-x86_64: submodule-update mullvadbrowser-release-linux-x86_64-asan: submodule-update $(rbm) build release --target release --target browser-linux-x86_64-asan --target mullvadbrowser
+mullvadbrowser-release-linux-aarch64: submodule-update + $(rbm) build release --target release --target browser-linux-aarch64 --target mullvadbrowser + mullvadbrowser-release-windows-x86_64: submodule-update $(rbm) build release --target release --target browser-windows-x86_64 --target mullvadbrowser
@@ -461,6 +488,9 @@ mullvadbrowser-alpha-linux-x86_64: submodule-update mullvadbrowser-alpha-linux-x86_64-asan: submodule-update $(rbm) build release --target alpha --target browser-linux-x86_64-asan --target mullvadbrowser
+mullvadbrowser-alpha-linux-aarch64: submodule-update + $(rbm) build release --target alpha --target browser-linux-aarch64 --target mullvadbrowser + mullvadbrowser-alpha-windows-x86_64: submodule-update $(rbm) build release --target alpha --target browser-windows-x86_64 --target mullvadbrowser
@@ -482,6 +512,9 @@ mullvadbrowser-nightly-linux-x86_64: submodule-update mullvadbrowser-nightly-linux-x86_64-asan: submodule-update $(rbm) build release --target nightly --target browser-linux-x86_64-asan --target mullvadbrowser
+mullvadbrowser-nightly-linux-aarch64: submodule-update + $(rbm) build release --target nightly --target browser-linux-aarch64 --target mullvadbrowser + mullvadbrowser-nightly-windows-x86_64: submodule-update $(rbm) build release --target nightly --target browser-windows-x86_64 --target mullvadbrowser
@@ -503,6 +536,9 @@ mullvadbrowser-testbuild-linux-x86_64: submodule-update mullvadbrowser-testbuild-linux-x86_64-asan: submodule-update $(rbm) build release --target testbuild --target browser-linux-x86_64-asan --target mullvadbrowser
+mullvadbrowser-testbuild-linux-aarch64: submodule-update + $(rbm) build release --target testbuild --target browser-linux-aarch64 --target mullvadbrowser + mullvadbrowser-testbuild-windows-x86_64: submodule-update $(rbm) build release --target testbuild --target browser-windows-x86_64 --target mullvadbrowser
===================================== projects/browser/RelativeLink/start-browser ===================================== @@ -87,10 +87,12 @@ if [ "`id -u`" -eq 0 ]; then exit 1 fi
+[% IF c('var/linux-i686') || c('var/linux-x86_64') -%] if test -r /proc/cpuinfo && ! grep -q '^flags\s*:.* sse2' /proc/cpuinfo; then complain "[% c('var/Project_Name') %] requires a CPU with SSE2 support. Exiting." exit 1 fi +[% END -%]
print_usage () { printf "\n[% c('var/Project_Name') %] Script Options\n"
===================================== projects/firefox/build ===================================== @@ -20,16 +20,21 @@ mkdir -p [% out_dir %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/rust') %] tar -C /var/tmp/dist -xf [% c('input_files_by_name/cbindgen') %] -tar -C /var/tmp/dist -xf [% c('input_files_by_name/nasm') %] tar -C /var/tmp/dist -xf [% c('input_files_by_name/node') %] -export PATH="/var/tmp/dist/rust/bin:/var/tmp/dist/cbindgen:/var/tmp/dist/nasm/bin:/var/tmp/dist/node/bin:$PATH" +[% IF ! c("var/linux-aarch64") -%] + tar -C /var/tmp/dist -xf [% c('input_files_by_name/nasm') %] + export PATH="/var/tmp/dist/nasm/bin:$PATH" +[% END -%] +export PATH="/var/tmp/dist/rust/bin:/var/tmp/dist/cbindgen:/var/tmp/dist/node/bin:$PATH"
[% IF c("var/linux") -%] tar -C /var/tmp/dist -xf [% c('input_files_by_name/clang') %] tar -C /var/tmp/dist -xf [% c('input_files_by_name/python') %] export PATH="/var/tmp/dist/python/bin:$PATH" - tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %] - export PATH="/var/tmp/dist/binutils/bin:$PATH" + [% IF ! c("var/linux-cross") -%] + tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %] + export PATH="/var/tmp/dist/binutils/bin:$PATH" + [% END -%] # Use clang for everything on Linux now if we don't build with ASan. [% IF ! c("var/asan") -%] export PATH="/var/tmp/dist/clang/bin:$PATH" @@ -39,6 +44,8 @@ export PATH="/var/tmp/dist/rust/bin:/var/tmp/dist/cbindgen:/var/tmp/dist/nasm/bi # breakage in Rust code. It seems that environment variable is not passed # down properly in that case. Thus, we set it here in the build script. export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/lib/i386-linux-gnu/pkgconfig" + [% ELSIF c("var/linux-cross") -%] + export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/lib/[% c("var/crosstarget") %]/pkgconfig" [% END -%] [% END -%]
@@ -296,14 +303,21 @@ cp -L obj-*/dist/bin/geckodriver* $distdir cd $distdir
[% IF c("var/linux") -%] + [% IF c("var/linux-cross") -%] + CROSS_PREFIX=[% c("var/crosstarget") %]- + [% END -%] + + OBJCOPY="${CROSS_PREFIX}objcopy" + STRIP="${CROSS_PREFIX}strip" + mkdir -p $distdir/Debug/Browser # Strip and generate debuginfo for the firefox binary that we keep, all *.so # files, and the updater (see ticket #10126) for LIB in Browser/*.so "Browser/[% c('var/exe_name') %].real" [% IF c("var/updater_enabled") -%]Browser/updater[% END %] do - objcopy --only-keep-debug $LIB Debug/$LIB - strip $LIB - objcopy --add-gnu-debuglink=./Debug/$LIB $LIB + "$OBJCOPY" --only-keep-debug $LIB Debug/$LIB + "$STRIP" $LIB + "$OBJCOPY" --add-gnu-debuglink=./Debug/$LIB $LIB done [% END -%]
@@ -328,15 +342,19 @@ END; %]
[% IF c("var/linux") -%] - /var/tmp/dist/gcc/bin/g++ $rootdir/abicheck.cc -o Browser/abicheck -std=c++17 + /var/tmp/dist/gcc/bin/"${CROSS_PREFIX}g++" $rootdir/abicheck.cc -o Browser/abicheck -std=c++17 [% IF !c("var/tor-browser") -%] libdest=Browser/libstdc++ mkdir -p "$libdest" + libdir=[% c("var/libdir") %] + [% IF c("var/linux-cross") -%] + libdir="[% c("var/crosstarget") %]/$libdir" + [% END -%] # FIXME: tor-browser-build#40749 - cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libstdc++.so.* "$libdest" + cp "/var/tmp/dist/gcc/$libdir/libstdc++.so."* "$libdest" [% IF c("var/asan") -%] - cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libasan.so.* "$libdest" - cp /var/tmp/dist/gcc/[% c("var/libdir") %]/libubsan.so.* "$libdest" + cp "/var/tmp/dist/gcc/$libdir/libasan.so."* "$libdest" + cp "/var/tmp/dist/gcc/$libdir/libubsan.so."* "$libdest" [% END -%] [% END -%] [% END -%]
===================================== projects/firefox/config ===================================== @@ -143,6 +143,23 @@ targets: - libdrm-dev:i386 libdir: lib32
+ linux-aarch64: + var: + arch_deps: + - libgtk2.0-dev:arm64 + - libgtk-3-dev:arm64 + - libdbus-glib-1-dev:arm64 + - libxt-dev:arm64 + # To pass configure since ESR 31 + - libpulse-dev:arm64 + # To pass configure since ESR 52 + - libx11-xcb-dev:arm64 + # To pass configure since ESR 102 + - libasound2-dev:arm64 + # To support Wayland mode + - libdrm-dev:arm64 + libdir: lib64 + macos: var: nightly_updates_publish_dir: '[% c("var/nightly_updates_publish_dir_prefix") %]nightly-macos' @@ -162,9 +179,10 @@ input_files: - project: container-image - name: '[% c("var/compiler") %]' project: '[% c("var/compiler") %]' + # Cross-binutils are already included in the cross-compiler - project: binutils name: binutils - enable: '[% c("var/linux") %]' + enable: '[% c("var/linux") && ! c("var/linux-cross") %]' - filename: fix-info-plist.py enable: '[% c("var/macos") %]' - filename: nsis-uninstall.patch @@ -183,6 +201,7 @@ input_files: name: node - project: nasm name: nasm + enable: '[% ! c("var/linux-aarch64") %]' - project: python name: python enable: '[% c("var/linux") %]'
===================================== projects/firefox/mozconfig ===================================== @@ -13,6 +13,10 @@
# set LDFLAGS for Full RELRO export LDFLAGS="-Wl,-z,relro -Wl,-z,now" + + [% IF c("var/linux-cross") -%] + export LDFLAGS="-L/var/tmp/dist/gcc/[% c("var/crosstarget") %]/lib $LDFLAGS" + [% END -%] [% END -%]
[% IF c("var/windows") -%]
===================================== projects/release/build ===================================== @@ -37,6 +37,9 @@ mkdir -p "$destdir" [% IF c("var/browser-linux-x86_64") -%] mv [% c('input_files_by_name/linux-x86_64') %]/* "$destdir"/ [% END -%] +[% IF c("var/browser-linux-aarch64") -%] + mv [% c('input_files_by_name/linux-aarch64') %]/* "$destdir"/ +[% END -%] [% IF c("var/linux-packages") -%] mv [% c('input_files_by_name/deb-packages') %]/* "$destdir"/ mv [% c('input_files_by_name/rpm-packages') %]/* "$destdir"/
===================================== projects/release/config ===================================== @@ -12,6 +12,7 @@ targets: browser-all: - browser-linux-x86_64 - browser-linux-i686 + - browser-linux-aarch64 - browser-windows-i686 - browser-windows-x86_64 - browser-macos @@ -20,13 +21,16 @@ targets: - browser-android-x86_64 - browser-android-aarch64 - browser-src + - browser-all-target browser-all-desktop: - browser-linux-x86_64 - browser-linux-i686 + - browser-linux-aarch64 - browser-windows-i686 - browser-windows-x86_64 - browser-macos - browser-src + - browser-all-target browser-all-android: - browser-android-armv7 - browser-android-x86 @@ -56,6 +60,10 @@ targets: var: browser-linux-i686: '[% c("var/browser_type") != "mullvadbrowser" %]' linux-packages: '[% c("var/mullvad-browser") || c("var/tor-browser-linux-packages") %]' + browser-linux-aarch64: + var: + browser-linux-aarch64: '[% ! c("var/browser-all-target") || c("var/testbuild") || c("var/nightly") %]' + linux-packages: 0 browser-windows-i686: var: browser-windows-i686: '[% c("var/browser_type") != "mullvadbrowser" %]' @@ -77,6 +85,9 @@ targets: browser-src-testbuild: var: browser-src: 1 + browser-all-target: + var: + browser-all-target: 1
notarget: - torbrowser @@ -189,6 +200,13 @@ input_files: - '[% c("var/build_target") %]' - '[% c("var/browser_type") %]-linux-i686'
+ - name: linux-aarch64 + project: browser + enable: '[% c("var/browser-linux-aarch64") %]' + target: + - '[% c("var/build_target") %]' + - '[% c("var/browser_type") %]-linux-aarch64' + - name: deb-packages project: linux-packages enable: '[% c("var/linux-packages") %]'
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/compare/4...