Opened 5 years ago

Closed 5 years ago

#9050 closed bug (fixed)

Panic when compiling cmm file together with -outputdir

Reported by: Yuras Owned by:
Priority: normal Milestone: 7.8.3
Component: Compiler Version: 7.8.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


To reproduce:

$ touch test.cmm
$ ghc -c test.cmm -outputdir=build
ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 7.9.20140428 for x86_64-unknown-linux):
	hscCmmFile: no_mod

The panic is declared in main/HscMain.hs:hscCompileCmmFile in place of current module name, but forced in main/CodeOutput.lhs:outputForeignStubs by doesFileExist.

It works without -outputdir because in that case module name is not used to create path to stub file, see main/Finder.lhs:mkStubPaths.

Attachments (1)

0001-Fix-compilation-of-cmm-files-with-outputdir-Trac-905.patch (1.7 KB) - added by Yuras 5 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 5 years ago by Yuras

Status: newpatch

This issue is a bit annoying for me. I'm working with manually written cmm files, and I'm using -outputdir option a lot.

I tried to replace the panic with dummy module, and it works. But I'm a bit concerned about module name clashes. Instead I removed the code that forces the thunk, ghc doesn't support compiling external core anyway.

Probably it is better to replace Module with Maybe Module to be explicit, but it leads to a huge diff.

comment:2 Changed 5 years ago by Yuras

I know everybody is busy with more important thinks. Just raising in case it was just lost. Could anyone take a look please?

Note: the code I want to delete is dead anyway because ghc doesn't support external core any more.

comment:3 Changed 5 years ago by Krzysztof Gogolewski <krz.gogolewski@…>

In 2a463ebeba4dff6793ae16707712f1e9245225e8/ghc:

Fix compilation of cmm files with -outputdir (Trac #9050)

comment:4 Changed 5 years ago by monoidal

Milestone: 7.8.3
Status: patchmerge

I've pushed; the change should be mergeable to 7.8, as Yuras said in comment:1.

comment:5 Changed 5 years ago by thoughtpolice

Resolution: fixed
Status: mergeclosed


Note: See TracTickets for help on using tickets.