[commit: ghc] master: Fix annoying iOS linker warnings (#8208) (0451d85)
git at git.haskell.org
git at git.haskell.org
Thu Sep 5 00:36:40 CEST 2013
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/0451d85d58363f8ce7ce552c19a00f9d535e6fed/ghc
>---------------------------------------------------------------
commit 0451d85d58363f8ce7ce552c19a00f9d535e6fed
Author: Austin Seipp <aseipp at pobox.com>
Date: Wed Sep 4 17:35:53 2013 -0500
Fix annoying iOS linker warnings (#8208)
Authored-by: Luke Iannini <lukexi at me.com>
Signed-off-by: Austin Seipp <aseipp at pobox.com>
>---------------------------------------------------------------
0451d85d58363f8ce7ce552c19a00f9d535e6fed
compiler/main/DriverPipeline.hs | 15 +++++++++++++--
compiler/main/SysTools.lhs | 3 +++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 8fc44ed..7c5bc90 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1917,11 +1917,22 @@ linkBinary' staticLink dflags o_files dep_packages = do
-- on x86.
++ (if sLdSupportsCompactUnwind mySettings &&
not staticLink &&
- platformOS platform == OSDarwin &&
- platformArch platform `elem` [ArchX86, ArchX86_64]
+ (platformOS platform == OSDarwin || platformOS platform == OSiOS) &&
+ case platformArch platform of
+ ArchX86 -> True
+ ArchX86_64 -> True
+ ArchARM {} -> True
+ _ -> False
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.lhs b/compiler/main/SysTools.lhs
index 6fe29a9..78255b7 100644
--- a/compiler/main/SysTools.lhs
+++ b/compiler/main/SysTools.lhs
@@ -681,6 +681,9 @@ getLinkerInfo' dflags = do
-- that doesn't support --version. We can just assume that's
-- what we're using.
return $ DarwinLD []
+ OSiOS ->
+ -- Ditto for iOS
+ return $ DarwinLD []
OSMinGW32 ->
-- GHC doesn't support anything but GNU ld on Windows anyway.
-- Process creation is also fairly expensive on win32, so
More information about the ghc-commits
mailing list