#1424: Argument corruption in FFI with many arguments (maybe 64-bit related)
-------------------------------+--------------------------------------------
Reporter: guest | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (FFI) | Version: 6.6.1
Severity: normal | Resolution:
Keywords: ffi | Difficulty: Unknown
Os: Linux | Testcase:
Architecture: x86_64 (amd64) |
-------------------------------+--------------------------------------------
Comment (by guest):
Thanks Isaac, you're spot on. The stdio.h didn't change anything, but
-fvia-C did. I changed the ghc invocation to "ghc --make Ffi c.o -fvia-C"
and it gives the correct output:
{{{
[EMAIL PROTECTED]:~/dev/haskell/ffi$ gcc -c c.c
[EMAIL PROTECTED]:~/dev/haskell/ffi$ ghc --make Ffi c.o -fvia-C
[1 of 1] Compiling Main ( Ffi.hs, Ffi.o )
/tmp/ghc6721_0/ghc6721_0.hc: In function ‘sYX_entry’:
/tmp/ghc6721_0/ghc6721_0.hc:762:0:
warning: implicit declaration of function ‘fC’
Linking Ffi ...
[EMAIL PROTECTED]:~/dev/haskell/ffi$ ./Ffi
[1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0]
1.000000 2.000000 3.000000 4.000000 5.000000 6.000000 7.000000 8.000000
9.000000 10.000000
}}}
Using -fasm instead of -fvia-C gives the incorrect output.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1424>
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