Skip to content

Commit

Permalink
Skip linking on -fno-code
Browse files Browse the repository at this point in the history
  • Loading branch information
nh2 committed Jan 13, 2013
1 parent fa5e0e8 commit 0c51929
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Cabal/Distribution/Simple/GHC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ buildLib verbosity pkg_descr lbi lib clbi = do

(ghcProg, _) <- requireProgram verbosity ghcProgram (withPrograms lbi)
let runGhcProg = runGHC verbosity ghcProg
skipCodegen = "-fno-code" `elem` programOverrideArgs ghcProg

libBi <- hackThreadedFlag verbosity
comp (withProfLib lbi) (libBuildInfo lib)
Expand Down Expand Up @@ -705,8 +706,11 @@ buildLib verbosity pkg_descr lbi lib clbi = do
| ghcVersion < Version [7,2] [] -- ghc-7.2+ does not make _stub.o files
, x <- libModules lib ]

hObjs <- getHaskellObjects lib lbi
hObjs <-
if not skipCodegen
then getHaskellObjects lib lbi
pref objExtension True
else return []
hProfObjs <-
if (withProfLib lbi)
then getHaskellObjects lib lbi
Expand Down

0 comments on commit 0c51929

Please sign in to comment.