Review Board 1.7.16


Make weak reference support linux and MacOSX only.

Review Request #1617 - Created Dec. 9, 2011 and submitted

rmudgett
1.8
ASTERISK-18728, ASTERISK-18950
Reviewers
asterisk-dev
kpfleming, oej, tilghman
Asterisk
Weak references is not portable and either does not work or does not work as expected on other platforms.

Primarily support weak references on linux platforms because the feature just works.

Allow weak symbol support on MacOS/X platforms only because there is active community support for it.  However, MacOS/X seems to break weak symbols for each new version.
My linux box now configures for HAVE_ATTRIBUTE_weakref instead of HAVE_ATTRIBUTE_weak which is Darwin specific. 

Diff revision 3 (Latest)

1 2 3
1 2 3

  1. /branches/1.8/configure.ac: Loading...
  2. /branches/1.8/configure: Loading...
/branches/1.8/configure.ac
Revision 348603 New Change
[20] 883 lines
[+20]
884
AST_GCC_ATTRIBUTE(unused)
884
AST_GCC_ATTRIBUTE(unused)
885
AST_GCC_ATTRIBUTE(always_inline)
885
AST_GCC_ATTRIBUTE(always_inline)
886
AST_GCC_ATTRIBUTE(deprecated)
886
AST_GCC_ATTRIBUTE(deprecated)
887
AST_GCC_ATTRIBUTE(sentinel)
887
AST_GCC_ATTRIBUTE(sentinel)
888
AST_GCC_ATTRIBUTE(warn_unused_result)
888
AST_GCC_ATTRIBUTE(warn_unused_result)

    
   
889

   

    
   
890
# Support weak symbols on a platform specific basis.  The Mac OS X

    
   
891
# (Darwin) support must be isolated from the other platforms because

    
   
892
# it has caused other platforms to fail.

    
   
893
#

    
   
894
case "${OSARCH}" in

    
   
895
	darwin*)

    
   
896
	# Allow weak symbol support on Darwin platforms only because there

    
   
897
	# is active community support for it.

    
   
898
	# However, Darwin seems to break weak symbols for each new version.

    
   
899
	#
889
AST_GCC_ATTRIBUTE(weak_import, [], [], PBX_WEAKREF)
900
	AST_GCC_ATTRIBUTE(weak_import, [], [], PBX_WEAKREF)

    
   
901

   

    
   
902
	# Several other platforms including Linux have GCC versions that

    
   
903
	# define the weak attribute.  However, this attribute is only

    
   
904
	# setup for use in the code by Darwin.
890
AST_GCC_ATTRIBUTE(weak, [], [], PBX_WEAKREF)
905
	AST_GCC_ATTRIBUTE(weak, [], [], PBX_WEAKREF)

    
   
906
	;;

    
   
907
	linux-gnu)

    
   
908
	# Primarily support weak symbols on Linux platforms.

    
   
909
	#
891
AST_GCC_ATTRIBUTE(weakref, [weakref("foo")], static, PBX_WEAKREF)
910
	AST_GCC_ATTRIBUTE(weakref, [weakref("foo")], static, PBX_WEAKREF)

    
   
911
	;;

    
   
912
	*)

    
   
913
	# Allow weak symbols on other platforms.  However, any problems

    
   
914
	# with this feature on other platforms must be fixed by the

    
   
915
	# community.

    
   
916
	#

    
   
917
	AST_GCC_ATTRIBUTE(weakref, [weakref("foo")], static, PBX_WEAKREF)

    
   
918
	;;

    
   
919
esac
892

    
   
920

   
893
AC_MSG_CHECKING(for -ffunction-sections support)
921
AC_MSG_CHECKING(for -ffunction-sections support)
894
saved_CFLAGS="${CFLAGS}"
922
saved_CFLAGS="${CFLAGS}"
895
CFLAGS="${CFLAGS} -ffunction-sections"
923
CFLAGS="${CFLAGS} -ffunction-sections"
896
AC_COMPILE_IFELSE(
924
AC_COMPILE_IFELSE(
[+20] [20] 1373 lines
/branches/1.8/configure
Revision UNKNOWN New Change
 
  1. /branches/1.8/configure.ac: Loading...
  2. /branches/1.8/configure: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.