diff options
-rwxr-xr-x | tools/configure | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tools/configure b/tools/configure index c4d98f3f70..31445b792b 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -263,6 +263,14 @@ simcc () { | |||
263 | GCCOPTS=`echo $CCOPTS | sed -e s/-ffreestanding// -e s/-nostdlib// -e s/-Wundef//` | 263 | GCCOPTS=`echo $CCOPTS | sed -e s/-ffreestanding// -e s/-nostdlib// -e s/-Wundef//` |
264 | 264 | ||
265 | GCCOPTS="$GCCOPTS -fno-builtin -g" | 265 | GCCOPTS="$GCCOPTS -fno-builtin -g" |
266 | |||
267 | if [ "$ARG_ADDR_SAN" = "1" ] ; then | ||
268 | # Use AddressSanitizer! | ||
269 | echo "Using AddressSanitizer" | ||
270 | GCCOPTS="$GCCOPTS -fsanitize=address -fPIC" | ||
271 | LDOPTS="$LDOPTS -fsanitize=address -lasan" | ||
272 | fi | ||
273 | |||
266 | # Some linux setups like to warn about unused results. They are correct, | 274 | # Some linux setups like to warn about unused results. They are correct, |
267 | # but cleaning this up is a lot of work. | 275 | # but cleaning this up is a lot of work. |
268 | GCCOPTS="$GCCOPTS -Wno-unused-result" | 276 | GCCOPTS="$GCCOPTS -Wno-unused-result" |
@@ -468,6 +476,11 @@ EOF | |||
468 | # on cygwin | 476 | # on cygwin |
469 | rm -f $tmpdir/conftest-$id* | 477 | rm -f $tmpdir/conftest-$id* |
470 | 478 | ||
479 | # AddressSanitizer requires SDL threads | ||
480 | if [ "$ARG_ADDR_SAN" = "1" ] ; then | ||
481 | ARG_THREAD_SUPPORT=1 | ||
482 | fi | ||
483 | |||
471 | thread_support= | 484 | thread_support= |
472 | if [ -z "$ARG_THREAD_SUPPORT" ] || [ "$ARG_THREAD_SUPPORT" = "0" ]; then | 485 | if [ -z "$ARG_THREAD_SUPPORT" ] || [ "$ARG_THREAD_SUPPORT" = "0" ]; then |
473 | if [ "$sigaltstack" = "0" ]; then | 486 | if [ "$sigaltstack" = "0" ]; then |
@@ -1407,10 +1420,12 @@ help() { | |||
1407 | --no-thumb The opposite of --thumb (don't use thumb even for targets | 1420 | --no-thumb The opposite of --thumb (don't use thumb even for targets |
1408 | where this is the default | 1421 | where this is the default |
1409 | --sdl-threads Force use of SDL threads. They have inferior performance, | 1422 | --sdl-threads Force use of SDL threads. They have inferior performance, |
1410 | but are better debuggable with GDB | 1423 | but are better debuggable with GDB and valgrind |
1411 | --no-sdl-threads Disallow use of SDL threads. This prevents the default | 1424 | --no-sdl-threads Disallow use of SDL threads. This prevents the default |
1412 | behavior of falling back to them if no native thread | 1425 | behavior of falling back to them if no native thread |
1413 | support was found. | 1426 | support was found. |
1427 | --with-address-sanitizer | ||
1428 | Enasbles the AddressSanitizer feature. Forces SDL threads. | ||
1414 | --32-bit Force a 32-bit simulator (use with --sdl-threads for duke3d) | 1429 | --32-bit Force a 32-bit simulator (use with --sdl-threads for duke3d) |
1415 | --prefix Target installation directory | 1430 | --prefix Target installation directory |
1416 | --compiler-prefix Override compiler prefix (inherently dangerous) | 1431 | --compiler-prefix Override compiler prefix (inherently dangerous) |
@@ -1435,6 +1450,7 @@ ARG_ARM_THUMB= | |||
1435 | ARG_PREFIX="$PREFIX" | 1450 | ARG_PREFIX="$PREFIX" |
1436 | ARG_THREAD_SUPPORT= | 1451 | ARG_THREAD_SUPPORT= |
1437 | ARG_32BIT= | 1452 | ARG_32BIT= |
1453 | ARG_ADDR_SAN= | ||
1438 | err= | 1454 | err= |
1439 | for arg in "$@"; do | 1455 | for arg in "$@"; do |
1440 | case "$arg" in | 1456 | case "$arg" in |
@@ -1457,6 +1473,7 @@ for arg in "$@"; do | |||
1457 | --sdl-threads)ARG_THREAD_SUPPORT=1;; | 1473 | --sdl-threads)ARG_THREAD_SUPPORT=1;; |
1458 | --no-sdl-threads) | 1474 | --no-sdl-threads) |
1459 | ARG_THREAD_SUPPORT=0;; | 1475 | ARG_THREAD_SUPPORT=0;; |
1476 | --with-address-sanitizer) ARG_ADDR_SAN=1;; | ||
1460 | --prefix=*) ARG_PREFIX=`echo "$arg" | cut -d = -f 2`;; | 1477 | --prefix=*) ARG_PREFIX=`echo "$arg" | cut -d = -f 2`;; |
1461 | --compiler-prefix=*) ARG_COMPILER_PREFIX=`echo "$arg" | cut -d = -f 2`;; | 1478 | --compiler-prefix=*) ARG_COMPILER_PREFIX=`echo "$arg" | cut -d = -f 2`;; |
1462 | --help) help;; | 1479 | --help) help;; |
@@ -4741,6 +4758,8 @@ EOF | |||
4741 | if ! diff -q autoconf.h.new autoconf.h > /dev/null 2>&1 ; then | 4758 | if ! diff -q autoconf.h.new autoconf.h > /dev/null 2>&1 ; then |
4742 | mv autoconf.h.new autoconf.h | 4759 | mv autoconf.h.new autoconf.h |
4743 | echo "Created autoconf.h" | 4760 | echo "Created autoconf.h" |
4761 | else | ||
4762 | rm -f autoconf.h.new | ||
4744 | fi | 4763 | fi |
4745 | 4764 | ||
4746 | if test -n "$t_cpu"; then | 4765 | if test -n "$t_cpu"; then |