Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
5d0fce85
Commit
5d0fce85
authored
Jul 16, 2012
by
Ian Lynagh
Browse files
Make a picPOpts function
We now handle the preprocessor options the same way as the gcc options (picCCOpts).
parent
d6c1311a
Changes
4
Hide whitespace changes
Inline
Side-by-side
compiler/iface/FlagChecker.hs
View file @
5d0fce85
...
...
@@ -25,7 +25,7 @@ import System.FilePath (normalise)
fingerprintDynFlags
::
DynFlags
->
Module
->
(
BinHandle
->
Name
->
IO
()
)
->
IO
Fingerprint
fingerprintDynFlags
DynFlags
{
..
}
this_mod
nameio
=
fingerprintDynFlags
dflags
@
DynFlags
{
..
}
this_mod
nameio
=
let
mainis
=
if
mainModIs
==
this_mod
then
Just
mainFunIs
else
Nothing
-- see #5878
-- pkgopts = (thisPackage dflags, sort $ packageFlags dflags)
...
...
@@ -37,7 +37,7 @@ fingerprintDynFlags DynFlags{..} this_mod nameio =
IntSet
.
toList
$
extensionFlags
)
-- -I, -D and -U flags affect CPP
cpp
=
(
map
normalise
includePaths
,
sO
pt_P
setting
s
)
cpp
=
(
map
normalise
includePaths
,
o
pt_P
dflags
++
picPOpt
s
)
-- normalise: eliminate spurious differences due to "./foo" vs "foo"
-- Note [path flags and recompilation]
...
...
compiler/main/DriverPipeline.hs
View file @
5d0fce85
...
...
@@ -2036,7 +2036,7 @@ linkDynLib dflags o_files dep_packages = do
doCpp
::
DynFlags
->
Bool
->
Bool
->
FilePath
->
FilePath
->
IO
()
doCpp
dflags
raw
include_cc_opts
input_fn
output_fn
=
do
let
hscpp_opts
=
getOpts
dflags
opt_P
let
hscpp_opts
=
getOpts
dflags
opt_P
++
picPOpts
let
cmdline_include_paths
=
includePaths
dflags
pkg_include_dirs
<-
getPackageIncludePath
dflags
[]
...
...
compiler/main/DynFlags.hs
View file @
5d0fce85
...
...
@@ -94,7 +94,7 @@ module DynFlags (
supportedLanguagesAndExtensions
,
-- ** DynFlag C compiler options
picCCOpts
,
picCCOpts
,
picPOpts
,
-- * Configuration of the stg-to-stg passes
StgToDo
(
..
),
...
...
@@ -2796,6 +2796,11 @@ picCCOpts dflags
|
opt_PIC
||
not
opt_Static
->
[
"-fPIC"
,
"-U __PIC__"
,
"-D__PIC__"
]
|
otherwise
->
[]
picPOpts
::
[
String
]
picPOpts
|
opt_PIC
=
[
"-U __PIC__"
,
"-D__PIC__"
]
|
otherwise
=
[]
-- -----------------------------------------------------------------------------
-- Splitting
...
...
compiler/main/SysTools.lhs
View file @
5d0fce85
...
...
@@ -50,7 +50,6 @@ import Panic
import Platform
import Util
import DynFlags
import StaticFlags
import Exception
import Data.IORef
...
...
@@ -295,10 +294,7 @@ initSysTools mbMinusB
-- Hans: this isn't right in general, but you can
-- elaborate it in the same way as the others
sOpt_L = [],
sOpt_P = (if opt_PIC
then -- this list gets reversed
["-D__PIC__", "-U __PIC__"]
else []),
sOpt_P = [],
sOpt_F = [],
sOpt_c = [],
sOpt_a = [],
...
...
Write
Preview
Supports
Markdown
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