[commit: ghc] ghc-8.2: Drop special handling of iOS (065babc)

git at git.haskell.org git at git.haskell.org
Sun Dec 23 18:46:42 UTC 2018


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

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/065babc7a1346886e369743a68a5367bf503fb72/ghc

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

commit 065babc7a1346886e369743a68a5367bf503fb72
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date:   Wed Apr 12 14:12:33 2017 -0400

    Drop special handling of iOS
    
    iOS at least since iOS8 (we are currently at iOS10.3), allows for
    dynamic libaries, hence any artificail restriction on dyanmic
    libraries should be lifted.
    
    Please ping me with any iOS related issues that should potentially
    resurface.  The iOS toolchain has considerably changed over the
    years, and I'm willing to drop work arounds in good faith.
    
    Reviewers: bgamari, austin
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #13559, #7722
    
    Differential Revision: https://phabricator.haskell.org/D3451
    
    (cherry picked from commit 68c00a1b38707b2a5c813cbe3da3ffb7d97893b6)


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

065babc7a1346886e369743a68a5367bf503fb72
 compiler/main/DriverPipeline.hs | 9 +--------
 compiler/main/SysTools.hs       | 3 +--
 compiler/utils/Platform.hs      | 9 +--------
 3 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 40e6a8d..f1038cf 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -378,7 +378,7 @@ link' dflags batch_attempt_linking hpt
         let
             staticLink = case ghcLink dflags of
                           LinkStaticLib -> True
-                          _ -> platformBinariesAreStaticLibs (targetPlatform dflags)
+                          _ -> False
 
             home_mod_infos = eltsHpt hpt
 
@@ -1952,13 +1952,6 @@ linkBinary' staticLink dflags o_files dep_packages = do
                           then ["-Wl,-no_compact_unwind"]
                           else [])
 
-                      -- '-no_pie'
-                      -- iOS uses 'dynamic-no-pic', so we must pass this to ld to suppress a warning; see #7722
-                      ++ (if platformOS platform == OSiOS &&
-                             not staticLink
-                          then ["-Wl,-no_pie"]
-                          else [])
-
                       -- '-Wl,-read_only_relocs,suppress'
                       -- ld gives loads of warnings like:
                       --     ld: warning: text reloc in _base_GHCziArr_unsafeArray_info to _base_GHCziArr_unsafeArray_closure
diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs
index b2d85a7..93927b4 100644
--- a/compiler/main/SysTools.hs
+++ b/compiler/main/SysTools.hs
@@ -1666,7 +1666,7 @@ linkDynLib dflags0 o_files dep_packages
                  ++ pkg_lib_path_opts
                  ++ pkg_link_opts
                 ))
-        OSDarwin -> do
+        _ | os `elem` [OSDarwin, OSiOS] -> do
             -------------------------------------------------------------------
             -- Making a darwin dylib
             -------------------------------------------------------------------
@@ -1726,7 +1726,6 @@ linkDynLib dflags0 o_files dep_packages
                  ++ map Option pkg_link_opts
                  ++ map Option pkg_framework_opts
               )
-        OSiOS -> throwGhcExceptionIO (ProgramError "dynamic libraries are not supported on iOS target")
         _ -> do
             -------------------------------------------------------------------
             -- Making a DSO
diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs
index 86c70a9..7f74970 100644
--- a/compiler/utils/Platform.hs
+++ b/compiler/utils/Platform.hs
@@ -16,7 +16,6 @@ module Platform (
         osMachOTarget,
         osSubsectionsViaSymbols,
         platformUsesFrameworks,
-        platformBinariesAreStaticLibs,
 )
 
 where
@@ -148,6 +147,7 @@ osElfTarget OSUnknown   = False
 -- | This predicate tells us whether the OS support Mach-O shared libraries.
 osMachOTarget :: OS -> Bool
 osMachOTarget OSDarwin = True
+osMachOTarget OSiOS    = True
 osMachOTarget _ = False
 
 osUsesFrameworks :: OS -> Bool
@@ -158,15 +158,8 @@ osUsesFrameworks _        = False
 platformUsesFrameworks :: Platform -> Bool
 platformUsesFrameworks = osUsesFrameworks . platformOS
 
-osBinariesAreStaticLibs :: OS -> Bool
-osBinariesAreStaticLibs OSiOS = True
-osBinariesAreStaticLibs _     = False
-
 osSubsectionsViaSymbols :: OS -> Bool
 osSubsectionsViaSymbols OSDarwin = True
 osSubsectionsViaSymbols OSiOS    = True
 osSubsectionsViaSymbols _        = False
 
-platformBinariesAreStaticLibs :: Platform -> Bool
-platformBinariesAreStaticLibs = osBinariesAreStaticLibs . platformOS
-



More information about the ghc-commits mailing list