diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2017-04-12 14:12:33 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-04-12 14:53:07 -0400 |
commit | 68c00a1b38707b2a5c813cbe3da3ffb7d97893b6 (patch) | |
tree | 5e07cc8cc72b41ca66ff2e6dcf86085b1217c798 | |
parent | 8121748dd79d648342fca2704122197c406a18e9 (diff) | |
download | haskell-68c00a1b38707b2a5c813cbe3da3ffb7d97893b6.tar.gz |
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
-rw-r--r-- | compiler/main/DriverPipeline.hs | 9 | ||||
-rw-r--r-- | compiler/main/DynFlags.hs | 9 | ||||
-rw-r--r-- | compiler/main/SysTools.hs | 3 | ||||
-rw-r--r-- | compiler/utils/Platform.hs | 9 |
4 files changed, 3 insertions, 27 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index df1ffd5c68..8e21b092e9 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 @@ -1953,13 +1953,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/DynFlags.hs b/compiler/main/DynFlags.hs index 07e951737e..70efc544e2 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -5176,15 +5176,6 @@ makeDynFlagsConsistent dflags = let dflags' = dflags { hscTarget = HscLlvm } warn = "No native code generator, so using LLVM" in loop dflags' warn - | hscTarget dflags == HscLlvm && - not ((arch == ArchX86_64) && (os == OSLinux || os == OSDarwin || os == OSFreeBSD)) && - not ((isARM arch) && (os == OSLinux)) && - (gopt Opt_PIC dflags || WayDyn `elem` ways dflags) - = if cGhcWithNativeCodeGen == "YES" - then let dflags' = dflags { hscTarget = HscAsm } - warn = "Using native code generator rather than LLVM, as LLVM is incompatible with -fPIC and -dynamic on this platform" - in loop dflags' warn - else throwGhcException $ CmdLineError "Can't use -fPIC or -dynamic on this platform" | os == OSDarwin && arch == ArchX86_64 && not (gopt Opt_PIC dflags) diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs index fd3faf1851..16f8d1aa79 100644 --- a/compiler/main/SysTools.hs +++ b/compiler/main/SysTools.hs @@ -1663,7 +1663,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 ------------------------------------------------------------------- @@ -1723,7 +1723,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 86c70a9789..7f749708b9 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 - |