Skip to content

Commit 0c51929

Browse files
committed
Skip linking on -fno-code
1 parent fa5e0e8 commit 0c51929

File tree

1 file changed

+5
-1
lines changed
  • Cabal/Distribution/Simple

1 file changed

+5
-1
lines changed

Cabal/Distribution/Simple/GHC.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ buildLib verbosity pkg_descr lbi lib clbi = do
620620

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

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

708-
hObjs <- getHaskellObjects lib lbi
709+
hObjs <-
710+
if not skipCodegen
711+
then getHaskellObjects lib lbi
709712
pref objExtension True
713+
else return []
710714
hProfObjs <-
711715
if (withProfLib lbi)
712716
then getHaskellObjects lib lbi

0 commit comments

Comments
 (0)