Hey everyone,
I seem to have managed to build a crosscompiler for ARM.. yeah
However, when testing the following source:
program test;
begin
writeln('DATE ',{$i %DATE%});
writeln('FPCTARGET ',{$i %FPCTARGET%});
writeln('FPCTARGETCPU ',{$i %FPCTARGETCPU%});
writeln('FPCTARGETOS ',{$i %FPCTARGETOS%});
writeln('FPCVERSION ',{$i %FPCVERSION%});
end.
using the command:
fpc -Tlinux -Parm -va test.pas
I got:
[0.159] Searching file /usr/lib/fpc/2.7.1/bin/arm-linux//home/user/lazarus/fpc/binutils/as... not found
[0.159] Searching file /usr/lib/fpc/2.7.1/bin/arm-linux//HOME/USER/LAZARUS/FPC/BINUTILS/AS... not found
[0.159] Searching file /usr/lib/fpc/2.7.1//home/user/lazarus/fpc/binutils/as... not found
[0.159] Searching file /usr/lib/fpc/2.7.1//HOME/USER/LAZARUS/FPC/BINUTILS/AS... not found
[0.159] Searching file /usr/local/maven/bin//home/user/lazarus/fpc/binutils/as... not found
[0.159] Searching file /usr/local/maven/bin//HOME/USER/LAZARUS/FPC/BINUTILS/AS... not found
[0.159] Searching file /usr/local/sbin//home/user/lazarus/fpc/binutils/as... not found
[0.159] Searching file /usr/local/sbin//HOME/USER/LAZARUS/FPC/BINUTILS/AS... not found
[0.159] Searching file /usr/local/bin//home/user/lazarus/fpc/binutils/as... not found
[0.159] Searching file /usr/local/bin//HOME/USER/LAZARUS/FPC/BINUTILS/AS... not found
[0.159] Searching file /usr/sbin//home/user/lazarus/fpc/binutils/as... not found
[0.159] Searching file /usr/sbin//HOME/USER/LAZARUS/FPC/BINUTILS/AS... not found
[0.159] Searching file /usr/bin//home/user/lazarus/fpc/binutils/as... not found
[0.159] Searching file /usr/bin//HOME/USER/LAZARUS/FPC/BINUTILS/AS... not found
[0.159] Searching file /sbin//home/user/lazarus/fpc/binutils/as... not found
[0.159] Searching file /sbin//HOME/USER/LAZARUS/FPC/BINUTILS/AS... not found
[0.159] Searching file /bin//home/user/lazarus/fpc/binutils/as... not found
[0.159] Searching file /bin//HOME/USER/LAZARUS/FPC/BINUTILS/AS... not found
[0.159] Searching file /usr/games//home/user/lazarus/fpc/binutils/as... not found
[0.160] Searching file /usr/games//HOME/USER/LAZARUS/FPC/BINUTILS/AS... not found
[0.160] Searching file /home/nathan/android/android-sdk-linux_x86/platform-tools//home/user/lazarus/fpc/binutils/as... not found
[0.160] Searching file /home/nathan/android/android-sdk-linux_x86/platform-tools//HOME/USER/LAZARUS/FPC/BINUTILS/AS... not found
[0.160] Searching file /home/nathan/android/android-sdk-linux_x86/tools//home/user/lazarus/fpc/binutils/as... not found
[0.160] Searching file /home/nathan/android/android-sdk-linux_x86/tools//HOME/USER/LAZARUS/FPC/BINUTILS/AS... not found
[0.160] Assembler /home/user/lazarus/fpc/binutils/as not found, switching to external assembling
[0.160] There were 1 errors compiling module, stopping
[0.182] Compilation aborted
Error: /usr/local/bin/ppcarm returned an error exitcode (normal if you did not specify a source file to be compiled)
So the string "/home/user/lazarus/fpc/binutils/as" is concatenated with each of the strings in $PATH, which is not good. The tutorial:
http://wiki.freepascal.org/Setup_Cross_Compile_For_ARMtold me to put:
-XP/home/user/lazarus/fpc/binutils/
in my .fpc.cfg. So i looked up this -XP option and it says:
-XP<x> Prepend the binutils names with the prefix <x>
Seems to me that this should only be used if you have your binutils prefixed, not for setting the path. If I remove that line from fpc.cfg, it finds
"/usr/local/bin/arm-linux-ld", so everything seems to work now.
So, is this an error in the article? Perhaps there is a better option for this.
Sorry, I'm a newbie and I don't know whether I'm doing this right, so I didn't feel, nor didn't know how, to edit the wiki page. Just thought i should post this.
Thanks.
P.S: The arm cross compiler was build from FPC 2.7.1 sources.