From 0c51929cf6c3a7fd1850daf4124b3c28da1175db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Sun, 13 Jan 2013 18:48:24 +0100 Subject: [PATCH] Skip linking on -fno-code --- Cabal/Distribution/Simple/GHC.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Cabal/Distribution/Simple/GHC.hs b/Cabal/Distribution/Simple/GHC.hs index ba50aae3944..930362b2fb4 100644 --- a/Cabal/Distribution/Simple/GHC.hs +++ b/Cabal/Distribution/Simple/GHC.hs @@ -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) @@ -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