I reformulate the question because I'd like to be sure I've expressed it right. Probably, the following commands might fail. I'd like to know when they will fail.
a. Host OS is linux and host CPU is x86_64
make crossall crossinstall OS_TARGET=linux CPU_TARGET=i386 INSTALL_PREFIX=~/freepascalcompiler/
b. Host OS is linux and host CPU is i386
make crossall crossinstall OS_TARGET=linux CPU_TARGET=x86_64 INSTALL_PREFIX=~/freepascalcompiler/
I assume that a SUBARCH parameter has no influence in these two situations. Reasons for failure might include: binutils is not built using adecvate parameters, missing proper CROSSBINUTILS parameter to the "make" command, and who knows what else...
Will CROSSBINUTILS parameter have an influence upon adding it to the above examples, or it would be completely ignored same as when targetting win32/win64?
If CROSSBINUTILS has an influence, then how comes "make crossall crossinstall OS_TARGET=linux CPU_TARGET=i386 INSTALL_PREFIX=~/freepascalcompiler/" works fine even though I can't find any "i386-*" file on HDD. I would have expected for something like having "i386-linux-{as,ld,...}" files.
@marcov
Besides toolchain availability, there is also the need for the extended type for i386, afaik it makes crosscompiling the compiler from hostcpu=anything to targetcpu=i386 is not possible because the i386 part of the compiler cg uses extended?
Can you reformulate your answer for the above two examples(a and b), I'm not sure I understand it. As far as I know all x86_64 CPUs support extended(as 80b floating value) and CPU_TARGET doesn't need extended support because the compiler will be used on the host CPU.
This paragraph is in the case you meant that you can't build fpc for x86_64 on a 80386 CPU. From your answer I speculate that a 80386 CPU doesn't have extended support. For this reason a linux-i386 host that runs on a 80386 CPU can not build fpc for crosscompiling to linux-x86_64. This aspect would link to a different forum thread(posted recently) regarding extended type use within win64, where I've noticed the presence of "sfpux80" unit. Can't fpc emulate extended on a 80386 CPU? I'm getting lost.
Can you also take a look at:
http://forum.lazarus.freepascal.org/index.php/topic,29678.msg187660.html#msg187660 ?