diff --git a/configure b/configure index 8ada6765a..f27b00bb5 100755 --- a/configure +++ b/configure @@ -28178,6 +28178,78 @@ fi ;; esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--allow-multiple-definition" >&5 +printf %s "checking whether the linker accepts -Wl,--allow-multiple-definition... " >&6; } +if test ${ax_cv_check_ldflags___Wl___allow_multiple_definition+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,--allow-multiple-definition" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ax_cv_check_ldflags___Wl___allow_multiple_definition=yes +else $as_nop + ax_cv_check_ldflags___Wl___allow_multiple_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$ax_check_save_flags +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___allow_multiple_definition" >&5 +printf "%s\n" "$ax_cv_check_ldflags___Wl___allow_multiple_definition" >&6; } +if test x"$ax_cv_check_ldflags___Wl___allow_multiple_definition" = xyes +then : + +if test ${LDFLAGS+y} +then : + + case " $LDFLAGS " in #( + *" -Wl,--allow-multiple-definition "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : LDFLAGS already contains -Wl,--allow-multiple-definition"; } >&5 + (: LDFLAGS already contains -Wl,--allow-multiple-definition) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append LDFLAGS " -Wl,--allow-multiple-definition" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : LDFLAGS=\"\$LDFLAGS\""; } >&5 + (: LDFLAGS="$LDFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + LDFLAGS=-Wl,--allow-multiple-definition + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : LDFLAGS=\"\$LDFLAGS\""; } >&5 + (: LDFLAGS="$LDFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else $as_nop + : +fi + + if test -n "$GCC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fvisibility=hidden" >&5 printf %s "checking whether C compiler accepts -fvisibility=hidden... " >&6; } diff --git a/configure.ac b/configure.ac index 5667dfb47..d554be2f4 100644 --- a/configure.ac +++ b/configure.ac @@ -4456,6 +4456,12 @@ case "$OS" in ;; esac +dnl +dnl For fuzz_policy we redefine getaddrinfo() and freeaddrinfo(), but +dnl this can cause problems with ld.lld when sanitizers are enabled. +dnl +AX_CHECK_LINK_FLAG([-Wl,--allow-multiple-definition], [AX_APPEND_FLAG([-Wl,--allow-multiple-definition], [LDFLAGS])]) + dnl dnl Check for symbol visibility support. dnl This test relies on AC_LANG_WERROR