summaryrefslogtreecommitdiff
path: root/compiler/main/SysTools.lhs
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-08-21 15:15:53 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-08-21 15:15:53 +0000
commit2ebe8addfaae2bc65e6b87ad369928b02053014f (patch)
tree40444e55dd6b6a6c3d1b575203b9ed140157f9dc /compiler/main/SysTools.lhs
parent04a42d01c41923baf66eacabf6ffb22dfe367108 (diff)
downloadhaskell-2ebe8addfaae2bc65e6b87ad369928b02053014f.tar.gz
FIX #1427, #1569: gcc 4.2.x needs -fno-toplevel-reorder
We now have various flags that need to be passed to gcc, but only if the local gcc version supports them. So instead of wiring this knowledge into ghc when it is built, we now put these "extra gcc flags" into a text file in $libdir, extra-gcc-flags, which is created by configure. It is also created by the configure script of a binary distribution, so a binary dist is independent of the gcc version used to build it. Hopefully I got the binary-dist stuff right, but binary dists aren't currently working so we'll need to come back and check this.
Diffstat (limited to 'compiler/main/SysTools.lhs')
-rw-r--r--compiler/main/SysTools.lhs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
index 64e7b7803f..e098dd9eab 100644
--- a/compiler/main/SysTools.lhs
+++ b/compiler/main/SysTools.lhs
@@ -22,6 +22,7 @@ module SysTools (
copy,
copyWithHeader,
normalisePath, -- FilePath -> FilePath
+ getExtraViaCOpts,
-- Temporary-file management
setTmpDir,
@@ -536,6 +537,10 @@ copyWithHeader dflags purpose maybe_header from to = do
hPutStr h ls
hClose h
+getExtraViaCOpts :: DynFlags -> IO [String]
+getExtraViaCOpts dflags = do
+ f <- readFile (topDir dflags `joinFileName` "extra-gcc-opts")
+ return (words f)
\end{code}
%************************************************************************