Merge commit '34c9eba982c75196392a3b0b245dd34297c4511d'

* commit '34c9eba982c75196392a3b0b245dd34297c4511d':
  configure: Refactor toolchain flag setting

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
This commit is contained in:
Derek Buitenhuis 2016-02-16 17:44:33 +00:00
commit 1c417bad61
1 changed files with 22 additions and 28 deletions

50
configure vendored
View File

@ -3294,43 +3294,37 @@ set >> $logfile
test -n "$valgrind" && toolchain="valgrind-memcheck" test -n "$valgrind" && toolchain="valgrind-memcheck"
case "$toolchain" in case "$toolchain" in
clang-asan) *-asan)
cc_default="clang" cc_default="${toolchain%-asan}"
add_cflags -fsanitize=address add_cflags -fsanitize=address
add_ldflags -fsanitize=address add_ldflags -fsanitize=address
;; ;;
clang-tsan) *-tsan)
cc_default="clang" cc_default="${toolchain%-tsan}"
add_cflags -fsanitize=thread -pie add_cflags -fsanitize=thread -pie
add_ldflags -fsanitize=thread -pie add_ldflags -fsanitize=thread -pie
case "$toolchain" in
gcc-tsan)
add_cflags -fPIC
add_ldflags -fPIC
;;
esac
;; ;;
clang-usan) *-usan)
cc_default="clang" cc_default="${toolchain%-usan}"
add_cflags -fsanitize=undefined add_cflags -fsanitize=undefined
add_ldflags -fsanitize=undefined add_ldflags -fsanitize=undefined
;; ;;
gcc-asan) valgrind-*)
cc_default="gcc" target_exec_default="valgrind"
add_cflags -fsanitize=address case "$toolchain" in
add_ldflags -fsanitize=address valgrind-massif)
;; target_exec_args="--tool=massif --alloc-fn=av_malloc --alloc-fn=av_mallocz --alloc-fn=av_calloc --alloc-fn=av_fast_padded_malloc --alloc-fn=av_fast_malloc --alloc-fn=av_realloc_f --alloc-fn=av_fast_realloc --alloc-fn=av_realloc"
gcc-tsan) ;;
cc_default="gcc" valgrind-memcheck)
add_cflags -fsanitize=thread -pie -fPIC target_exec_args="--error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
add_ldflags -fsanitize=thread -pie -fPIC ;;
;; esac
gcc-usan)
cc_default="gcc"
add_cflags -fsanitize=undefined
add_ldflags -fsanitize=undefined
;;
valgrind-massif)
target_exec_default=${valgrind:-"valgrind"}
target_exec_args="--tool=massif --alloc-fn=av_malloc --alloc-fn=av_mallocz --alloc-fn=av_calloc --alloc-fn=av_fast_padded_malloc --alloc-fn=av_fast_malloc --alloc-fn=av_realloc_f --alloc-fn=av_fast_realloc --alloc-fn=av_realloc"
;;
valgrind-memcheck)
target_exec_default=${valgrind:-"valgrind"}
target_exec_args="--error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
;; ;;
msvc) msvc)
# Check whether the current MSVC version needs the C99 converter. # Check whether the current MSVC version needs the C99 converter.