diff options
-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 - |