[commit: ghc] master: rts/Linker.c: Drop support for legacy OS X dyn loading (776d55c)

git at git.haskell.org git at git.haskell.org
Thu Oct 29 02:02:00 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/776d55c89fb657706b5476c32629fd032ea54596/ghc

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

commit 776d55c89fb657706b5476c32629fd032ea54596
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Thu Oct 29 12:59:30 2015 +1100

    rts/Linker.c: Drop support for legacy OS X dyn loading
    
    Drop support for old OS X (OS X 10.2 and earlier) dynamic linking.
    10.3 was released in 2003.
    
    Test Plan: Validate on OS X and Linux.
    
    Reviewers: bgamari, thomie, austin
    
    Reviewed By: thomie, austin
    
    Differential Revision: https://phabricator.haskell.org/D1393


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

776d55c89fb657706b5476c32629fd032ea54596
 rts/Linker.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/rts/Linker.c b/rts/Linker.c
index 6be9a5a..98969b9 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -107,9 +107,6 @@
 #  include <mach-o/loader.h>
 #  include <mach-o/nlist.h>
 #  include <mach-o/reloc.h>
-#if !defined(HAVE_DLFCN_H)
-#  include <mach-o/dyld.h>
-#endif
 #if defined(powerpc_HOST_ARCH)
 #  include <mach-o/ppc/reloc.h>
 #endif
@@ -914,11 +911,8 @@ static void* lookupSymbol_ (char *lbl)
 #       if defined(OBJFORMAT_ELF)
         return internal_dlsym(lbl);
 #       elif defined(OBJFORMAT_MACHO)
-#       if HAVE_DLFCN_H
-        /* On OS X 10.3 and later, we use dlsym instead of the old legacy
-           interface.
 
-           HACK: On OS X, all symbols are prefixed with an underscore.
+        /* HACK: On OS X, all symbols are prefixed with an underscore.
                  However, dlsym wants us to omit the leading underscore from the
                  symbol name -- the dlsym routine puts it back on before searching
                  for the symbol. For now, we simply strip it off here (and ONLY
@@ -927,14 +921,6 @@ static void* lookupSymbol_ (char *lbl)
         IF_DEBUG(linker, debugBelch("lookupSymbol: looking up %s with dlsym\n", lbl));
         ASSERT(lbl[0] == '_');
         return internal_dlsym(lbl + 1);
-#       else
-        if (NSIsSymbolNameDefined(lbl)) {
-            NSSymbol symbol = NSLookupAndBindSymbol(lbl);
-            return NSAddressOfSymbol(symbol);
-        } else {
-            return NULL;
-        }
-#       endif /* HAVE_DLFCN_H */
 #       elif defined(OBJFORMAT_PEi386)
         void* sym;
 



More information about the ghc-commits mailing list