diff options
author | iains <iains@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-22 14:49:11 +0000 |
---|---|---|
committer | iains <iains@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-22 14:49:11 +0000 |
commit | 07acf71267309fd593fafe0d25ed5a805aee0977 (patch) | |
tree | 2c26188cd406f39ca321e6a5612b5d17b6376b1e /libitm | |
parent | e3eb42090469340ec4e2c93cfb0347d35230d62d (diff) | |
download | gcc-07acf71267309fd593fafe0d25ed5a805aee0977.tar.gz |
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
Diffstat (limited to 'libitm')
-rw-r--r-- | libitm/ChangeLog | 16 | ||||
-rw-r--r-- | libitm/Makefile.in | 10 | ||||
-rw-r--r-- | libitm/aclocal.m4 | 1 | ||||
-rw-r--r-- | libitm/alloc_cpp.cc | 4 | ||||
-rw-r--r-- | libitm/config.h.in | 3 | ||||
-rw-r--r-- | libitm/configure | 51 | ||||
-rw-r--r-- | libitm/configure.ac | 2 | ||||
-rw-r--r-- | libitm/eh_cpp.cc | 4 | ||||
-rw-r--r-- | libitm/testsuite/Makefile.in | 10 |
9 files changed, 87 insertions, 14 deletions
diff --git a/libitm/ChangeLog b/libitm/ChangeLog index ae091d87181..ab21cc5b99d 100644 --- a/libitm/ChangeLog +++ b/libitm/ChangeLog @@ -1,11 +1,23 @@ 2011-11-22 Iain Sandoe <iains@gcc.gnu.org> + * 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. + +2011-11-22 Iain Sandoe <iains@gcc.gnu.org> + * config/x86/sjlj.S (CONCAT1, CONCAT2, SYM): Respond to __USER_LABEL_PREFIX__ for targets that use it. - TYPE, SIZE, HIDDEN): New macros to assist on non-elf targets. + (TYPE, SIZE, HIDDEN): New macros to assist on non-elf targets. (_ITM_beginTransaction): Use SYM, TYPE, SIZE macros to assist in portability to non-elf targets. - (GTM_longjmp): LIkewise. + (GTM_longjmp): Likewise. * libitm_i.h (begin_transaction): Apply __USER_LABEL_PREFIX__ where required. diff --git a/libitm/Makefile.in b/libitm/Makefile.in index d3872c9d36e..a1bc47645e0 100644 --- a/libitm/Makefile.in +++ b/libitm/Makefile.in @@ -57,10 +57,12 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/stdint.m4 \ - $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../ltoptions.m4 \ - $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ - $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/../config/tls.m4 \ + $(top_srcdir)/../config/weakref.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ diff --git a/libitm/aclocal.m4 b/libitm/aclocal.m4 index 96617e6e4db..625404e06f6 100644 --- a/libitm/aclocal.m4 +++ b/libitm/aclocal.m4 @@ -1001,6 +1001,7 @@ m4_include([../config/multi.m4]) m4_include([../config/override.m4]) m4_include([../config/stdint.m4]) m4_include([../config/tls.m4]) +m4_include([../config/weakref.m4]) m4_include([../ltoptions.m4]) m4_include([../ltsugar.m4]) m4_include([../ltversion.m4]) diff --git a/libitm/alloc_cpp.cc b/libitm/alloc_cpp.cc index d298bd49e82..0789b2e5342 100644 --- a/libitm/alloc_cpp.cc +++ b/libitm/alloc_cpp.cc @@ -60,7 +60,7 @@ extern void _ZdlPvRKSt9nothrow_t (void *, c_nothrow_p) __attribute__((weak)); extern void *_ZnaXRKSt9nothrow_t (size_t, c_nothrow_p) __attribute__((weak)); extern void _ZdaPvRKSt9nothrow_t (void *, c_nothrow_p) __attribute__((weak)); -#ifdef __osf__ /* Really: !HAVE_WEAKDEF */ +#if !defined (HAVE_ELF_STYLE_WEAKREF) void *_ZnwX (size_t) { return NULL; } void _ZdlPv (void *) { return; } void *_ZnaX (size_t) { return NULL; } @@ -70,7 +70,7 @@ void *_ZnwXRKSt9nothrow_t (size_t, c_nothrow_p) { return NULL; } void _ZdlPvRKSt9nothrow_t (void *, c_nothrow_p) { return; } void *_ZnaXRKSt9nothrow_t (size_t, c_nothrow_p) { return NULL; } void _ZdaPvRKSt9nothrow_t (void *, c_nothrow_p) { return; } -#endif /* __osf__ */ +#endif /* HAVE_ELF_STYLE_WEAKREF */ /* Wrap the delete nothrow symbols for usage with a single argument. Perhaps should have a configure type check for this, because the diff --git a/libitm/config.h.in b/libitm/config.h.in index 52db1a6fdc1..1c3469cd5f9 100644 --- a/libitm/config.h.in +++ b/libitm/config.h.in @@ -30,6 +30,9 @@ /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if target has a weakref that works like the ELF one. */ +#undef HAVE_ELF_STYLE_WEAKREF + /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H 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 diff --git a/libitm/configure.ac b/libitm/configure.ac index 672b71279e3..45ee8701e38 100644 --- a/libitm/configure.ac +++ b/libitm/configure.ac @@ -239,6 +239,8 @@ LIBITM_CHECK_SYNC_BUILTINS LIBITM_CHECK_64BIT_SYNC_BUILTINS LIBITM_CHECK_AS_AVX +GCC_CHECK_ELF_STYLE_WEAKREF + # Cleanup and exit. CFLAGS="$save_CFLAGS" AC_CACHE_SAVE diff --git a/libitm/eh_cpp.cc b/libitm/eh_cpp.cc index 7a378622772..6f302cdc4ae 100644 --- a/libitm/eh_cpp.cc +++ b/libitm/eh_cpp.cc @@ -39,13 +39,13 @@ extern void *__cxa_begin_catch (void *) WEAK; extern void *__cxa_end_catch (void) WEAK; extern void __cxa_tm_cleanup (void *, void *, unsigned int) WEAK; -#ifdef __osf__ /* Really: !HAVE_WEAKDEF */ +#if !defined (HAVE_ELF_STYLE_WEAKREF) void *__cxa_allocate_exception (size_t) { return NULL; } void __cxa_throw (void *, void *, void *) { return; } void *__cxa_begin_catch (void *) { return NULL; } void *__cxa_end_catch (void) { return NULL; } void __cxa_tm_cleanup (void *, void *, unsigned int) { return; } -#endif +#endif /* HAVE_ELF_STYLE_WEAKREF */ } diff --git a/libitm/testsuite/Makefile.in b/libitm/testsuite/Makefile.in index 6990cfeb681..8066a2a0388 100644 --- a/libitm/testsuite/Makefile.in +++ b/libitm/testsuite/Makefile.in @@ -47,10 +47,12 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/stdint.m4 \ - $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../ltoptions.m4 \ - $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ - $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/../config/tls.m4 \ + $(top_srcdir)/../config/weakref.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs |