anonymous1337 wrote:When did this happen? How about the LLVM backend?
Well, it happened during September/October after the 0.24.0 release. There were lots of -gen gcc patches coming in at the time, and more until early 2013. Work on the LLVM backend helped the C backend aswell, though after the initial phase of getting excited about it I haven't continued working on it much. But it's still an interesting option, especially to solve the debugging meta data problems with the C backend, and I want to make it work eventually.
Much like TJF said, you can pre-compile the fbc sources (from the
src/compiler/ directory) by doing:
fbc -target linux *.bas -gen gcc -r -m fbc
and then theoretically copy the .c files over to the target system and compile them with gcc using something like:
gcc -o fbc -fno-strict-aliasing -frounding-math fbrt0.o *.c -lfb
That's assuming you have already compiled libfb.a and fbrt0.o on the target system. It will probably need further -l options depending on rtlib dependencies, on Linux for example -lncurses or -ltinfo, and -pthreads.
Just keep in mind that the .c code is not system/architecture/ABI-neutral, so for example .c code generated with -target linux won't work on Win32, and (currently as of FB 0.90) it also contains 32bit assumptions so won't work on 64bit, not to mention that there still is some x86 inline asm used by -gen gcc to implement fast & "properly" rounding (the FB way of rounding) for float <-> integer conversions which won't work on other architectures.
We've started the 64bit port a while ago (i.e. x86_64 Linux/Windows systems, and theoretically other 64bit too), and I'll continue working on it now that the 0.90 release is done. It includes removing the 32bit assumptions from fbc and of course removing any traces of x86 from -gen gcc output. And just overall qualiy improvements of -gen gcc since it will fully rely on it.
While -gen gcc can already be used to port FB to different architectures (only requiring some tiny fixes as of FB 0.90), porting to a different operating system such as MacOSX or Android is more difficult because the rtlib must be ported first (and the gfxlib2 shouldn't be forgotten either) to use the different set of system functions.