This commit fixes trac:2917. By using the cleaned up version of check_visibility that is in the hwloc trunk repo.
This commit was SVN r25495. The following Trac tickets were found above: Ticket 2917 --> https://svn.open-mpi.org/trac/ompi/ticket/2917
Этот коммит содержится в:
родитель
1000af1c48
Коммит
1f53b32216
@ -11,7 +11,7 @@
|
|||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
# Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved.
|
# Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved.
|
||||||
# Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
# Copyright (c) 2009-2011 Oracle and/or its affiliates. All rights reserved.
|
||||||
# $COPYRIGHT$
|
# $COPYRIGHT$
|
||||||
#
|
#
|
||||||
# Additional copyrights may follow
|
# Additional copyrights may follow
|
||||||
@ -24,86 +24,83 @@
|
|||||||
AC_DEFUN([OPAL_CHECK_VISIBILITY],[
|
AC_DEFUN([OPAL_CHECK_VISIBILITY],[
|
||||||
AC_REQUIRE([AC_PROG_GREP])
|
AC_REQUIRE([AC_PROG_GREP])
|
||||||
|
|
||||||
msg="whether to enable symbol visibility"
|
|
||||||
# Check if the compiler has support for visibility, like some
|
# Check if the compiler has support for visibility, like some
|
||||||
# versions of gcc, icc Sun Studio cc.
|
# versions of gcc, icc Sun Studio cc.
|
||||||
AC_ARG_ENABLE(visibility,
|
AC_ARG_ENABLE(visibility,
|
||||||
AC_HELP_STRING([--enable-visibility],
|
AC_HELP_STRING([--enable-visibility],
|
||||||
[enable visibility feature of certain compilers/linkers (default: enabled)]))
|
[enable visibility feature of certain compilers/linkers (default: enabled)]))
|
||||||
if test "$enable_visibility" = "no"; then
|
|
||||||
AC_MSG_CHECKING([$msg])
|
|
||||||
AC_MSG_RESULT([no (disabled)])
|
|
||||||
have_visibility=0
|
|
||||||
else
|
|
||||||
CFLAGS_orig="$CFLAGS"
|
|
||||||
add=
|
|
||||||
|
|
||||||
# check using gcc -fvisibility=hidden flag
|
opal_visibility_define=0
|
||||||
CFLAGS="$CFLAGS_orig -fvisibility=hidden"
|
opal_msg="whether to enable symbol visibility"
|
||||||
AC_CACHE_CHECK([if $CC supports -fvisibility],
|
|
||||||
[opal_cv_cc_fvisibility],
|
if test "$enable_visibility" = "no"; then
|
||||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
AC_MSG_CHECKING([$opal_msg])
|
||||||
__attribute__((visibility("default"))) int foo;
|
AC_MSG_RESULT([no (disabled)])
|
||||||
]],[[int i;]])],
|
|
||||||
[opal_cv_cc_fvisibility=yes],
|
|
||||||
[if test -s conftest.err ; then
|
|
||||||
$GREP -iq "visibility" conftest.err
|
|
||||||
if test "$?" = "0" ; then
|
|
||||||
opal_cv_cc_fvisibility=no
|
|
||||||
else
|
else
|
||||||
opal_cv_cc_fvisibility=yes
|
CFLAGS_orig=$CFLAGS
|
||||||
fi
|
|
||||||
else
|
opal_add=
|
||||||
opal_cv_cc_fvisibility=yes
|
case "$ompi_c_vendor" in
|
||||||
fi],
|
sun)
|
||||||
[opal_cv_cc_fvisibility=no])
|
|
||||||
])
|
|
||||||
if test "$ompi_c_vendor" = "sun" ; then
|
|
||||||
# Check using Sun Studio -xldscope=hidden flag
|
# Check using Sun Studio -xldscope=hidden flag
|
||||||
CFLAGS="$CFLAGS_orig -xldscope=hidden"
|
opal_add="-xldscope=hidden"
|
||||||
AC_CACHE_CHECK([if $CC supports -xldscope],
|
CFLAGS="$CFLAGS_orig $opal_add"
|
||||||
[opal_cv_cc_xldscope],
|
|
||||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
AC_MSG_CHECKING([if $CC supports -xldscope])
|
||||||
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||||
__attribute__((visibility("default"))) int foo;
|
__attribute__((visibility("default"))) int foo;
|
||||||
]],[[int i;]])],
|
]],[[int i;]])],
|
||||||
[opal_cv_cc_fvisibilty=yes],
|
[],
|
||||||
[if test -s conftest.err ; then
|
[AS_IF([test -s conftest.err],
|
||||||
$GREP -iq "visibility" conftest.err
|
[$GREP -iq visibility conftest.err
|
||||||
if test "$?" = "0" ; then
|
# If we find "visibility" in the stderr, then
|
||||||
opal_cv_cc_xldscope="no"
|
# assume it doesn't work
|
||||||
else
|
AS_IF([test "$?" = "0"], [opal_add=])])
|
||||||
opal_cv_cc_xldscope="yes"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
opal_cv_cc_xldscope="yes"
|
|
||||||
fi],
|
|
||||||
[opal_cv_cc_xldscope="no"])
|
|
||||||
])
|
])
|
||||||
fi
|
AS_IF([test "$opal_add" = ""],
|
||||||
if test "$opal_cv_cc_fvisibility" = "yes" ; then
|
[AC_MSG_RESULT([no])],
|
||||||
add=" -fvisibility=hidden"
|
[AC_MSG_RESULT([yes])])
|
||||||
have_visibility=1
|
;;
|
||||||
AC_MSG_CHECKING([$msg])
|
|
||||||
AC_MSG_RESULT([yes (via$add)])
|
*)
|
||||||
AC_MSG_WARN([$add has been added to CFLAGS])
|
# Check using -fvisibility=hidden
|
||||||
elif test "$opal_cv_cc_xldscope" = "yes" ; then
|
opal_add=-fvisibility=hidden
|
||||||
add=" -xldscope=hidden"
|
CFLAGS="$CFLAGS_orig $opal_add"
|
||||||
have_visibility=1
|
|
||||||
AC_MSG_CHECKING([$msg])
|
AC_MSG_CHECKING([if $CC supports -fvisibility])
|
||||||
AC_MSG_RESULT([yes (via$add)])
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||||
AC_MSG_WARN([$add has been added to CFLAGS])
|
__attribute__((visibility("default"))) int foo;
|
||||||
|
]],[[int i;]])],
|
||||||
|
[],
|
||||||
|
[AS_IF([test -s conftest.err],
|
||||||
|
[$GREP -iq visibility conftest.err
|
||||||
|
# If we find "visibility" in the stderr, then
|
||||||
|
# assume it doesn't work
|
||||||
|
AS_IF([test "$?" = "0"], [opal_add=])])
|
||||||
|
])
|
||||||
|
AS_IF([test "$opal_add" = ""],
|
||||||
|
[AC_MSG_RESULT([no])],
|
||||||
|
[AC_MSG_RESULT([yes])])
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
CFLAGS=$CFLAGS_orig
|
||||||
|
OPAL_VISIBILITY_CFLAGS=$opal_add
|
||||||
|
|
||||||
|
if test "$opal_add" != "" ; then
|
||||||
|
opal_visibility_define=1
|
||||||
|
AC_MSG_CHECKING([$opal_msg])
|
||||||
|
AC_MSG_RESULT([yes (via $opal_add)])
|
||||||
elif test "$enable_visibility" = "yes"; then
|
elif test "$enable_visibility" = "yes"; then
|
||||||
AC_MSG_ERROR([Symbol visibility support requested but compiler does not seem to support it. Aborting])
|
AC_MSG_ERROR([Symbol visibility support requested but compiler does not seem to support it. Aborting])
|
||||||
else
|
else
|
||||||
AC_MSG_CHECKING([$msg])
|
AC_MSG_CHECKING([$opal_msg])
|
||||||
AC_MSG_RESULT([no (unsupported)])
|
AC_MSG_RESULT([no (unsupported)])
|
||||||
have_visibility=0
|
|
||||||
fi
|
fi
|
||||||
CFLAGS="$CFLAGS_orig$add"
|
unset opal_add
|
||||||
OPAL_VISIBILITY_CFLAGS="$add"
|
|
||||||
unset add
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_DEFINE_UNQUOTED([OPAL_C_HAVE_VISIBILITY], [$have_visibility],
|
AC_DEFINE_UNQUOTED([OPAL_C_HAVE_VISIBILITY], [$opal_visibility_define],
|
||||||
[Whether C compiler supports -fvisibility])
|
[Whether C compiler supports symbol visibility or not])
|
||||||
])
|
])
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
# Copyright (c) 2009 INRIA. All rights reserved.
|
# Copyright (c) 2009 INRIA. All rights reserved.
|
||||||
# Copyright (c) 2009-2010 Université Bordeaux 1
|
# Copyright (c) 2009-2010 Université Bordeaux 1
|
||||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||||
|
# Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
|
||||||
# See COPYING in top-level directory.
|
# See COPYING in top-level directory.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -60,7 +61,6 @@ AC_DEFUN([_HWLOC_CHECK_VISIBILITY],[
|
|||||||
[AC_REQUIRE([AC_PROG_GREP])],
|
[AC_REQUIRE([AC_PROG_GREP])],
|
||||||
[GREP=grep])
|
[GREP=grep])
|
||||||
|
|
||||||
msg="whether to enable visibility"
|
|
||||||
# Check if the compiler has support for visibility, like some
|
# Check if the compiler has support for visibility, like some
|
||||||
# versions of gcc, icc.
|
# versions of gcc, icc.
|
||||||
AC_ARG_ENABLE(visibility,
|
AC_ARG_ENABLE(visibility,
|
||||||
@ -73,50 +73,76 @@ AC_DEFUN([_HWLOC_CHECK_VISIBILITY],[
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
hwloc_visibility_define=0
|
||||||
|
hwloc_msg="whether to enable symbol visibility"
|
||||||
if test "$enable_visibility" = "no"; then
|
if test "$enable_visibility" = "no"; then
|
||||||
AC_MSG_CHECKING([$msg])
|
AC_MSG_CHECKING([$hwloc_msg])
|
||||||
AC_MSG_RESULT([no (disabled)])
|
AC_MSG_RESULT([no (disabled)])
|
||||||
have_visibility=0
|
|
||||||
else
|
else
|
||||||
CFLAGS_orig="$CFLAGS"
|
CFLAGS_orig=$CFLAGS
|
||||||
CFLAGS="$CFLAGS_orig -fvisibility=hidden"
|
|
||||||
hwloc_add=
|
hwloc_add=
|
||||||
AC_CACHE_CHECK([if $CC supports -fvisibility],
|
case "$ompi_c_vendor" in
|
||||||
[hwloc_cv_cc_fvisibility],
|
sun)
|
||||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
# Check using Sun Studio -xldscope=hidden flag
|
||||||
|
hwloc_add="-xldscope=hidden"
|
||||||
|
CFLAGS="$CFLAGS_orig $hwloc_add"
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([if $CC supports -xldscope])
|
||||||
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||||
__attribute__((visibility("default"))) int foo;
|
__attribute__((visibility("default"))) int foo;
|
||||||
]],[[int i;]])],
|
]],[[int i;]])],
|
||||||
[hwloc_cv_cc_fvisibility=yes],
|
[],
|
||||||
[if test -s conftest.err ; then
|
[AS_IF([test -s conftest.err],
|
||||||
$GREP -iq "visibility" conftest.err
|
[$GREP -iq visibility conftest.err
|
||||||
if test "$?" = "0" ; then
|
# If we find "visibility" in the stderr, then
|
||||||
hwloc_cv_cc_fvisibility=no
|
# assume it doesn't work
|
||||||
else
|
AS_IF([test "$?" = "0"], [hwloc_add=])])
|
||||||
hwloc_cv_cc_fvisibility=yes
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
hwloc_cv_cc_fvisibility=yes
|
|
||||||
fi],
|
|
||||||
[hwloc_cv_cc_fvisibility=no])
|
|
||||||
])
|
])
|
||||||
|
AS_IF([test "$hwloc_add" = ""],
|
||||||
|
[AC_MSG_RESULT([no])],
|
||||||
|
[AC_MSG_RESULT([yes])])
|
||||||
|
;;
|
||||||
|
|
||||||
if test "$hwloc_cv_cc_fvisibility" = "yes" ; then
|
*)
|
||||||
hwloc_add=" -fvisibility=hidden"
|
# Check using -fvisibility=hidden
|
||||||
have_visibility=1
|
hwloc_add=-fvisibility=hidden
|
||||||
AC_MSG_CHECKING([$msg])
|
CFLAGS="$CFLAGS_orig $hwloc_add"
|
||||||
AC_MSG_RESULT([yes (via$hwloc_add)])
|
|
||||||
|
AC_MSG_CHECKING([if $CC supports -fvisibility])
|
||||||
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||||
|
__attribute__((visibility("default"))) int foo;
|
||||||
|
]],[[int i;]])],
|
||||||
|
[],
|
||||||
|
[AS_IF([test -s conftest.err],
|
||||||
|
[$GREP -iq visibility conftest.err
|
||||||
|
# If we find "visibility" in the stderr, then
|
||||||
|
# assume it doesn't work
|
||||||
|
AS_IF([test "$?" = "0"], [hwloc_add=])])
|
||||||
|
])
|
||||||
|
AS_IF([test "$hwloc_add" = ""],
|
||||||
|
[AC_MSG_RESULT([no])],
|
||||||
|
[AC_MSG_RESULT([yes])])
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
CFLAGS=$CFLAGS_orig
|
||||||
|
HWLOC_VISIBILITY_CFLAGS=$hwloc_add
|
||||||
|
|
||||||
|
if test "$hwloc_add" != "" ; then
|
||||||
|
hwloc_visibility_define=1
|
||||||
|
AC_MSG_CHECKING([$hwloc_msg])
|
||||||
|
AC_MSG_RESULT([yes (via $hwloc_add)])
|
||||||
elif test "$enable_visibility" = "yes"; then
|
elif test "$enable_visibility" = "yes"; then
|
||||||
AC_MSG_ERROR([Symbol visibility support requested but compiler does not seem to support it. Aborting])
|
AC_MSG_ERROR([Symbol visibility support requested but compiler does not seem to support it. Aborting])
|
||||||
else
|
else
|
||||||
AC_MSG_CHECKING([$msg])
|
AC_MSG_CHECKING([$hwloc_msg])
|
||||||
AC_MSG_RESULT([no (unsupported)])
|
AC_MSG_RESULT([no (unsupported)])
|
||||||
have_visibility=0
|
|
||||||
fi
|
fi
|
||||||
CFLAGS=$CFLAGS_orig
|
|
||||||
HWLOC_VISIBILITY_CFLAGS=$hwloc_add
|
|
||||||
unset hwloc_add
|
unset hwloc_add
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_DEFINE_UNQUOTED([HWLOC_C_HAVE_VISIBILITY], [$have_visibility],
|
AC_DEFINE_UNQUOTED([HWLOC_C_HAVE_VISIBILITY], [$hwloc_visibility_define],
|
||||||
[Whether C compiler supports -fvisibility])
|
[Whether C compiler supports symbol visibility or not])
|
||||||
])
|
])
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user