Unverified Commit 13fe20de authored by Georg Koppen's avatar Georg Koppen
Browse files

Bug 40002: Fix Linux ASan builds for ESR 78

We make the ASan build a first-class tor-browser-build citizen as well.
Additionally, we clean the .mozconfig file up so that we have a ASan
build without the `--enable-debug` and `--enable-test` options. This
makes it more usable for hunting memory corruption bugs. We can think
about separate debug builds that have all the assertions etc. enabled if
we find that part useful.
parent c87f7630
......@@ -62,7 +62,6 @@ tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
cd /var/tmp/build/[% project %]-[% c("version") %]
mv -f $rootdir/[% c('input_files_by_name/mozconfig') %] .mozconfig
[% IF c("var/asan") -%]
mv -f .mozconfig-asan .mozconfig
# Without disabling LSan our build is blowing up:
# https://bugs.torproject.org/10599#comment:52
export ASAN_OPTIONS="detect_leaks=0"
......
......@@ -117,7 +117,7 @@ input_files:
- name: '[% c("var/compiler") %]'
project: '[% c("var/compiler") %]'
- filename: get-moz-build-date
- filename: 'mozconfig-[% c("var/osname") %]'
- filename: 'mozconfig-[% c("var/osname") %][% IF c("var/asan") %]-asan[% END %]'
name: mozconfig
- project: binutils
name: binutils
......
. $topsrcdir/browser/config/mozconfig
export CFLAGS="-fsanitize=address -Dxmalloc=myxmalloc"
export CXXFLAGS="-fsanitize=address -Dxmalloc=myxmalloc"
# We need to add -ldl explicitely due to bug 1213698
export LDFLAGS="-fsanitize=address -ldl"
# Define HOST_CFLAGS, etc. to avoid compiling programs such as mbsdiff
# (which is part of mar-tools and is not distributed to end-users) with
# ASan. See bug 17858.
export HOST_CFLAGS=""
export HOST_CXXFLAGS=""
export HOST_LDFLAGS="-ldl"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser"
export MOZILLA_OFFICIAL=1
export BINDGEN_CFLAGS='--gcc-toolchain=/var/tmp/dist/gcc'
ac_add_options --enable-address-sanitizer
ac_add_options --disable-jemalloc
ac_add_options --disable-elf-hack
ac_add_options --with-clang-path=/var/tmp/dist/clang/bin/clang
ac_add_options --enable-optimize
ac_add_options --enable-official-branding
# Let's support GTK3 for ESR60
ac_add_options --enable-default-toolkit=cairo-gtk3
ac_add_options --enable-tor-browser-update
ac_add_options --enable-verify-mar
ac_add_options --disable-strip
ac_add_options --disable-install-strip
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-crashreporter
ac_add_options --disable-webrtc
ac_add_options --disable-parental-controls
ac_add_options --disable-eme
ac_add_options --enable-proxy-bypass-protection
# Disable telemetry
ac_add_options MOZ_TELEMETRY_REPORTING=
......@@ -383,6 +383,10 @@ targets:
linux-debug:
var:
asan: 1
# RLBox needs clang to create .wasm files but we use mostly GCC for our
# ASan builds. Thus, the compilation currently breaks with RLBox enabled.
# See: tor-browser-build#40063.
rlbox: 0
torbrowser-windows-i686:
- windows-i686
......
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