forked from input-output-hk/cardano-sl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ghc-8.0.2-darwin-rec-link.patch
24 lines (23 loc) · 1.13 KB
/
ghc-8.0.2-darwin-rec-link.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index acd0d61..3e83c15 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1916,6 +1916,7 @@ linkBinary' staticLink dflags o_files dep_packages = do
++ pkg_framework_opts
++ debug_opts
++ thread_opts
+ ++ (if (platformOS platform `elem` [OSDarwin, OSiOS]) then [ "-Wl,-dead_strip_dylibs", "-Wl,-dead_strip" ] else [])
))
exeFileName :: Bool -> DynFlags -> FilePath
diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs
index 1ab5b13..2ebbf51 100644
--- a/compiler/main/SysTools.hs
+++ b/compiler/main/SysTools.hs
@@ -1737,6 +1737,7 @@ linkDynLib dflags0 o_files dep_packages
++ map Option pkg_lib_path_opts
++ map Option pkg_link_opts
++ map Option pkg_framework_opts
+ ++ [ Option "-Wl,-dead_strip_dylibs" ]
)
OSiOS -> throwGhcExceptionIO (ProgramError "dynamic libraries are not supported on iOS target")
_ -> do