diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac index 9d010de28280..36e0c359dedf 100644 --- a/configure.ac +++ b/configure.ac @@ -3864,6 +3864,28 @@ else fi AC_SUBST(ENABLE_DEBUG) +AC_MSG_CHECKING([whether special RTTI visibility flags are needed for Clang Linux UBSan]) +NEED_CLANG_LINUX_UBSAN_RTTI_VISIBILITY= +dnl Clang 9 is known fixed since +dnl <https://github.com/llvm/llvm-project/commit/5745eccef54ddd3caca278d1d292a88b2281528b> "Adapt +dnl -fsanitize=function to SANITIZER_NON_UNIQUE_TYPEINFO": +if test "$COM_IS_CLANG" = TRUE && test "$CLANGVER" -lt 90000 && test "$_os" = Linux; then + for i in $CC; do + case $i in + -fsanitize=*) + NEED_CLANG_LINUX_UBSAN_RTTI_VISIBILITY=TRUE + break + ;; + esac + done +fi +if test "$NEED_CLANG_LINUX_UBSAN_RTTI_VISIBILITY" = TRUE; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi +AC_SUBST([NEED_CLANG_LINUX_UBSAN_RTTI_VISIBILITY]) + dnl =================================================================== dnl Select the linker to use (gold/lld/ld.bfd). dnl This is done only after compiler checks (need to know if Clang is @@ -3889,17 +3911,8 @@ printf ("hello world\n"); AC_MSG_RESULT( yes ) use_ld_ok=yes dnl For obscure reasons, unxgcc.mk uses the --dynamic-list-cpp-typeinfo linker option - dnl if sanitizers are used, and lld doesn't support this option. - use_ld_has_sanitizers= - for i in $CC; do - case $i in - -fsanitize=*) - use_ld_has_sanitizers=yes - break - ;; - esac - done - if test -n "$use_ld_has_sanitizers"; then + dnl if NEED_CLANG_LINUX_UBSAN_RTTI_VISIBILITY, and lld doesn't support this option. + if test -n "$NEED_CLANG_LINUX_UBSAN_RTTI_VISIBILITY"; then AC_MSG_CHECKING([for --dynamic-list-cpp-typeinfo linker support (-fuse-ld=$use_ld)]) use_ld_ldflags_save_2="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--dynamic-list-cpp-typeinfo" |