+dieWith span msg = throwDyn (ProgramError (showSDoc (mkLocMessage span msg)))
+
+
+checkNonStdWay :: DynFlags -> SrcSpan -> IO (Maybe String)
+checkNonStdWay dflags srcspan = do
+ tag <- readIORef v_Build_tag
+ if null tag then return Nothing else do
+ let default_osuf = phaseInputExt StopLn
+ if objectSuf dflags == default_osuf
+ then failNonStd srcspan
+ else return (Just default_osuf)
+
+failNonStd srcspan = dieWith srcspan $
+ ptext SLIT("Dynamic linking required, but this is a non-standard build (eg. prof).") $$
+ ptext SLIT("You need to build the program twice: once the normal way, and then") $$
+ ptext SLIT("in the desired way using -osuf to set the object file suffix.")
+