[svn-commits] rmudgett: branch 10 r348648 - in /branches/10: ./ configure configure.ac

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Dec 19 15:37:37 CST 2011


Author: rmudgett
Date: Mon Dec 19 15:37:31 2011
New Revision: 348648

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=348648
Log:
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

Modified:
    branches/10/   (props changed)
    branches/10/configure
    branches/10/configure.ac

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/10/configure.ac?view=diff&rev=348648&r1=348647&r2=348648
==============================================================================
--- branches/10/configure.ac (original)
+++ branches/10/configure.ac Mon Dec 19 15:37:31 2011
@@ -898,9 +898,37 @@
 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}"




More information about the svn-commits mailing list