------ Debugging ----------------------------------------------------
, Flag "dppr-debug" (PassFlag addOpt) Supported
, Flag "dsuppress-uniques" (PassFlag addOpt) Supported
+ , Flag "dsuppress-coercions" (PassFlag addOpt) Supported
, Flag "dppr-user-length" (AnySuffix addOpt) Supported
, Flag "dopt-fuel" (AnySuffix addOpt) Supported
, Flag "dno-debug-output" (PassFlag addOpt) Supported
, Flag "Rghc-timing" (NoArg (enableTimingStats)) Supported
------ Compiler flags -----------------------------------------------
+
+ -- -fPIC requires extra checking: only the NCG supports it.
+ -- See also DynFlags.parseDynamicFlags.
+ , Flag "fPIC" (PassFlag setPIC) Supported
+
-- All other "-fno-<blah>" options cancel out "-f<blah>" on the hsc cmdline
, Flag "fno-"
(PrefixPred (\s -> isStaticFlag ("f"++s)) (\s -> removeOpt ("-f"++s)))
, Flag "f" (AnySuffixPred isStaticFlag addOpt) Supported
]
+setPIC :: String -> IO ()
+setPIC | cGhcWithNativeCodeGen == "YES" || cGhcUnregisterised == "YES"
+ = addOpt
+ | otherwise
+ = ghcError $ CmdLineError "-fPIC is not supported on this platform"
+
isStaticFlag :: String -> Bool
isStaticFlag f =
f `elem` [