[svn-commits] rmudgett: trunk r980 - in /trunk: autoconfig.h.in configure configure.ac

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


Author: rmudgett
Date: Mon Dec 19 15:31:04 2011
New Revision: 980

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

Modified:
    trunk/autoconfig.h.in
    trunk/configure
    trunk/configure.ac

Modified: trunk/autoconfig.h.in
URL: http://svnview.digium.com/svn/menuselect/trunk/autoconfig.h.in?view=diff&rev=980&r1=979&r2=980
==============================================================================
--- trunk/autoconfig.h.in (original)
+++ trunk/autoconfig.h.in Mon Dec 19 15:31:04 2011
@@ -110,9 +110,6 @@
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 

Modified: trunk/configure.ac
URL: http://svnview.digium.com/svn/menuselect/trunk/configure.ac?view=diff&rev=980&r1=979&r2=980
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Mon Dec 19 15:31:04 2011
@@ -22,6 +22,36 @@
 
 HOST_OS=${host_os}
 AC_SUBST(HOST_OS)
+
+PBX_WINARCH=0
+case "${host_os}" in
+     freebsd*)
+     OSARCH=FreeBSD
+     ;;
+     netbsd*)
+     OSARCH=NetBSD
+     ;;
+     openbsd*)
+     OSARCH=OpenBSD
+     ;;
+     solaris*)
+     OSARCH=SunOS
+     ;;
+     mingw32)
+     OSARCH=mingw32
+     PBX_WINARCH=1
+     ;;
+     cygwin)
+     OSARCH=cygwin
+     PBX_WINARCH=1
+     ;;
+     linux-gnueabi)
+     OSARCH=linux-gnu
+     ;;
+     *)
+     OSARCH=${host_os}
+     ;;
+esac
 
 AH_TOP(
 #ifndef MENUSELECT_AUTOCONFIG_H
@@ -51,9 +81,36 @@
     esac])
 AC_SUBST(MENUSELECT_DEBUG)
 
-AST_GCC_ATTRIBUTE(weak_import)
-AST_GCC_ATTRIBUTE(weakref)
-AST_GCC_ATTRIBUTE(weak)
+# 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_FUNC_ALLOCA
 AC_CHECK_FUNCS([asprintf getloadavg setenv strcasestr strndup strnlen strsep unsetenv vasprintf])




More information about the svn-commits mailing list