Does anybody have real Linux solution or cross compiling is just a theory ?
Of course not, how do you think FPC gets ported in the first place if not by cross compiling? What you have to understand is that it doesn't work out of the box, you have to understand some things.
- The real compiler, ppcXXX, where XXX refers to the platform it is compiled on, is a cross compiler for all OS of the same architecture. That means, on a x86 machine, ppc386 can be used to compile for i386-win32, i386-linux, etc.
- For different architecture, one must build the cross compiler from source (if it's not provided already). The compiler name will have additional 'ross' before the target platform. E.g., if the target platform is arm, then the cross compiler name would be ppcrossarm.
- Units compiled for one target WILL NOT WORK for other targets, one must recompile all required units in order to build a working program, the compiler itself IS NOT ENOUGH.
- Other than the compiler, one also needs binutils for platforms whose assembler and linker is not yet available internally in the compiler. Currently, the compiler only has internal assembler for x86 and x86-64, and the internal linker only for Win32/64 (Linux internal linker is on the way).
- If you have understood all the concepts, you can start building a cross environment setup by building from source using:
make all OS_TARGET=<your target os> CPU_TARGET=<your target cpu>
For arm-linux target, it will be: make all OS_TARGET=linux CPU_TARGET=arm
Note that at this step you already need the binutils. If everything goes well, execute:
make crossinstall OS_TARGET=<your target os> CPU_TARGET=<your target cpu> INSTALL_PREFIX=<target dir>
for linux, you can put your native FPC install dir as target dir, they will not interfere with existing installation and you can have single config file for all of them.
For my own needs, I've built a bash script to help me building all cross targets I need. Search the forum for another cross compiling topics, I've attached the script there (my current script is different from the last one I attach due to partition management change on my machine, and the change would cause it not to work on typical machine).
What else I have to setup ?
Clearly you skim too much on the topics you've seen and the wiki article. What I said above is more or less already mentioned there.