Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
f5e2ccab
Commit
f5e2ccab
authored
Mar 14, 2013
by
ian@well-typed.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set the way to 'dynamic' when running GHCi if GHCi is dynamically linked
parent
b7126674
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
23 deletions
+37
-23
compiler/main/DynFlags.hs
compiler/main/DynFlags.hs
+4
-4
compiler/utils/Fingerprint.hsc
compiler/utils/Fingerprint.hsc
+1
-0
ghc/Main.hs
ghc/Main.hs
+32
-19
No files found.
compiler/main/DynFlags.hs
View file @
f5e2ccab
...
...
@@ -50,7 +50,8 @@ module DynFlags (
printOutputForUser
,
printInfoForUser
,
Way
(
..
),
mkBuildTag
,
wayRTSOnly
,
Way
(
..
),
mkBuildTag
,
wayRTSOnly
,
updateWays
,
wayGeneralFlags
,
-- ** Safe Haskell
SafeHaskellMode
(
..
),
...
...
@@ -1847,11 +1848,10 @@ parseDynamicFlagsFull activeFlags cmdline dflags0 args = do
updateWays
::
DynFlags
->
DynFlags
updateWays
dflags
=
let
theWays
=
sort
$
nub
$
ways
dflags
theBuildTag
=
mkBuildTag
(
filter
(
not
.
wayRTSOnly
)
theWays
)
in
dflags
{
ways
=
theWays
,
buildTag
=
theBuildTag
,
rtsBuildTag
=
mkBuildTag
theWays
buildTag
=
mkBuildTag
(
filter
(
not
.
wayRTSOnly
)
theWays
)
,
rtsBuildTag
=
mkBuildTag
theWays
}
-- | Check (and potentially disable) any extensions that aren't allowed
...
...
compiler/utils/Fingerprint.hsc
View file @
f5e2ccab
...
...
@@ -8,6 +8,7 @@
--
-- ----------------------------------------------------------------------------
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Fingerprint (
Fingerprint(..), fingerprint0,
readHexFingerprint,
...
...
ghc/Main.hs
View file @
f5e2ccab
...
...
@@ -143,7 +143,15 @@ main' postLoadMode dflags0 args flagWarnings = do
DoAbiHash
->
(
OneShot
,
dflt_target
,
LinkBinary
)
_
->
(
OneShot
,
dflt_target
,
LinkBinary
)
let
dflags1
=
dflags0
{
ghcMode
=
mode
,
let
dflags1
=
case
lang
of
HscInterpreted
->
let
interpWayGeneralFlags
=
concatMap
(
wayGeneralFlags
(
targetPlatform
dflags0
))
interpWays
in
foldl
gopt_set
(
updateWays
$
dflags0
{
ways
=
interpWays
})
interpWayGeneralFlags
_
->
dflags0
dflags2
=
dflags1
{
ghcMode
=
mode
,
hscTarget
=
lang
,
ghcLink
=
link
,
-- leave out hscOutName for now
...
...
@@ -157,28 +165,28 @@ main' postLoadMode dflags0 args flagWarnings = do
-- can be overriden from the command-line
-- XXX: this should really be in the interactive DynFlags, but
-- we don't set that until later in interactiveUI
dflags
1a
|
DoInteractive
<-
postLoadMode
=
imp_qual_enabled
dflags
3
|
DoInteractive
<-
postLoadMode
=
imp_qual_enabled
|
DoEval
_
<-
postLoadMode
=
imp_qual_enabled
|
otherwise
=
dflags1
where
imp_qual_enabled
=
dflags
1
`
gopt_set
`
Opt_ImplicitImportQualified
|
otherwise
=
dflags2
where
imp_qual_enabled
=
dflags
2
`
gopt_set
`
Opt_ImplicitImportQualified
-- The rest of the arguments are "dynamic"
-- Leftover ones are presumably files
(
dflags
2
,
fileish_args
,
dynamicFlagWarnings
)
<-
GHC
.
parseDynamicFlags
dflags1a
args
(
dflags
4
,
fileish_args
,
dynamicFlagWarnings
)
<-
GHC
.
parseDynamicFlags
dflags3
args
GHC
.
prettyPrintGhcErrors
dflags
2
$
do
GHC
.
prettyPrintGhcErrors
dflags
4
$
do
let
flagWarnings'
=
flagWarnings
++
dynamicFlagWarnings
handleSourceError
(
\
e
->
do
GHC
.
printException
e
liftIO
$
exitWith
(
ExitFailure
1
))
$
do
liftIO
$
handleFlagWarnings
dflags
2
flagWarnings'
liftIO
$
handleFlagWarnings
dflags
4
flagWarnings'
-- make sure we clean up after ourselves
GHC
.
defaultCleanupHandler
dflags
2
$
do
GHC
.
defaultCleanupHandler
dflags
4
$
do
liftIO
$
showBanner
postLoadMode
dflags
2
liftIO
$
showBanner
postLoadMode
dflags
4
let
-- To simplify the handling of filepaths, we normalise all filepaths right
...
...
@@ -187,29 +195,29 @@ main' postLoadMode dflags0 args flagWarnings = do
normal_fileish_paths
=
map
(
normalise
.
unLoc
)
fileish_args
(
srcs
,
objs
)
=
partition_args
normal_fileish_paths
[]
[]
dflags
2a
=
dflags2
{
ldInputs
=
objs
++
ldInputs
dflags2
}
dflags
5
=
dflags4
{
ldInputs
=
objs
++
ldInputs
dflags4
}
-- we've finished manipulating the DynFlags, update the session
_
<-
GHC
.
setSessionDynFlags
dflags
2a
dflags
3
<-
GHC
.
getSessionDynFlags
_
<-
GHC
.
setSessionDynFlags
dflags
5
dflags
6
<-
GHC
.
getSessionDynFlags
hsc_env
<-
GHC
.
getSession
---------------- Display configuration -----------
when
(
verbosity
dflags
3
>=
4
)
$
liftIO
$
dumpPackages
dflags
3
when
(
verbosity
dflags
6
>=
4
)
$
liftIO
$
dumpPackages
dflags
6
when
(
verbosity
dflags
3
>=
3
)
$
do
when
(
verbosity
dflags
6
>=
3
)
$
do
liftIO
$
hPutStrLn
stderr
(
"Hsc static flags: "
++
unwords
staticFlags
)
---------------- Final sanity checking -----------
liftIO
$
checkOptions
postLoadMode
dflags
3
srcs
objs
liftIO
$
checkOptions
postLoadMode
dflags
6
srcs
objs
---------------- Do the business -----------
handleSourceError
(
\
e
->
do
GHC
.
printException
e
liftIO
$
exitWith
(
ExitFailure
1
))
$
do
case
postLoadMode
of
ShowInterface
f
->
liftIO
$
doShowIface
dflags
3
f
ShowInterface
f
->
liftIO
$
doShowIface
dflags
6
f
DoMake
->
doMake
srcs
DoMkDependHS
->
doMkDependHS
(
map
fst
srcs
)
StopBefore
p
->
liftIO
(
oneShot
hsc_env
p
srcs
)
...
...
@@ -217,7 +225,7 @@ main' postLoadMode dflags0 args flagWarnings = do
DoEval
exprs
->
ghciUI
srcs
$
Just
$
reverse
exprs
DoAbiHash
->
abiHash
srcs
liftIO
$
dumpFinalStats
dflags
3
liftIO
$
dumpFinalStats
dflags
6
ghciUI
::
[(
FilePath
,
Maybe
Phase
)]
->
Maybe
[
String
]
->
Ghc
()
#
ifndef
GHCI
...
...
@@ -226,6 +234,11 @@ ghciUI _ _ = throwGhcException (CmdLineError "not built for interactive use")
ghciUI
=
interactiveUI
defaultGhciSettings
#
endif
interpWays
::
[
Way
]
interpWays
=
if
cDYNAMIC_GHC_PROGRAMS
then
[
WayDyn
]
else
[]
-- -----------------------------------------------------------------------------
-- Splitting arguments into source files and object files. This is where we
-- interpret the -x <suffix> option, and attach a (Maybe Phase) to each source
...
...
@@ -290,7 +303,7 @@ checkOptions mode dflags srcs objs = do
hPutStrLn
stderr
(
"Warning: -debug, -threaded and -ticky are ignored by GHCi"
)
-- -prof and --interactive are not a good combination
when
((
filter
(
not
.
wayRTSOnly
)
(
ways
dflags
)
/=
defaultWays
(
settings
dflags
)
)
when
((
filter
(
not
.
wayRTSOnly
)
(
ways
dflags
)
/=
interpWays
)
&&
isInterpretiveMode
mode
)
$
do
throwGhcException
(
UsageError
"--interactive can't be used with -prof or -unreg."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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