Commit 0dcb6144 authored by Kenneth Raffenetti's avatar Kenneth Raffenetti Committed by Antonio J. Pena
Browse files

strengthen test for weak alias attribute



Adds the -Werror flag to this test because in cases like icc/osx
the compiler only throws a warning that it will ignore function
__attribute__ defs, but in this case we need to know if they actually
work.

Fixes #1980
Signed-off-by: default avatarAntonio J. Pena <apenya@mcs.anl.gov>
parent 3cbe6a0e
......@@ -361,8 +361,18 @@ pac_cv_attr_weak_import=yes,pac_cv_attr_weak_import=no)])
# Check if the alias option for weak attributes is allowed
AC_CACHE_CHECK([whether __attribute__((weak,alias(...))) allowed],
pac_cv_attr_weak_alias,[
# We add -Werror if it's gcc to force an error exit if the weak attribute
# isn't understood
if test $GCC = yes ; then
save_CFLAGS=$CFLAGS
CFLAGS=-Werror
fi
AC_TRY_COMPILE([int foo(int) __attribute__((weak,alias("__foo")));],[int a;],
pac_cv_attr_weak_alias=yes,pac_cv_attr_weak_alias=no)])
pac_cv_attr_weak_alias=yes,pac_cv_attr_weak_alias=no)
# Restore original CFLAGS
if test $GCC = yes ; then
CFLAGS=$save_CFLAGS
fi])
if test "$pac_cv_attr_weak_alias" = "yes" ; then
AC_DEFINE(HAVE_WEAK_ATTRIBUTE,1,[Attribute style weak pragma])
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment