Problem solved, see end of post!
I leave the post here anyway, maybe It helps others to avoid the !@#%§grrr... error I made.
Near the end however, there is an observation in a source file that stands, and that may be a problem, even if it has nothing to do with my issue.
----------------------------------------------------------------------------------------------------------
I did some more experiments, so far with the following results:
First, I made a fresh checkout of the SVN trunk. On that, I built a native compiler:
make distclean
[georg@georg1 trunk]$ make cycle
[georg@georg1 trunk]$ make all >& makeall.log
[georg@georg1 trunk]$ sudo make install PP=/home/georg/fpc/trunk/compiler/ppcx64 INSTALL_PREFIX=/usr/local
and put a symlink to the ppcx64 binary into /usr/local/bin.
As in the path /usr/local/bin comes before /usr/local, executing fpc invokes the 3.1.1 compiler.
So far, so good.
Next step:
make distclean
[georg@georg1 trunk]$ sudo make all crossinstall OS_TARGET=linux CPU_TARGET=arm CROSSBINDIR=/usr/local/bin BINUTILSPREFIX=arm-linux- INSTALL_PREFIX=/usr/local >& makearm.log
Binutils are still there, from yesterday. In the /usr/local/lib/fpc/3.1.1 branch correctly appears ppcrossarm, and arm-linux subdirs under units and fpmkinst. The first lines of makearm.log are:
make compiler_cycle RELEASE=1
make[1]: Entering directory `/home/georg/fpc/trunk'
make -C compiler cycle
make[2]: Entering directory `/home/georg/fpc/trunk/compiler'
make OS_TARGET=linux CPU_TARGET=x86_64 CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl CYCLELEVEL=1
make[3]: Entering directory `/home/georg/fpc/trunk/compiler'
make -C /home/georg/fpc/trunk/rtl clean
make[4]: Entering directory `/home/georg/fpc/trunk/rtl'
/bin/rm -f fpcmade.x86_64-linux Package.fpc ./ppas.sh script.res link.res
/bin/rm -f *.s *_ppas.sh
make -C linux clean
make[5]: Entering directory `/home/georg/fpc/trunk/rtl/linux'
/bin/rm -f /home/georg/fpc/trunk/rtl/units/x86_64-linux/prt0.o /home/georg/fpc/trunk/rtl/units/x86_64-linux/dllprt0.o /home/georg/fpc/trunk/rtl/units/x86_64-linux/cprt0.o /home/georg/fpc/trunk/rtl/units/x86_64-linux/gprt0.o /home/georg/fpc/trunk/rtl/units/x86_64-linux/abitag.o
/bin/rm -f /home/georg/fpc/trunk/rtl/units/x86_64-linux/system.ppu /home/georg/fpc/trunk/rtl/units/x86_64-linux/fpintres.ppu /home/georg/fpc/trunk/rtl/units/x86_64-linux/si_prc.ppu /home/georg/fpc/trunk/rtl/units/x86_64-linux/si_c.ppu /home/georg/fpc/trunk/rtl/units/x86_64-linux/si_g.ppu /home/georg/fpc/trunk/rtl/units/x86_64-linux/si_dll.ppu
ppcrossarm, identifies itself as "Free Pascal Compiler version 3.1.1 [2015/03/16] for arm".
So far, so good.
Next step:
make distclean
sudo make all crossinstall OS_TARGET=embedded CPU_TARGET=avr CROSSBINDIR=/usr/local/bin BINUTILSPREFIX=avr- INSTALL_PREFIX=/usr/local >& makeavr.log
results in the same error as yesterday, makeavr.log is:
make: -iVSPTPSOTO: Kommando nicht gefunden
make compiler_cycle RELEASE=1
make[1]: -iVSPTPSOTO: Kommando nicht gefunden
make[1]: Entering directory `/home/georg/fpc/trunk'
make -C compiler cycle
make[2]: -iVSPTPSOTO: Kommando nicht gefunden
make[2]: Entering directory `/home/georg/fpc/trunk/compiler'
make OS_TARGET= CPU_TARGET= CROSSBINDIR= BINUTILSPREFIX= CROSSCYCLEBOOTSTRAP=1 rtlclean rtl CYCLELEVEL=1
make[3]: Entering directory `/home/georg/fpc/trunk/compiler'
make -C clean
make: Entering an unknown directory
make: *** clean: Datei oder Verzeichnis nicht gefunden. Schluss.
make: Leaving an unknown directory
make[3]: *** [rtlclean] Fehler 2
make[3]: Leaving directory `/home/georg/fpc/trunk/compiler'
make[2]: *** [cycle] Fehler 2
make[2]: Leaving directory `/home/georg/fpc/trunk/compiler'
make[1]: *** [compiler_cycle] Fehler 2
make[1]: Leaving directory `/home/georg/fpc/trunk'
make: *** [build-stamp.avr-embedded] Fehler 2
The problem, IMHO, is not a missing or unfindable fpc. It is there, and in the path. Looking into the Makefile reveals, that the -iVSPTPSOTO option string is at one place added to the content of a variable FPC to result in FPC_COMPILERINFO, if the latter does not exist. The error is consistent with $FPC being empty, or too short, so that finally -iVSPTPSOTO is interpreted as a command instead of options. A command, that of course does not exist.
As Makefile is created by fpcMake, partly from built in logic, partly from information stored in Makefile.fpc, Looking into the sources of fpcMake, I made one observation:
fpcmmain.pp, line 88 ff
CpuSuffix : array[TCpu] of string=( // why without underscore?? - GH
'_i386','_m68k','_powerpc','_sparc','_x86_64','_arm','_powerpc64','avr','_armeb', '_armel', '_mips', '_mipsel', '_mips64', '_mips64el', '_jvm','_i8086','_aarch64'
);
"avr" is the only item without a leading underscore. I changed this, just as a try, recompiled fpcmake and rebuilt Makefile, but to no avail. Anyway, I would like to bring this to the attention of the developers, it looks strange and results in some strings not following the usual pattern.
Uff. Long post. I hope it helps somebody to find an answer....
appended 17.3.15:
Problem seems to be much simpler (as usual....) , and to lay in my sequence:
make distclean
sudo make all crossinstal....
The building make has to run as root to install it's products in /usr/local.... . Consequently it creates unit directories and files owned by root, which the following make distclean, under my normal account, fails to clean. aparently the following make for a different target gets confused by the leftover junk.
Now I managed to compile an avr compiler, the make process crashes later compiling the rtl with it.
when compiling system.pp, the compiler stops with an Internal error 200309041 in one of the .inc's. Turning off optimization stops it doing so, but now the same occurs in another .inc.
This is a hickup of the register allocation, and so something that is to be expected from an "experimental", i.e. known to be buggy, compiler.
Problem (of generating the cross compiler) solved.