Translating from GnuC to Norcroft
GavinWraith (26) 1563 posts |
Is there anybody who can help me translate C source code written for GCC 2.4 to something compileable on RISC OS machines, preferably with the Norcroft C compiler? The software in question is LuaJIT 2.0.0(beta8) at http://repo.or.cz/w/luajit-2.0.git . An analysis of the #include |
Chris Johnson (125) 825 posts |
Would it not be better to use GCC as the compiler – it works fine on RISC OS. It also means that the compiler and linker flags are mainly taken care of. |
GavinWraith (26) 1563 posts |
Sorry – misprint. That should be GCC 4.2. The latest available for RISC OS is 4.1.1, AFAIK. The difficulty is that LuaJIT has been set up to compile on other systems, and I have trouble understanding what the makefile actually does. Some of the C sources have to be built using a standard Lua – RiscLua will probably not do – though I guess I could build that. I am not sure what values have to be given to some of the undefined flags that appear in the makefile – though I suppose hunting through the sources might give a clue. But the truth is, I am out of my depth with this. According to the LuaJIT roadmap 2011, there are plans to make it available for “other platforms”, but it is not clear when. |
Chris Gransden (337) 1207 posts |
It builds ok using gcc 4.6 from the riscos.info autobuilder. Unfortunately it crashed as soon I ran it. Looks like its to do with it needing eabi instead of apcs? So may not be straightforward getting it to work. |
Jan Rinze (235) 368 posts |
@Chris: the dynamic recompiler may very well be setup to be EABI or OABI compatible. neither is specifically apcs compatible. I could not find a part in the code (yet) that shows how it does the setup for the ABI. Maybe there are people from the Lua community that can briefly explain where those choices are embedded in the code. |
Jan Rinze (235) 368 posts |
on a side note.. i’d love to try gcc 4.6 on RISC OS.. would that mean i need to autobuild it myself? is it downloadable from riscos.info ? |
Andrew Rawnsley (492) 1445 posts |
Having just read a bit about EABI, and its benefits re floating point, is there any milage/relevance in it for RISC OS? My guess is it is all a lot more complex than adding a support module to the OS, but the benchmarks showing the benefits looked mighty impressive… |
Jan Rinze (235) 368 posts |
EABI in general changes the way registers are used and how parameters are passed on to subroutines or calls. The floating point benefit which causes the huge speed increase comes from being compiled with ‘softfloat’ and having for example NEON or VFP to perform the softfloat. technically there are no real big speedups with the OABI to EABI change. Unless the alignment of 64 bit values (EABI has strict 64 bit alignment in parameters) can be made accountable for any speed increase there is no real benefit for RISC OS to use EABI model as opposed to apcs. |
GavinWraith (26) 1563 posts |
Alas, it looks as if the LuaJIT sources presume EABI for ARM platforms, which rather knocks my hopes of a RISC OS port on the head. A 64-bit RISC OS is a pipedream too far! |
Chris Gransden (337) 1207 posts |
All may not be lost. There is mention here of an EABI build of gcc 4.6. It does build successfully but I couldn’t get it to produce working executables. LuaJIT works on 32bit on other platforms so should be fine on RISC OS. |
Chris Gransden (337) 1207 posts |
Just follow the instructions here. |