diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-03-18 22:48:43 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-03-18 23:42:53 +0000 |
commit | c53ea7c7467a149ff753b907535025634c62dda4 (patch) | |
tree | b0b6779a9c477322310d68dc327095c47921f0aa /compiler/main | |
parent | 01efdd6c4b066fbfdf17c6d2b1cad0fd651d334a (diff) | |
download | haskell-c53ea7c7467a149ff753b907535025634c62dda4.tar.gz |
Add support for OSX ld's -filelist flag
Without it, when linking the split objects for Language.Haskell.TH.Syntax,
the commandline was too long when listing all the files directly.
Diffstat (limited to 'compiler/main')
-rw-r--r-- | compiler/main/DriverPipeline.hs | 6 | ||||
-rw-r--r-- | compiler/main/DynFlags.hs | 1 | ||||
-rw-r--r-- | compiler/main/SysTools.lhs | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index fdae0fa20e..bdc2e8e812 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -2134,6 +2134,12 @@ joinObjectFiles dflags o_files output_fn = do script <- newTempName dflags "ldscript" writeFile script $ "INPUT(" ++ unwords o_files ++ ")" ld_r [SysTools.FileOption "" script] + else if sLdSupportsFilelist mySettings + then do + filelist <- newTempName dflags "filelist" + writeFile filelist $ unlines o_files + ld_r [SysTools.Option "-Wl,-filelist", + SysTools.FileOption "-Wl," filelist] else do ld_r (map (SysTools.FileOption "") o_files) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index dbec98a21b..17484e0ddd 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -758,6 +758,7 @@ data Settings = Settings { sSystemPackageConfig :: FilePath, sLdSupportsCompactUnwind :: Bool, sLdSupportsBuildId :: Bool, + sLdSupportsFilelist :: Bool, sLdIsGnuLd :: Bool, -- commands for particular phases sPgm_L :: String, diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs index 79af4f6673..bacd53e937 100644 --- a/compiler/main/SysTools.lhs +++ b/compiler/main/SysTools.lhs @@ -243,6 +243,7 @@ initSysTools mbMinusB ++ tntc_gcc_args) ldSupportsCompactUnwind <- getBooleanSetting "ld supports compact unwind" ldSupportsBuildId <- getBooleanSetting "ld supports build-id" + ldSupportsFilelist <- getBooleanSetting "ld supports filelist" ldIsGnuLd <- getBooleanSetting "ld is GNU ld" perl_path <- getSetting "perl command" @@ -315,6 +316,7 @@ initSysTools mbMinusB sSystemPackageConfig = pkgconfig_path, sLdSupportsCompactUnwind = ldSupportsCompactUnwind, sLdSupportsBuildId = ldSupportsBuildId, + sLdSupportsFilelist = ldSupportsFilelist, sLdIsGnuLd = ldIsGnuLd, sPgm_L = unlit_path, sPgm_P = (cpp_prog, cpp_args), |