Merged revisions 183241 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Thu, 19 Mar 2009 18:00:15 +0000 (18:00 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 19 Mar 2009 18:00:15 +0000 (18:00 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r183241 | russell | 2009-03-19 12:52:52 -0500 (Thu, 19 Mar 2009) | 2 lines

Remove the use of RTLD_NOLOAD, as it is not behaving like expected.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@183242 65c4cc65-6c06-0410-ace0-fbb531ad65f3

configure
configure.ac
include/asterisk/autoconfig.h.in
main/loader.c

index f3936a0..0725b29 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 182355 .
+# From configure.ac Revision: 182847 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.6.
 #
@@ -992,7 +992,6 @@ AST_DECLARATION_AFTER_STATEMENT
 AST_FORTIFY_SOURCE
 AST_NO_STRICT_OVERFLOW
 AST_SHADOW_WARNINGS
-PBX_RTLD_NOLOAD
 PBX_IP_MTU_DISCOVER
 PBX_DAHDI_HALF_FULL
 GSM_INTERNAL
@@ -19141,83 +19140,6 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 
-    if test "x${PBX_RTLD_NOLOAD}" != "x1"; then
-       { echo "$as_me:$LINENO: checking for RTLD_NOLOAD in dlfcn.h" >&5
-echo $ECHO_N "checking for RTLD_NOLOAD in dlfcn.h... $ECHO_C" >&6; }
-       saved_cppflags="${CPPFLAGS}"
-       if test "x${RTLD_NOLOAD_DIR}" != "x"; then
-           RTLD_NOLOAD_INCLUDE="-I${RTLD_NOLOAD_DIR}/include"
-       fi
-       CPPFLAGS="${CPPFLAGS} ${RTLD_NOLOAD_INCLUDE}"
-
-       cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <dlfcn.h>
-int
-main ()
-{
-#if defined(RTLD_NOLOAD)
-                               int foo = 0;
-                               #else
-                               int foo = bar;
-                               #endif
-                               0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-     { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-               PBX_RTLD_NOLOAD=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_RTLD_NOLOAD 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_RTLD_NOLOAD_VERSION
-_ACEOF
-
-
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-          { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-       CPPFLAGS="${saved_cppflags}"
-    fi
-
-
-
-
     if test "x${PBX_IP_MTU_DISCOVER}" != "x1"; then
        { echo "$as_me:$LINENO: checking for IP_MTU_DISCOVER in netinet/in.h" >&5
 echo $ECHO_N "checking for IP_MTU_DISCOVER in netinet/in.h... $ECHO_C" >&6; }
@@ -54451,7 +54373,6 @@ AST_DECLARATION_AFTER_STATEMENT!$AST_DECLARATION_AFTER_STATEMENT$ac_delim
 AST_FORTIFY_SOURCE!$AST_FORTIFY_SOURCE$ac_delim
 AST_NO_STRICT_OVERFLOW!$AST_NO_STRICT_OVERFLOW$ac_delim
 AST_SHADOW_WARNINGS!$AST_SHADOW_WARNINGS$ac_delim
-PBX_RTLD_NOLOAD!$PBX_RTLD_NOLOAD$ac_delim
 PBX_IP_MTU_DISCOVER!$PBX_IP_MTU_DISCOVER$ac_delim
 PBX_DAHDI_HALF_FULL!$PBX_DAHDI_HALF_FULL$ac_delim
 GSM_INTERNAL!$GSM_INTERNAL$ac_delim
@@ -54466,6 +54387,7 @@ PWLIB_INCDIR!$PWLIB_INCDIR$ac_delim
 PWLIB_LIBDIR!$PWLIB_LIBDIR$ac_delim
 PWLIB_PLATFORM!$PWLIB_PLATFORM$ac_delim
 OPENH323DIR!$OPENH323DIR$ac_delim
+OPENH323_INCDIR!$OPENH323_INCDIR$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -54507,7 +54429,6 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
-OPENH323_INCDIR!$OPENH323_INCDIR$ac_delim
 OPENH323_LIBDIR!$OPENH323_LIBDIR$ac_delim
 OPENH323_SUFFIX!$OPENH323_SUFFIX$ac_delim
 OPENH323_BUILD!$OPENH323_BUILD$ac_delim
@@ -54528,7 +54449,7 @@ PBX_GENERIC_ODBC!$PBX_GENERIC_ODBC$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 19; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 18; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index d372f04..ac129ac 100644 (file)
@@ -609,8 +609,6 @@ AC_LINK_IFELSE(
        AC_MSG_RESULT(no)
 )
 
-AST_C_DEFINE_CHECK([RTLD_NOLOAD], [RTLD_NOLOAD], [dlfcn.h])
-
 AST_C_DEFINE_CHECK([IP_MTU_DISCOVER], [IP_MTU_DISCOVER], [netinet/in.h])
 
 AC_CHECK_HEADER([libkern/OSAtomic.h],
index 4961c30..dc95c83 100644 (file)
 /* Define to indicate the ${ROUND_DESCRIP} library version */
 #undef HAVE_ROUND_VERSION
 
-/* Define if your system has the RTLD_NOLOAD headers. */
-#undef HAVE_RTLD_NOLOAD
-
-/* Define RTLD_NOLOAD headers version */
-#undef HAVE_RTLD_NOLOAD_VERSION
-
 /* Define to 1 if your system has /sbin/launchd. */
 #undef HAVE_SBIN_LAUNCHD
 
index 05524fe..5f2fe86 100644 (file)
@@ -403,18 +403,6 @@ static struct ast_module *load_dynamic_module(const char *resource_in, unsigned
                return NULL;
        }
 
-       /* if the system supports RTLD_NOLOAD, we can just 'promote' the flags
-          on the already-opened library to what we want... if not, we have to
-          close it and start over
-       */
-#if defined(HAVE_RTLD_NOLOAD) && !defined(__Darwin__)
-       if (!dlopen(fn, RTLD_NOLOAD | (wants_global ? RTLD_LAZY | RTLD_GLOBAL : RTLD_NOW | RTLD_LOCAL))) {
-               ast_log(LOG_WARNING, "Unable to promote flags on module '%s': %s\n", resource_in, dlerror());
-               while (!dlclose(lib));
-               ast_free(resource_being_loaded);
-               return NULL;
-       }
-#else
        while (!dlclose(lib));
        resource_being_loaded = NULL;
 
@@ -435,7 +423,6 @@ static struct ast_module *load_dynamic_module(const char *resource_in, unsigned
        /* since the module was successfully opened, and it registered itself
           the previous time we did that, we're going to assume it worked this
           time too :) */
-#endif
 
        AST_LIST_LAST(&module_list)->lib = lib;
        resource_being_loaded = NULL;