commit 3710c8d144c461b5842c9f207b33d506b8a05083
parent 916595b21319ca270ce8beb9c742bf7e632cccc9
Author: Jared Tobin <jared@jtobin.io>
Date: Sun, 11 Jan 2026 18:14:27 +0400
meta: add sanitize flag for asan, ubsan
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/ppad-sha256.cabal b/ppad-sha256.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/sha256.git
@@ -42,6 +47,9 @@ library
cbits/sha256_arm.c
if arch(aarch64)
cc-options: -march=armv8-a+sha2
+ if flag(sanitize)
+ cc-options: -fsanitize=address,undefined -fno-omit-frame-pointer
+ ghc-options: -optl=-fsanitize=address,undefined
test-suite sha256-tests
type: exitcode-stdio-1.0
@@ -54,6 +62,8 @@ test-suite sha256-tests
ghc-options:
-rtsopts -Wall -O2
+ if flag(sanitize)
+ ghc-options: -optl=-fsanitize=address,undefined
build-depends:
aeson