From 07acf71267309fd593fafe0d25ed5a805aee0977 Mon Sep 17 00:00:00 2001 From: iains Date: Tue, 22 Nov 2011 14:49:11 +0000 Subject: config: * weakref.m4: New file. libitm: * configure.ac: Use GCC_CHECK_ELF_STYLE_WEAKREF. * alloc_cpp.cc: Generate dummy functions if we don't HAVE_ELF_STYLE_WEAKREF. * eh_cpp.cc: Likewise. * configure: Regenerate. * aclocal.m4: Likewise. * config.h.in: Likewise. * Makefile.in: Likewise. * testsuite/Makefile.in: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181618 138bc75d-0d04-0410-961f-82ee72b054a4 --- libitm/configure | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'libitm/configure') diff --git a/libitm/configure b/libitm/configure index 024f39688bf..9b063594111 100644 --- a/libitm/configure +++ b/libitm/configure @@ -17213,6 +17213,57 @@ $as_echo "#define HAVE_AS_AVX 1" >>confdefs.h ;; esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether weak refs work like ELF" >&5 +$as_echo_n "checking whether weak refs work like ELF... " >&6; } +if test "${ac_cv_have_elf_style_weakref+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + weakref_m4_saved_CFLAGS="$CFLAGS" + case "${host}" in + *-apple-darwin*) CFLAGS="$CFLAGS -Wl,-undefined,dynamic_lookup" ;; + *) ;; + esac + if test "$cross_compiling" = yes; then : + +case "${host}" in + alpha*-dec-osf*) ac_cv_have_elf_style_weakref=no ;; + *-apple-darwin[89]*) ac_cv_have_elf_style_weakref=no ;; + *) ac_cv_have_elf_style_weakref=yes;; +esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +extern void fNotToBeFound(void) __attribute__((weak)); +int main () +{ + if (fNotToBeFound) + return 1; + else + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_have_elf_style_weakref=yes +else + ac_cv_have_elf_style_weakref=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +CFLAGS="$weakref_m4_saved_CFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_elf_style_weakref" >&5 +$as_echo "$ac_cv_have_elf_style_weakref" >&6; } +if test x"$ac_cv_have_elf_style_weakref" = xyes; then + +$as_echo "#define HAVE_ELF_STYLE_WEAKREF 1" >>confdefs.h + +fi + # Cleanup and exit. CFLAGS="$save_CFLAGS" cat >confcache <<\_ACEOF -- cgit v1.2.1