Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
6b17e71f
Commit
6b17e71f
authored
Mar 13, 2010
by
Ian Lynagh
Browse files
Add a -with-rtsopts link-time flag
You can now link with -with-rtsopts="-H128m -K1m"
parent
373978e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
compiler/main/DriverPipeline.hs
View file @
6b17e71f
...
...
@@ -1429,6 +1429,14 @@ linkBinary dflags o_files dep_packages = do
"const rtsBool rtsOptsEnabled = rtsTrue;"
]
return
[
fn
]
else
return
[]
rtsOptsObj
<-
case
rtsOpts
dflags
of
Just
opts
->
do
fn
<-
mkExtraCObj
dflags
-- We assume that the Haskell "show" does
-- the right thing here
[
"char *ghc_rts_opts = "
++
show
opts
++
";"
]
return
[
fn
]
Nothing
->
return
[]
pkg_link_opts
<-
getPackageLinkOpts
dflags
dep_packages
...
...
@@ -1504,6 +1512,7 @@ linkBinary dflags o_files dep_packages = do
++
pkg_lib_path_opts
++
main_lib
++
rtsEnabledObj
++
rtsOptsObj
++
pkg_link_opts
#
ifdef
darwin_TARGET_OS
++
pkg_framework_path_opts
...
...
compiler/main/DynFlags.hs
View file @
6b17e71f
...
...
@@ -407,6 +407,7 @@ data DynFlags = DynFlags {
ghcUsagePath
::
FilePath
,
-- Filled in by SysTools
ghciUsagePath
::
FilePath
,
-- ditto
rtsOpts
::
Maybe
String
,
hpcDir
::
String
,
-- ^ Path to store the .mix files
...
...
@@ -641,6 +642,7 @@ defaultDynFlags =
frameworkPaths
=
[]
,
cmdlineFrameworks
=
[]
,
tmpDir
=
cDEFAULT_TMPDIR
,
rtsOpts
=
Nothing
,
hpcDir
=
".hpc"
,
...
...
@@ -1110,6 +1112,7 @@ dynamic_flags = [
------- Miscellaneous ----------------------------------------------
,
Flag
"no-auto-link-packages"
(
NoArg
(
unSetDynFlag
Opt_AutoLinkPackages
))
Supported
,
Flag
"no-hs-main"
(
NoArg
(
setDynFlag
Opt_NoHsMain
))
Supported
,
Flag
"with-rtsopts"
(
HasArg
setRtsOpts
)
Supported
,
Flag
"rtsopts"
(
NoArg
(
setDynFlag
Opt_RtsOptsEnabled
))
Supported
,
Flag
"no-rtsopts"
(
NoArg
(
unSetDynFlag
Opt_RtsOptsEnabled
))
Supported
,
Flag
"main-is"
(
SepArg
setMainIs
)
Supported
...
...
@@ -2012,6 +2015,12 @@ setTmpDir dir dflags = dflags{ tmpDir = normalise dir }
-- we used to fix /cygdrive/c/.. on Windows, but this doesn't
-- seem necessary now --SDM 7/2/2008
-----------------------------------------------------------------------------
-- RTS opts
setRtsOpts
::
String
->
DynP
()
setRtsOpts
arg
=
upd
$
\
d
->
d
{
rtsOpts
=
Just
arg
}
-----------------------------------------------------------------------------
-- Hpc stuff
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment