[commit: packages/unix] master, safe710fixes, safe710fixes-again, safefixes710again: Remove unnecessary checks for RTLD_NOW and RTLD_GLOBAL (827e675)

git at git.haskell.org git at git.haskell.org
Thu Mar 19 15:49:35 UTC 2015


Repository : ssh://git@git.haskell.org/unix

On branches: master,safe710fixes,safe710fixes-again,safefixes710again
Link       : http://ghc.haskell.org/trac/ghc/changeset/827e67570db8cdcb0af8a2108c562b7b51fbf244/unix

>---------------------------------------------------------------

commit 827e67570db8cdcb0af8a2108c562b7b51fbf244
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Fri Jul 4 17:23:58 2014 +0200

    Remove unnecessary checks for RTLD_NOW and RTLD_GLOBAL
    
    These checks were introduced for OpenBSD on July 16 2002 in GHC commit
    03e9edb3094fd3bb38ed886b96ee9f61f39e9b53.
    
    According to http://www.openbsd.org/cgi-bin/cvsweb/src/include/dlfcn.h
    RTLD_NOW, RTLD_GLOBAL and RTLD_LOCAL have been available on OpenBSD
    since Revision 1.8 (September 2 2003).
    
    This is merely code cleanup.


>---------------------------------------------------------------

827e67570db8cdcb0af8a2108c562b7b51fbf244
 System/Posix/DynamicLinker/Prim.hsc | 10 ----------
 configure.ac                        | 32 +-------------------------------
 2 files changed, 1 insertion(+), 41 deletions(-)

diff --git a/System/Posix/DynamicLinker/Prim.hsc b/System/Posix/DynamicLinker/Prim.hsc
index 2fe67b4..646e4fe 100644
--- a/System/Posix/DynamicLinker/Prim.hsc
+++ b/System/Posix/DynamicLinker/Prim.hsc
@@ -96,18 +96,8 @@ packRTLDFlags flags = foldl (\ s f -> (packRTLDFlag f) .|. s) 0 flags
 
 packRTLDFlag :: RTLDFlags -> CInt
 packRTLDFlag RTLD_LAZY = #const RTLD_LAZY
-
-#ifdef HAVE_RTLDNOW
 packRTLDFlag RTLD_NOW = #const RTLD_NOW
-#else /* HAVE_RTLDNOW */
-packRTLDFlag RTLD_NOW =  error "RTLD_NOW not available"
-#endif /* HAVE_RTLDNOW */
-
-#ifdef HAVE_RTLDGLOBAL
 packRTLDFlag RTLD_GLOBAL = #const RTLD_GLOBAL
-#else /* HAVE_RTLDGLOBAL */
-packRTLDFlag RTLD_GLOBAL = error "RTLD_GLOBAL not available"
-#endif
 
 #ifdef HAVE_RTLDLOCAL
 packRTLDFlag RTLD_LOCAL = #const RTLD_LOCAL
diff --git a/configure.ac b/configure.ac
index 57b7cf7..ccb627b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,7 +155,7 @@ AC_EGREP_CPP(yes,
   AC_MSG_RESULT(no)
   ])    
 
-dnl ** RTLD_LOCAL isn't available on cygwin or openbsd
+dnl ** RTLD_LOCAL isn't available on cygwin
 AC_MSG_CHECKING(for RTLD_LOCAL from dlfcn.h)
 AC_EGREP_CPP(yes,
 [
@@ -170,36 +170,6 @@ AC_EGREP_CPP(yes,
   AC_MSG_RESULT(no)
   ])    
 
-dnl ** RTLD_GLOBAL isn't available on openbsd
-AC_MSG_CHECKING(for RTLD_GLOBAL from dlfcn.h)
-AC_EGREP_CPP(yes,
-[
- #include <dlfcn.h>
- #ifdef RTLD_GLOBAL
-        yes
- #endif
-], [
-  AC_MSG_RESULT(yes)
-  AC_DEFINE([HAVE_RTLDGLOBAL], [1], [Define to 1 if RTLD_GLOBAL is available.])
-], [
-  AC_MSG_RESULT(no)
-  ])    
-
-dnl ** RTLD_NOW isn't available on openbsd
-AC_MSG_CHECKING(for RTLD_NOW from dlfcn.h)
-AC_EGREP_CPP(yes,
-[
- #include <dlfcn.h>
- #ifdef RTLD_NOW
-        yes
- #endif
-], [
-  AC_MSG_RESULT(yes)
-  AC_DEFINE([HAVE_RTLDNOW], [1], [Define to 1 if we can see RTLD_NOW in dlfcn.h])
-], [
-  AC_MSG_RESULT(no)
-  ])    
-
 AC_CHECK_FUNCS(openpty,,
    AC_CHECK_LIB(util,openpty,
      [AC_DEFINE(HAVE_OPENPTY) EXTRA_LIBS="$EXTRA_LIBS util"],



More information about the ghc-commits mailing list