diff --git a/.travis.yml b/.travis.yml index 909d62a2c4..c15a2a4e58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,6 +38,10 @@ jobs: compiler: gcc env: wxCONFIGURE_FLAGS="--disable-compat30 --disable-optimise --disable-unicode" wxSKIP_SAMPLES=1 name: wxGTK ANSI Ubuntu 20.04 + - dist: focal + compiler: gcc + env: wxCONFIGURE_FLAGS="--disable-compat30 --disable-sys-libs" wxSKIP_SAMPLES=1 wxUSE_ASAN=1 + name: wxGTK Ubuntu 20.04 with ASAN - os: osx osx_image: xcode7.3 compiler: clang diff --git a/build/tools/before_install.sh b/build/tools/before_install.sh index 8ad9fc453d..c385a64d7e 100755 --- a/build/tools/before_install.sh +++ b/build/tools/before_install.sh @@ -42,6 +42,24 @@ case $(uname -s) in done $SUDO apt-get install -y $libtoolkit_dev $pkg_install + + if [ "$wxUSE_ASAN" = 1 ]; then + codename=$(lsb_release --codename --short) + # Enable the `-dbgsym` repositories. + echo "deb http://ddebs.ubuntu.com ${codename} main restricted universe multiverse + deb http://ddebs.ubuntu.com ${codename}-updates main restricted universe multiverse + deb http://ddebs.ubuntu.com ${codename}-proposed main restricted universe multiverse" | \ + $SUDO tee --append /etc/apt/sources.list.d/ddebs.list + + # Import the debug symbol archive signing key from the Ubuntu server. + # Note that this command works only on Ubuntu 18.04 LTS and newer. + $SUDO apt-get install -y ubuntu-dbgsym-keyring + + $SUDO apt-get update + + # Install the symbols to allow LSAN suppression list to work. + $SUDO apt-get install -y libfontconfig1-dbgsym + fi fi ;; diff --git a/build/tools/travis-ci.sh b/build/tools/travis-ci.sh index 04861afcc8..ac03343254 100755 --- a/build/tools/travis-ci.sh +++ b/build/tools/travis-ci.sh @@ -21,6 +21,11 @@ case $wxTOOLSET in fi cmake --version + if [ "$wxUSE_ASAN" = 1 ]; then + echo "ASAN currently isn't supported in CMake builds" + exit 1 + fi + echo 'travis_fold:start:configure' echo 'Configuring...' mkdir build_cmake @@ -61,7 +66,20 @@ case $wxTOOLSET in *) echo 'travis_fold:start:configure' echo 'Configuring...' - ./configure --disable-optimise --disable-debug_info $wxCONFIGURE_FLAGS || rc=$? + + wxCONFIGURE_OPTIONS="--disable-optimise $wxCONFIGURE_FLAGS" + if [ "$wxUSE_ASAN" = 1 ]; then + export LSAN_OPTIONS=suppressions=$(pwd)/misc/suppressions/lsan + + wxASAN_CFLAGS="-fsanitize=address -fno-omit-frame-pointer" + wxASAN_CXXFLAGS=$wxASAN_CFLAGS + wxASAN_LDFLAGS="-fsanitize=address" + + ./configure $wxCONFIGURE_OPTIONS --enable-debug "CFLAGS=$wxASAN_CFLAGS" "CXXFLAGS=$wxASAN_CXXFLAGS" "LDFLAGS=$wxASAN_LDFLAGS" || rc=$? + else + ./configure $wxCONFIGURE_OPTIONS --disable-debug_info || rc=$? + fi + if [ -n "$rc" ]; then echo '*** Configuring failed, contents of config.log follows: ***' echo '-----------------------------------------------------------'