commit f04dcb80e361dc63b0ea5f78f36d32e7c5a980c9
parent fd2a1341627c4eaf048613474d4f8e97477f6d09
Author: Jared Tobin <jared@jtobin.io>
Date: Sun, 11 Jan 2026 18:15:07 +0400
meta: add sanitize flag for asan, ubsan
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/ppad-sha512.cabal b/ppad-sha512.cabal
@@ -19,6 +19,11 @@ flag llvm
default: False
manual: True
+flag sanitize
+ description: Build with AddressSanitizer and UndefinedBehaviorSanitizer.
+ default: False
+ manual: True
+
source-repository head
type: git
location: git.ppad.tech/sha512.git
@@ -42,6 +47,9 @@ library
cbits/sha512_arm.c
if arch(aarch64)
cc-options: -march=armv8.2-a+sha3
+ if flag(sanitize)
+ cc-options: -fsanitize=address,undefined -fno-omit-frame-pointer
+ ghc-options: -optl=-fsanitize=address,undefined
test-suite sha512-tests
type: exitcode-stdio-1.0
@@ -54,6 +62,8 @@ test-suite sha512-tests
ghc-options:
-rtsopts -Wall -O2
+ if flag(sanitize)
+ ghc-options: -optl=-fsanitize=address,undefined
build-depends:
aeson