Skip to content

-odir changes output name of main module

When the main module is not named Main.hs, ghc -c
Foo.hs normally creates Foo.hi and Foo.o, but if you
add an -odir flag, ghc will instead produce Foo.hi and
Main.o. This seriously breaks building multiple
executables from the same files but with different main
modules.
Trac metadata
Trac field Value
Version 6.2.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution ResolvedNoReason
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information