id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
4133,-fvia-C option does not work on ppc with Linux,Mikolaj,,"Tested on the just released 6.12.3 and Debian's ghc6_6.12.1-13, processor type is 7447A:
{{{
mikolaj@bratek:~/Desktop$ ghc -fvia-C --make -O2 -Wall -XForeignFunctionInterface -o CallBacker CallBacker.hs callerback.c
[1 of 1] Compiling Main             ( CallBacker.hs, CallBacker.o )
Prologue junk?: 	.type	s1ds_ret, @function
s1ds_ret:
 # 20 ""/tmp/ghc1444_0/ghc1444_0.hc"" 1
}}}

Since some of the PowerPC assembler in GHC bitrotted, perhaps the port could be revived more cheaply with -fvia-C? Alas, it fails even for trivial code.

BTW, -funregisterised does not work, either:

{{{
mikolaj@bratek:~/Desktop$ ghc6 --make -funregisterised -O2 -Wall -XForeignFunctionInterface -o ffitest ffitest.hs callerback.c
[1 of 1] Compiling Main             ( ffitest.hs, ffitest.o )
Linking ffitest ...
ffitest.o: In function `r1ca_entry':
(.text+0xf0): undefined reference to `base_GHCziBase_unpackCStringzh_entry'
ffitest.o: In function `r1cc_entry':
(.text+0x118): undefined reference to `base_GHCziFloat_timesDouble_entry'
ffitest.o: In function `s1fu_entry':
(.text+0x180): undefined reference to `base_GHCziFloat_zdwzdsshowSignedFloat_entry'
ffitest.o: In function `s1fA_entry':
(.text+0x1e0): undefined reference to `base_GHCziFloat_zdwzdsshowSignedFloat_entry'
ffitest.o: In function `s1fB_ret':
(.text+0x238): undefined reference to `base_GHCziIOziHandleziText_hPutChar1_entry'
ffitest.o: In function `s1fz_ret':
(.text+0x280): undefined reference to `base_GHCziIOziHandleziText_hPutStr1_entry'
ffitest.o: In function `s1fv_ret':
(.text+0x36c): undefined reference to `base_GHCziIOziHandleziText_hPutChar1_entry'
ffitest.o: In function `s1ft_ret':
(.text+0x3b8): undefined reference to `base_GHCziIOziHandleziText_hPutStr1_entry'
ffitest.o: In function `s1fo_ret':
(.text+0x4ec): undefined reference to `base_GHCziIOziHandleziText_hPutChar1_entry'
ffitest.o: In function `s1fn_ret':
(.text+0x51c): undefined reference to `base_GHCziIOziHandleziText_hPutStr1_entry'
ffitest.o: In function `s1fn_ret':
(.text+0x578): undefined reference to `base_GHCziTopHandler_runMainIO1_entry'
collect2: ld returned 1 exit status
}}}

And there is no option -unreg that man ghc suggests to use instead.
",bug,closed,normal,,Compiler,6.12.3,wontfix,,,Linux,powerpc,Compile-time crash,,,,,
