
#15338: ghc-pkg misbehaves after possible miscompilation on m68k and sh4 -------------------------------------+------------------------------------- Reporter: glaubitz | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Linux | Architecture: m68k Type of failure: Incorrect result | Test Case: at runtime | Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by slyfox): Replying to [comment:3 slyfox]:
I'll keep debugging.
I think I understand breakage mechanics now:
The example above breaks because '''stdout''' haskell closure is evaluated
twice:
- once in the test binary
- once in shared library
and creates two objects. '''hFlush''' is called only for second (shared
library) object because it is called from there.
Duplication happens because '''base_GHCziIOziHandleziFD_stdout_closure'''
(closure behind '''System.IO.stdout''' object) is copied by the linker
'''COPY''' relocation:
{{{
$ objdump -R -D bug/ghc-pkg
00415248