My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/pkgs/development/compilers/ghc/backport-dylib-command-size...

24 lines
1.1 KiB

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]) then [ "-Wl,-dead_strip_dylibs" ] 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