gcc5_sanitize.sh 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/usr/bin/env bash
  2. export CC=gcc-5
  3. export CXX=g++-5
  4. if [ "$NEWCC" != "" ]; then
  5. export CC="$NEWCC"
  6. fi
  7. if [ "$NEWCXX" != "" ]; then
  8. export CXX="$NEWCXX"
  9. fi
  10. export LOGFILE=gcc5_sanitize.log
  11. source ./tools/ci/scripts/init.sh
  12. export CXXFLAGS="$CXXFLAGS -ggdb3 -O2 -pipe -ffast-math \
  13. -D_GLIBCXX_SANITIZE_VECTOR \
  14. -fsanitize=address -fsanitize=undefined \
  15. -fsanitize=shift -fsanitize=integer-divide-by-zero -fsanitize=unreachable \
  16. -fsanitize=vla-bound -fsanitize=null -fsanitize=return \
  17. -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment \
  18. -fsanitize=object-size -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow \
  19. -fsanitize=nonnull-attribute -fsanitize=returns-nonnull-attribute -fsanitize=bool \
  20. -fsanitize=enum -fsanitize=vptr \
  21. -fno-omit-frame-pointer -funswitch-loops \
  22. -Wvariadic-macros -Wvla -Wredundant-decls \
  23. -Wpacked-bitfield-compat -Wtrampolines \
  24. -Wsuggest-attribute=noreturn -Wunused -Wstrict-aliasing=2 \
  25. -fstrict-aliasing -Wunreachable-code \
  26. -Wvolatile-register-var -Winvalid-pch -Wredundant-decls \
  27. -Wnormalized=nfkc -Wmissing-format-attribute -Wmissing-noreturn \
  28. -Wswitch-default -Wsign-promo -Waddress -Wmissing-declarations \
  29. -Wctor-dtor-privacy -Wstrict-null-sentinel -Wlogical-op \
  30. -Wcast-align -Wpointer-arith -Wundef \
  31. -Wmissing-include-dirs -Winit-self -pedantic -Wall \
  32. -Wpacked -Wextra -fstrict-overflow -Wstrict-overflow=1 -Wunknown-pragmas \
  33. -Wwrite-strings -Wstack-protector -Wshadow -Wunused-macros -Wsynth \
  34. -Wbuiltin-macro-redefined -Wctor-dtor-privacy -Wdeprecated \
  35. -Wendif-labels -Wformat=1 -Wimport -Wnon-virtual-dtor -Wpsabi \
  36. -Wsign-promo -Wwrite-strings -D_FORTIFY_SOURCE=2 -std=gnu++1z \
  37. -Wdelete-non-virtual-dtor -Wmaybe-uninitialized -Wunused-local-typedefs \
  38. -Wvector-operation-performance -Wfree-nonheap-object -Winvalid-memory-model \
  39. -Wnarrowing -Wzero-as-null-pointer-constant -funsafe-loop-optimizations \
  40. -Waggressive-loop-optimizations -Wclobbered -Wempty-body \
  41. -Wignored-qualifiers -Wliteral-suffix -Wmissing-field-initializers \
  42. -Woverlength-strings -Wpedantic -Wsign-compare -Wsizeof-pointer-memaccess \
  43. -Wsuggest-attribute=format -Wtype-limits -Wuninitialized \
  44. -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function \
  45. -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -ftrapv \
  46. -fsched-pressure -Wconditionally-supported -Wdate-time -fno-var-tracking \
  47. -Wopenmp-simd -Wformat-signedness -Wformat-contains-nul \
  48. -Wformat-extra-args -Wformat-security -Wswitch-bool -Wswitch-enum \
  49. -Wformat-y2k -Wformat-zero-length -Wmemset-transposed-args -Wchkp \
  50. -Wc++14-compat -Wsized-deallocation -Wlogical-not-parentheses \
  51. -Woverloaded-virtual -Warray-bounds -Wbool-compare -Wchar-subscripts \
  52. -Wcomment -Wmissing-braces -Wnonnull -Wopenmp-simd -Wparentheses \
  53. -Wreturn-type -Wsequence-point -Wswitch \
  54. -Wno-attributes $POST_CXXFLAGS"
  55. export LDFLAGS="$LDFLAGS -lm -ldl"
  56. do_init
  57. run_configure --enable-werror $*
  58. run_make
  59. source ./tools/ci/scripts/exit.sh
  60. exit 0