gcc9_sanitize_tests.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/usr/bin/env bash
  2. export CC=gcc-9
  3. export CXX=g++-9
  4. if [ "$NEWCC" != "" ]; then
  5. export CC="$NEWCC"
  6. fi
  7. if [ "$NEWCXX" != "" ]; then
  8. export CXX="$NEWCXX"
  9. fi
  10. export LOGFILE=gcc9.log
  11. source ./tools/ci/scripts/init.sh
  12. export CXXFLAGS="$CXXFLAGS -pedantic -ggdb3 -O2 -Wstrict-aliasing=2 \
  13. -D_GLIBCXX_SANITIZE_VECTOR \
  14. -Wstrict-overflow=1 -Wformat=1 -D_FORTIFY_SOURCE=2 \
  15. -fno-omit-frame-pointer \
  16. -fsanitize=address -fsanitize=undefined \
  17. -fsanitize=shift -fsanitize=integer-divide-by-zero -fsanitize=unreachable \
  18. -fsanitize=vla-bound -fsanitize=null -fsanitize=return \
  19. -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment \
  20. -fsanitize=object-size -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow \
  21. -fsanitize=nonnull-attribute -fsanitize=returns-nonnull-attribute -fsanitize=bool \
  22. -fsanitize=enum -fsanitize=vptr -fsanitize=bounds-strict \
  23. -fsanitize=leak \
  24. -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=bounds-strict \
  25. -fsanitize-address-use-after-scope \
  26. -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=builtin -fsanitize=pointer-overflow \
  27. -std=gnu++2a -Wformat=1 \
  28. -Wno-attributes"
  29. export LDFLAGS="$LDFLAGS -lm -ldl"
  30. #source ./tools/ci/flags/gcc9.sh
  31. export CXXFLAGS="$CXXFLAGS $POST_CXXFLAGS"
  32. do_init
  33. run_configure --enable-unittests=yes $*
  34. export SDL_VIDEODRIVER=dummy
  35. export ASAN_OPTIONS=detect_leaks=0:detect_stack_use_after_return=true:strict_init_order=true:detect_invalid_pointer_pairs=1
  36. export LSAN_OPTIONS=suppressions=$(pwd)/tools/ci/scripts/lsansuppression_tests.txt
  37. run_make_check
  38. source ./tools/ci/scripts/exit.sh
  39. exit 0