[commit: packages/unix] master, safe710fixes, safe710fixes-again, safefixes710again: Deprecate function `haveRtldLocal` (5e72506)

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


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

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

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

commit 5e7250642bfbef066daf8fe7336f0f09bea030b3
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Fri Jul 4 17:53:07 2014 +0200

    Deprecate function `haveRtldLocal`
    
    The function haveRtldLocal was introduced for compatibility with Cygwin
    on Mar 28 2002 in GHC commit 4740cf56c774b92e02d31b4666158d70c2e85a8f.
    
    According to https://cygwin.com/viewvc/src/winsup/cygwin/include/dlfcn.h
    RTLD_LOCAL has been available on Cygwin since Revision 1.4 (August 9 2010).


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

5e7250642bfbef066daf8fe7336f0f09bea030b3
 System/Posix/DynamicLinker/Prim.hsc | 14 +-------------
 configure.ac                        | 15 ---------------
 2 files changed, 1 insertion(+), 28 deletions(-)

diff --git a/System/Posix/DynamicLinker/Prim.hsc b/System/Posix/DynamicLinker/Prim.hsc
index 646e4fe..0bef60b 100644
--- a/System/Posix/DynamicLinker/Prim.hsc
+++ b/System/Posix/DynamicLinker/Prim.hsc
@@ -51,9 +51,6 @@ import Foreign.C.String	( CString )
 --
 -- If you fail to test the flag and use it although it is undefined,
 -- 'packDL' will throw an error.
---
--- The same applies to RTLD_LOCAL which isn't available on
--- cygwin.
 
 haveRtldNext :: Bool
 
@@ -69,12 +66,8 @@ foreign import ccall unsafe "__hsunix_rtldDefault" rtldDefault :: Ptr a
 #endif /* HAVE_RTLDDEFAULT */
 
 haveRtldLocal :: Bool
-
-#ifdef HAVE_RTLDLOCAL
 haveRtldLocal = True
-#else /* HAVE_RTLDLOCAL */
-haveRtldLocal = False
-#endif /* HAVE_RTLDLOCAL */
+{-# DEPRECATED haveRtldLocal "defaults to True" #-}
 
 
 -- |Flags for 'System.Posix.DynamicLinker.dlopen'.
@@ -98,12 +91,7 @@ packRTLDFlag :: RTLDFlags -> CInt
 packRTLDFlag RTLD_LAZY = #const RTLD_LAZY
 packRTLDFlag RTLD_NOW = #const RTLD_NOW
 packRTLDFlag RTLD_GLOBAL = #const RTLD_GLOBAL
-
-#ifdef HAVE_RTLDLOCAL
 packRTLDFlag RTLD_LOCAL = #const RTLD_LOCAL
-#else /* HAVE_RTLDLOCAL */
-packRTLDFlag RTLD_LOCAL = error "RTLD_LOCAL not available"
-#endif /* HAVE_RTLDLOCAL */
 
 
 -- |Flags for 'System.Posix.DynamicLinker.dlsym'. Notice that 'Next'
diff --git a/configure.ac b/configure.ac
index ccb627b..41274dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,21 +155,6 @@ AC_EGREP_CPP(yes,
   AC_MSG_RESULT(no)
   ])    
 
-dnl ** RTLD_LOCAL isn't available on cygwin
-AC_MSG_CHECKING(for RTLD_LOCAL from dlfcn.h)
-AC_EGREP_CPP(yes,
-[
- #include <dlfcn.h>
- #ifdef RTLD_LOCAL
-        yes
- #endif
-], [
-  AC_MSG_RESULT(yes)
-  AC_DEFINE([HAVE_RTLDLOCAL], [1], [Define to 1 if RTLD_LOCAL is available.])
-], [
-  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