#2897: HsFFI.h is not in the default include path for hsc2hs
---------------------------+------------------------------------------------
Reporter: cjs | Owner:
Type: bug | Status: new
Priority: highest | Milestone: 7.4.1
Component: hsc2hs | Version: 6.10.1
Resolution: | Keywords:
Testcase: | Blockedby:
Difficulty: Unknown | Os: Unknown/Multiple
Blocking: | Architecture: Unknown/Multiple
Failure: None/Unknown |
---------------------------+------------------------------------------------
Changes (by simonmar):
* priority: normal => highest
* status: closed => new
* resolution: fixed =>
* milestone: 7.2.1 => 7.4.1
Comment:
This fix has caused problems on my machine:
`System.Posix.modificationTime` is using the wrong offset into the stat
structure.
I tracked it down, and the reason is that the C file generated by hsc2hs
now include `template-hsc.h` before anything else, and this header
includes some other standard headers (stdlib.h etc.). This means that
after including `template-hsc.h` it is too late to #define
`_FILE_OFFSET_BITS` to be 64. It worked before because `HsFFI.h` was
included first, and that included `ghcautoconf.h` which set
_FILE_OFFSET_BITS to 64.
So I'm not sure what the right fix is here. The way it worked before was
fragile, so I'm not surprised it broke.
hsc2hs never puts anything before #include "template-hsc.h", but we could
make it put `--include` headers in front. However, we would then have to
arrange to pass the right `--include` options to hsc2hs, which means
modifying both Cabal and GHC's build system to do that (and which headers?
the ones from the includes: line in the .cabal file?).
Any ideas? I'm backing out this patch in my tree for now.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2897#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs