Ticket #4133 (closed bug: wontfix)

Opened 3 years ago

Last modified 3 years ago

-fvia-C option does not work on ppc with Linux

Reported by: Mikolaj Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.12.3
Keywords: Cc:
Operating System: Linux Architecture: powerpc
Type of failure: Compile-time crash Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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.

Change History

Changed 3 years ago by igloo

  • status changed from new to closed
  • resolution set to wontfix

PPC/Linux is not a tier 1 platform, so we don't actively support registerised builds on it. We'll happily apply patches to fix it, though.

To do unregisterised compilation, you need to build an unregisterised compiler.

Changed 3 years ago by Mikolaj

Thank you for your pointers. The unregistersied build failed with the build.mk options from Building/Unregisterised, but succeeded with options from Building/Porting. Then "fvia-C -funregisterised" indeed works (see #3971). About the manpage, I haven't noticed it's from 2002, so inaccuracies are understandable.

PPC/Linux is not a tier 1 platform

I'm afraid it's slipping to tier 3, at least for some processors, because FFI callbacks fail even in unregistered mode and ghci tends to have problems. But at least it boostraps perfectly so far... Anyway, thank you again for the prompt response and keep up the good work!

Note: See TracTickets for help on using tickets.