Skip to content

GHC uses _stub.c files regardless of whether any 'foreign import' decls remain in a .hs file

It appears GHC links any _stub.o files it can find, which is not correct (although usually it only leads to duplicate symbols.) To duplicate, have two modules A and B, and a foreign import in A. A_stub.o will be built as usual. Copy A_stub.o to B_stub.o, relink and have duplicate symbols.

Trac metadata
Trac field Value
Version 6.4.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (FFI)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system MacOS X
Architecture powerpc
Edited by jcab@JCABs-Rumblings.com
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information