diff options
-rwxr-xr-x | tools/configure | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/configure b/tools/configure index ac657e38c9..12b45bf890 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -270,6 +270,12 @@ simcc () { | |||
270 | LDOPTS="$LDOPTS -fsanitize=address -lasan" | 270 | LDOPTS="$LDOPTS -fsanitize=address -lasan" |
271 | fi | 271 | fi |
272 | 272 | ||
273 | if [ "$ARG_UBSAN" = "1" ] ; then | ||
274 | echo "Using UBSan" | ||
275 | GCCOPTS="$GCCOPTS -fsanitize=undefined -fPIC" | ||
276 | LDOPTS="$LDOPTS -fsanitize=undefined" | ||
277 | fi | ||
278 | |||
273 | # Some linux setups like to warn about unused results. They are correct, | 279 | # Some linux setups like to warn about unused results. They are correct, |
274 | # but cleaning this up is a lot of work. | 280 | # but cleaning this up is a lot of work. |
275 | GCCOPTS="$GCCOPTS -Wno-unused-result" | 281 | GCCOPTS="$GCCOPTS -Wno-unused-result" |
@@ -479,6 +485,9 @@ EOF | |||
479 | if [ "$ARG_ADDR_SAN" = "1" ] ; then | 485 | if [ "$ARG_ADDR_SAN" = "1" ] ; then |
480 | ARG_THREAD_SUPPORT=1 | 486 | ARG_THREAD_SUPPORT=1 |
481 | fi | 487 | fi |
488 | if [ "$ARG_UBSAN" = "1" ] ; then | ||
489 | ARG_THREAD_SUPPORT=1 | ||
490 | fi | ||
482 | 491 | ||
483 | thread_support= | 492 | thread_support= |
484 | if [ -z "$ARG_THREAD_SUPPORT" ] || [ "$ARG_THREAD_SUPPORT" = "0" ]; then | 493 | if [ -z "$ARG_THREAD_SUPPORT" ] || [ "$ARG_THREAD_SUPPORT" = "0" ]; then |
@@ -1429,6 +1438,7 @@ ARG_PREFIX="$PREFIX" | |||
1429 | ARG_THREAD_SUPPORT= | 1438 | ARG_THREAD_SUPPORT= |
1430 | ARG_32BIT= | 1439 | ARG_32BIT= |
1431 | ARG_ADDR_SAN= | 1440 | ARG_ADDR_SAN= |
1441 | ARG_UBSAN= | ||
1432 | err= | 1442 | err= |
1433 | for arg in "$@"; do | 1443 | for arg in "$@"; do |
1434 | case "$arg" in | 1444 | case "$arg" in |
@@ -1452,6 +1462,7 @@ for arg in "$@"; do | |||
1452 | --no-sdl-threads) | 1462 | --no-sdl-threads) |
1453 | ARG_THREAD_SUPPORT=0;; | 1463 | ARG_THREAD_SUPPORT=0;; |
1454 | --with-address-sanitizer) ARG_ADDR_SAN=1;; | 1464 | --with-address-sanitizer) ARG_ADDR_SAN=1;; |
1465 | --with-ubsan) ARG_UBSAN=1;; | ||
1455 | --prefix=*) ARG_PREFIX=`echo "$arg" | cut -d = -f 2`;; | 1466 | --prefix=*) ARG_PREFIX=`echo "$arg" | cut -d = -f 2`;; |
1456 | --compiler-prefix=*) ARG_COMPILER_PREFIX=`echo "$arg" | cut -d = -f 2`;; | 1467 | --compiler-prefix=*) ARG_COMPILER_PREFIX=`echo "$arg" | cut -d = -f 2`;; |
1457 | --help) help;; | 1468 | --help) help;; |