-
Notifications
You must be signed in to change notification settings - Fork 1
/
runci.sh
executable file
·35 lines (30 loc) · 1.12 KB
/
runci.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
set -euo pipefail
# Check where tcl/tk include files are.
# Enabled on ASAN builds, disabled on others, so we spot build
# errors for both cases.
TCLTK=""
if [ -f "/usr/include/tk.h" ] && [ -f "/usr/include/tcl.h" ]; then
TCLTK="--enable-tcl=/usr/include/ --enable-tk=/usr/include"
elif [ -f "/usr/include/tk/tk.h" ] && [ -f "/usr/include/tcl/tcl.h" ]; then
TCLTK="--enable-tcl=/usr/include/tcl/ --enable-tk=/usr/include/tk/"
fi
autoreconf -i
# Test with ASAN / Address Sanitizer
export ASAN_OPTIONS="abort_on_error=1"
./configure $TCLTK CFLAGS="-fsanitize=address -U_FORTIFY_SOURCE" LDFLAGS="-fsanitize=address -U_FORTIFY_SOURCE"
make clean
make
make check
# Test with clang and MSAN / Memory Sanitizer
export MSAN_OPTIONS="abort_on_error=1"
./configure CC=clang LD=clang CFLAGS="-fsanitize=memory -U_FORTIFY_SOURCE" LDFLAGS="-fsanitize=memory -U_FORTIFY_SOURCE"
make clean
make
make check
# Test with clang and UBSAN / Undefined Behavior Sanitizer
export UBSAN_OPTIONS="halt_on_error=1:abort_on_error=1"
./configure CC=clang LD=clang CFLAGS="-fsanitize=undefined" LDFLAGS="-fsanitize=undefined"
make clean
make
make check