diff options
| author | Michael Smith <michael@diglumi.com> | 2015-07-23 11:41:16 +0200 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2015-07-23 11:41:48 +0200 |
| commit | d2b4df157532adf014789ae9b2496f88369e43ea (patch) | |
| tree | 6e54da248af3ae13ca51abfe89b40e33914cdf82 /compiler | |
| parent | d784bdeb62a6b11831c5235a97449ff2a86dcc52 (diff) | |
| download | haskell-d2b4df157532adf014789ae9b2496f88369e43ea.tar.gz | |
Generate .dyn_o files for .hsig files with -dynamic-too
With -dynamic-too, .dyn_o files were not being generated for .hsig
files. Normally, this is handled in the pipeline; however, the branch
for .hsig files called compileEmptyStub directly instead of going
through runPipeline. When compiling a Cabal package that included .hsig
files, this triggered a linker error later on, as it expected a .dyn_o
file to have been generated for each .hsig.
The fix is to use runPipeline for .hsig files, just as with .hs files.
Alternately, one could duplicate the logic for handling -dynamic-too in
the .hsig branch, but simply calling runPipeline ends up being much
cleaner.
Test Plan: validate
Reviewers: austin, ezyang, bgamari, thomie
Reviewed By: ezyang, thomie
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1084
GHC Trac Issues: #10660
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/main/DriverPipeline.hs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index ff6e81d2a5..97e64c4a37 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -251,7 +251,18 @@ compileOne' m_tc_result mHscMessage do (iface, changed, details) <- hscSimpleIface hsc_env tc_result mb_old_hash hscWriteIface dflags iface changed summary - compileEmptyStub dflags hsc_env basename location + + -- #10660: Use the pipeline instead of calling + -- compileEmptyStub directly, so -dynamic-too gets + -- handled properly + let mod_name = ms_mod_name summary + _ <- runPipeline StopLn hsc_env + (output_fn, + Just (HscOut src_flavour mod_name HscUpdateSig)) + (Just basename) + Persistent + (Just location) + Nothing -- Same as Hs o_time <- getModificationUTCTime object_filename |
