From 8a75144c232a5339f62f6b2631b14d441b9a6189 Mon Sep 17 00:00:00 2001 From: jakub Date: Wed, 7 Jan 2009 22:48:03 +0000 Subject: [PATCH] PR libgomp/38086 * acinclude.m4 (HAVE_AS_SYMVER_DIRECTIVE): New check. * libgomp.h (LIBGOMP_GNU_SYMBOL_VERSIONING): Undefine if HAVE_AS_SYMVER_DIRECTIVE is not defined. * configure: Regenerated. * config.h.in: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143168 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog | 9 ++++++++ libgomp/acinclude.m4 | 10 +++++++++ libgomp/config.h.in | 3 +++ libgomp/configure | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ libgomp/libgomp.h | 3 ++- 5 files changed, 86 insertions(+), 1 deletion(-) diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index d8e91b340d0..9428394f629 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,12 @@ +2009-01-07 Jakub Jelinek + + PR libgomp/38086 + * acinclude.m4 (HAVE_AS_SYMVER_DIRECTIVE): New check. + * libgomp.h (LIBGOMP_GNU_SYMBOL_VERSIONING): Undefine if + HAVE_AS_SYMVER_DIRECTIVE is not defined. + * configure: Regenerated. + * config.h.in: Likewise. + 2008-12-28 Jakub Jelinek PR c++/38650 diff --git a/libgomp/acinclude.m4 b/libgomp/acinclude.m4 index f3cd089e537..c6d9c308d9a 100644 --- a/libgomp/acinclude.m4 +++ b/libgomp/acinclude.m4 @@ -298,6 +298,16 @@ if test $enable_symvers = yes; then fi fi +AC_CACHE_CHECK([whether the target supports .symver directive], + libgomp_cv_have_as_symver_directive, [ + AC_TRY_COMPILE([void foo (void); __asm (".symver foo, bar@SYMVER");], + [], libgomp_cv_have_as_symver_directive=yes, + libgomp_cv_have_as_symver_directive=no)]) +if test $libgomp_cv_have_as_symver_directive = yes; then + AC_DEFINE(HAVE_AS_SYMVER_DIRECTIVE, 1, + [Define to 1 if the target assembler supports .symver directive.]) +fi + AM_CONDITIONAL(LIBGOMP_BUILD_VERSIONED_SHLIB, test $enable_symvers != no) AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers) ]) diff --git a/libgomp/config.h.in b/libgomp/config.h.in index 5f0dcc7570b..88bae83fab3 100644 --- a/libgomp/config.h.in +++ b/libgomp/config.h.in @@ -1,5 +1,8 @@ /* config.h.in. Generated from configure.ac by autoheader. */ +/* Define to 1 if the target assembler supports .symver directive. */ +#undef HAVE_AS_SYMVER_DIRECTIVE + /* Define to 1 if the target supports __attribute__((alias(...))). */ #undef HAVE_ATTRIBUTE_ALIAS diff --git a/libgomp/configure b/libgomp/configure index 376c09d9247..432543b2795 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -18761,6 +18761,68 @@ echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;} fi fi +echo "$as_me:$LINENO: checking whether the target supports .symver directive" >&5 +echo $ECHO_N "checking whether the target supports .symver directive... $ECHO_C" >&6 +if test "${libgomp_cv_have_as_symver_directive+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +void foo (void); __asm (".symver foo, bar@SYMVER"); +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + libgomp_cv_have_as_symver_directive=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +libgomp_cv_have_as_symver_directive=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $libgomp_cv_have_as_symver_directive" >&5 +echo "${ECHO_T}$libgomp_cv_have_as_symver_directive" >&6 +if test $libgomp_cv_have_as_symver_directive = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_AS_SYMVER_DIRECTIVE 1 +_ACEOF + +fi + if test $enable_symvers != no; then diff --git a/libgomp/libgomp.h b/libgomp/libgomp.h index 7292358b9aa..5acee09f4d5 100644 --- a/libgomp/libgomp.h +++ b/libgomp/libgomp.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Richard Henderson . This file is part of the GNU OpenMP Library (libgomp). @@ -516,6 +516,7 @@ gomp_work_share_init_done (void) #if !defined (HAVE_ATTRIBUTE_VISIBILITY) \ || !defined (HAVE_ATTRIBUTE_ALIAS) \ + || !defined (HAVE_AS_SYMVER_DIRECTIVE) \ || !defined (PIC) # undef LIBGOMP_GNU_SYMBOL_VERSIONING #endif -- 2.11.0