summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2011-12-19 21:43:19 +0000
committerRichard Mudgett <rmudgett@digium.com>2011-12-19 21:43:19 +0000
commit38e4643cb4beadc0bd61b2ac560da32101cff8a5 (patch)
tree833d87372da2e0c9d2da86b0426299d5cb201cc6 /configure.ac
parenteb37d38b7dbd97989d25510f4271554550dc817c (diff)
Fix crashes on other platforms caused by interference from Darwin weak symbol support.
Support weak symbols on a platform specific basis. The Mac OS X (Darwin) support must be isolated from the other platforms because it has caused other platforms to crash. Several other platforms including Linux have GCC versions that define the weak attribute. However, this attribute is only setup for use in the code by Darwin. (closes issue ASTERISK-18728) Reported by: Ben Klang Review: https://reviewboard.asterisk.org/r/1617/ ........ Merged revisions 348647 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 348648 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac34
1 files changed, 31 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index f84b92db0..e239e8a1a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -898,9 +898,37 @@ AST_GCC_ATTRIBUTE(always_inline)
AST_GCC_ATTRIBUTE(deprecated)
AST_GCC_ATTRIBUTE(sentinel)
AST_GCC_ATTRIBUTE(warn_unused_result)
-AST_GCC_ATTRIBUTE(weak_import, [], [], PBX_WEAKREF)
-AST_GCC_ATTRIBUTE(weak, [], [], PBX_WEAKREF)
-AST_GCC_ATTRIBUTE(weakref, [weakref("foo")], static, PBX_WEAKREF)
+
+# Support weak symbols on a platform specific basis. The Mac OS X
+# (Darwin) support must be isolated from the other platforms because
+# it has caused other platforms to fail.
+#
+case "${OSARCH}" in
+ darwin*)
+ # Allow weak symbol support on Darwin platforms only because there
+ # is active community support for it.
+ # However, Darwin seems to break weak symbols for each new version.
+ #
+ AST_GCC_ATTRIBUTE(weak_import, [], [], PBX_WEAKREF)
+
+ # Several other platforms including Linux have GCC versions that
+ # define the weak attribute. However, this attribute is only
+ # setup for use in the code by Darwin.
+ AST_GCC_ATTRIBUTE(weak, [], [], PBX_WEAKREF)
+ ;;
+ linux-gnu)
+ # Primarily support weak symbols on Linux platforms.
+ #
+ AST_GCC_ATTRIBUTE(weakref, [weakref("foo")], static, PBX_WEAKREF)
+ ;;
+ *)
+ # Allow weak symbols on other platforms. However, any problems
+ # with this feature on other platforms must be fixed by the
+ # community.
+ #
+ AST_GCC_ATTRIBUTE(weakref, [weakref("foo")], static, PBX_WEAKREF)
+ ;;
+esac
AC_MSG_CHECKING(for -ffunction-sections support)
saved_CFLAGS="${CFLAGS}"