Skip to content

Commit

Permalink
Disable ASAN for release builds as per request in issue #402
Browse files Browse the repository at this point in the history
  • Loading branch information
mkroman authored and mfinelli committed Apr 19, 2016
1 parent 8af434c commit 1b413a2
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .SRCINFO
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generated by mksrcinfo v8
# Tue Feb 16 13:06:01 UTC 2016
# Mon Apr 18 16:42:14 UTC 2016
pkgbase = ricochet
pkgdesc = Anonymous peer-to-peer instant messaging.
pkgver = 1.1.2
Expand All @@ -17,8 +17,10 @@ pkgbase = ricochet
depends = openssl
depends = protobuf
depends = qt5-multimedia
source = disable-ASAN-by-default-for-release-builds.patch
source = https://ricochet.im/releases/1.1.2/ricochet-1.1.2-src.tar.bz2
source = https://ricochet.im/releases/1.1.2/ricochet-1.1.2-src.tar.bz2.asc
sha256sums = ed72e9b2a2d22861c00edb9effdab1e15150137a7e70767a9fbd580b28d0a99c
sha256sums = 97c78d088892e84c95a3e3a4a982883d8e44028848a513a5d7e0231d36325cc3
sha256sums = SKIP

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
!.gitignore
!PKGBUILD
!.SRCINFO
!disable-ASAN-by-default-for-release-builds.patch
8 changes: 6 additions & 2 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ url="https://ricochet.im/"
license=('custom')
depends=('tor' 'qt5-quick1' 'qt5-quickcontrols' 'qt5-declarative' 'openssl' 'protobuf' 'qt5-multimedia')
makedepends=('qt5-tools' 'pkg-config')
source=(https://ricochet.im/releases/$pkgver/$pkgname-$pkgver-src.tar.bz2{,.asc})
sha256sums=('97c78d088892e84c95a3e3a4a982883d8e44028848a513a5d7e0231d36325cc3'
source=('disable-ASAN-by-default-for-release-builds.patch'
https://ricochet.im/releases/$pkgver/$pkgname-$pkgver-src.tar.bz2{,.asc})

sha256sums=('ed72e9b2a2d22861c00edb9effdab1e15150137a7e70767a9fbd580b28d0a99c'
'97c78d088892e84c95a3e3a4a982883d8e44028848a513a5d7e0231d36325cc3'
'SKIP')
validpgpkeys=('9032CAE4CBFA933A5A2145D5FF97C53F183C045D')

build() {
cd "$srcdir"/$pkgname-$pkgver
patch -p1 < "${srcdir}/disable-ASAN-by-default-for-release-builds.patch"
QT_SELECT=5 qmake CONFIG+=release DEFINES+=RICOCHET_NO_PORTABLE
make
}
Expand Down
31 changes: 31 additions & 0 deletions disable-ASAN-by-default-for-release-builds.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 3031a5607a1659cd38e876004007e1a56ace50f8 Mon Sep 17 00:00:00 2001
From: Jacob Appelbaum <[email protected]>
Date: Mon, 21 Mar 2016 13:33:07 +0000
Subject: [PATCH] disable ASAN by default for release builds

---
hardened.pri | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hardened.pri b/hardened.pri
index 1b6c3b0..1bd3aaf 100644
--- a/hardened.pri
+++ b/hardened.pri
@@ -15,12 +15,13 @@ HARDENED_STACK_PROTECTOR_FLAGS = -fstack-protector --param=ssp-buffer-size=4

HARDENED_MINGW_64ASLR_FLAGS = -Wl,--dynamicbase -Wl,--high-entropy-va

+
# Run tests and apply options where possible
CONFIG(hardened) {
# mingw is always PIC, and complains about the flag
!mingw:HARDEN_FLAGS = -fPIC

- qtCompileTest(sanitize):HARDEN_FLAGS += $$HARDENED_SANITIZE_FLAGS
+ CONFIG(debug,debug|release): qtCompileTest(sanitize):HARDEN_FLAGS += $$HARDENED_SANITIZE_FLAGS
qtCompileTest(sanitize-ubsan):HARDEN_FLAGS += $$HARDENED_SANITIZE_UBSAN_FLAGS
qtCompileTest(sanitize-ubsan-more):HARDEN_FLAGS += $$HARDENED_SANITIZE_UBSAN_MORE_FLAGS
qtCompileTest(vtable-verify):HARDEN_FLAGS += $$HARDENED_VTABLE_VERIFY_FLAGS
--
2.8.0

0 comments on commit 1b413a2

Please sign in to comment.