gcc49_sanitize.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/usr/bin/env bash
  2. export CC=gcc-4.9
  3. export CXX=g++-4.9
  4. if [ "$NEWCC" != "" ]; then
  5. export CC="$NEWCC"
  6. fi
  7. if [ "$NEWCXX" != "" ]; then
  8. export CXX="$NEWCXX"
  9. fi
  10. export LOGFILE=gcc49.log
  11. source ./tools/ci/scripts/init.sh
  12. export CXXFLAGS="$CXXFLAGS -ggdb3 -O2 -ffast-math \
  13. -D_GLIBCXX_SANITIZE_VECTOR \
  14. -fsanitize=address \
  15. -fno-omit-frame-pointer -funswitch-loops \
  16. -Wvariadic-macros -Wvla -Wredundant-decls \
  17. -Wpacked-bitfield-compat -Wtrampolines \
  18. -Wsuggest-attribute=noreturn -Wunused -Wstrict-aliasing=2 \
  19. -fstrict-aliasing -Wunreachable-code -Wabi \
  20. -Wvolatile-register-var -Winvalid-pch -Wredundant-decls \
  21. -Wnormalized=nfkc -Wmissing-format-attribute -Wmissing-noreturn \
  22. -Wswitch-default -Wsign-promo -Waddress -Wmissing-declarations \
  23. -Wctor-dtor-privacy -Wstrict-null-sentinel -Wlogical-op \
  24. -Wcast-align -Wpointer-arith -Wundef \
  25. -Wmissing-include-dirs -Winit-self -pedantic -Wall \
  26. -Wextra -fstrict-overflow -Wstrict-overflow=1 -Wunknown-pragmas \
  27. -Wwrite-strings -Wstack-protector -Wshadow -Wunused-macros -Wsynth \
  28. -Wbuiltin-macro-redefined -Wctor-dtor-privacy -Wdeprecated \
  29. -Wendif-labels -Wformat=1 -Wimport -Wnon-virtual-dtor -Wpsabi \
  30. -Wsign-promo -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wc++11-compat -std=c++0x \
  31. -Wdelete-non-virtual-dtor -Wmaybe-uninitialized -Wunused-local-typedefs \
  32. -Wvector-operation-performance -Wfree-nonheap-object -Winvalid-memory-model \
  33. -Wnarrowing -Wzero-as-null-pointer-constant -funsafe-loop-optimizations \
  34. -Wabi-tag -Waggressive-loop-optimizations -Wclobbered -Wempty-body \
  35. -Wignored-qualifiers -Wliteral-suffix -Wmissing-field-initializers \
  36. -Woverlength-strings -Wpedantic -Wsign-compare -Wsizeof-pointer-memaccess \
  37. -Wsuggest-attribute=format -Wtype-limits -Wuninitialized \
  38. -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function \
  39. -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -ftrapv \
  40. -fsched-pressure \
  41. -Wconditionally-supported -Wdate-time -Woverloaded-virtual \
  42. -fno-var-tracking $POST_CXXFLAGS"
  43. export LDFLAGS="$LDFLAGS -lm -ldl"
  44. do_init
  45. run_configure --enable-werror $*
  46. run_make
  47. source ./tools/ci/scripts/exit.sh
  48. exit 0