Skip to content

Commit

Permalink
chore(*) include fsanitize option in build hash
Browse files Browse the repository at this point in the history
Also rename the asan.ignore file for consistency with Valgrind/LSAN
files. Do not include it in builds when using the standalone
`-fsanitize=leak` mode.
  • Loading branch information
thibaultcha committed Oct 10, 2024
1 parent e7d2577 commit b7a4491
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
File renamed without changes.
12 changes: 9 additions & 3 deletions util/_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,21 @@ build_nginx() {
fi

if [[ -n "$NGX_BUILD_FSANITIZE" ]]; then
local suppressions="$NGX_WASM_DIR/asan.suppress"
if [[ "$NGX_BUILD_FSANITIZE" == "leak" ]]; then
suppressions="$NGX_WASM_DIR/lsan.suppress"
fi

build_name_opts+=("san:$NGX_BUILD_FSANITIZE")
NGX_BUILD_CC_OPT="$NGX_BUILD_CC_OPT -g \
-fsanitize=$NGX_BUILD_FSANITIZE \
-fsanitize-blacklist=$NGX_WASM_DIR/asan.ignore \
-fsanitize-blacklist=$suppressions \
-Wno-unused-command-line-argument \
-fno-omit-frame-pointer"
NGX_BUILD_LD_OPT="$NGX_BUILD_LD_OPT \
-fsanitize=$NGX_BUILD_FSANITIZE \
-ldl -lm -lpthread -lrt"
# clang 13: -fsanitize-ignorelist=$NGX_WASM_DIR/asan.ignore
# clang 13: -fsanitize-ignorelist=$NGX_WASM_DIR/asan.suppress
fi

if [[ "$NGX_BUILD_GCOV" == 1 ]]; then
Expand Down Expand Up @@ -303,6 +308,7 @@ build_nginx() {
ipc=$NGX_IPC.\
dynamic=$NGX_BUILD_DYNAMIC_MODULE.\
cargo=$NGX_WASM_CARGO.\
fsanitize=$NGX_BUILD_FSANITIZE.\
hash_src=$hash_src"

local hash_opt=$(echo $hash_opt_txt | shasum | awk '{ print $1 }')
Expand Down Expand Up @@ -377,7 +383,7 @@ build_nginx() {
|| "$NGX_WASM_DIR/Makefile" -nt "Makefile" \
|| "$NGX_WASM_DIR/util/build.sh" -nt "Makefile" \
|| "$NGX_WASM_DIR/util/_lib.sh" -nt "Makefile" \
|| "$NGX_WASM_DIR/asan.ignore" -nt "Makefile" \
|| "$NGX_WASM_DIR/asan.suppress" -nt "Makefile" \
|| "$NGX_WASM_DIR/lsan.suppress" -nt "Makefile" ]];
then
local configure="configure"
Expand Down

0 comments on commit b7a4491

Please sign in to comment.