Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
3aeb4970
Commit
3aeb4970
authored
Dec 12, 2014
by
Mikhail Glushenkov
Browse files
Also build profiling C objs with '-fPIC' when GHC is dynamic.
parent
e4001b99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Cabal/Distribution/Simple/GHC.hs
View file @
3aeb4970
...
...
@@ -795,8 +795,13 @@ buildOrReplLib forRepl verbosity numJobs pkg_descr lbi lib clbi = do
unless
(
null
(
cSources
libBi
))
$
do
info
verbosity
"Building C Sources..."
sequence_
[
do
let
vanillaCcOpts
=
(
componentCcGhcOptions
verbosity
lbi
libBi
clbi
libTargetDir
filename
)
[
do
let
baseCcOpts
=
componentCcGhcOptions
verbosity
lbi
libBi
clbi
libTargetDir
filename
vanillaCcOpts
=
if
isGhcDynamic
-- Dynamic GHC requires C sources to be built
-- with -fPIC for REPL to work. See #2207.
then
baseCcOpts
{
ghcOptFPic
=
toFlag
True
}
else
baseCcOpts
profCcOpts
=
vanillaCcOpts
`
mappend
`
mempty
{
ghcOptProfilingMode
=
toFlag
True
,
ghcOptObjSuffix
=
toFlag
"p_o"
...
...
@@ -808,11 +813,7 @@ buildOrReplLib forRepl verbosity numJobs pkg_descr lbi lib clbi = do
}
odir
=
fromFlag
(
ghcOptObjDir
vanillaCcOpts
)
createDirectoryIfMissingVerbose
verbosity
True
odir
runGhcProg
(
if
isGhcDynamic
-- Dynamic GHC requires C sources to be built with
-- -fPIC for REPL to work. See #2207.
then
vanillaCcOpts
{
ghcOptFPic
=
toFlag
True
}
else
vanillaCcOpts
)
runGhcProg
vanillaCcOpts
unless
forRepl
$
whenSharedLib
forceSharedLib
(
runGhcProg
sharedCcOpts
)
unless
forRepl
$
whenProfLib
(
runGhcProg
profCcOpts
)
...
...
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