<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
This is how I build fpc trunk cross compiler:<br>
<br>
echo "Building fpchf-linux from trunk"<br>
SUBARCH=armv7<br>
CROSSOPT="-dREVINC -dFPC_ARMHF -CX -CpARMV7A -CfVFPV3_D16
-OpARMV7A -O2 -OoFASTMATH -XX -Xs"<br>
//CROSSOPT="-dREVINC -dFPC_ARMHF -CX -CpARMV6 -CfVFPV2 -OpARMV6
-O2 -OoFASTMATH -XX -Xs"<br>
OPT="-dFPC_ARMHF"<br>
make clean buildbase CROSSINSTALL=1 OS_TARGET=linux
CPU_TARGET=arm OPT="$OPT" OVERRIDEVERSIONCHECK=1
CROSSOPT="$CROSSOPT" BINUTILSPREFIX=arm-linux-gnueabihf- || exit 1<br>
sudo make installbase CROSSINSTALL=1 OS_TARGET=linux
CPU_TARGET=arm OPT="$OPT" OVERRIDEVERSIONCHECK=1
CROSSOPT="$CROSSOPT" BINUTILSPREFIX=arm-linux-gnueabihf- || exit 1<br>
sudo mv /usr/local/lib/fpc/3.1.1/ppcrossarm
/usr/local/lib/fpc/3.1.1/ppcrossarmhf<br>
<br>
Please note that the rtl is fine for Raspberry Pi 2 (the new quad
core board) as this is a version that uses armv7 commandset.<br>
<br>
For old Raspberry Pi you need to use the commented out CROSSOPT,
this will create rtl that is suitable for old raspberries.<br>
<br>
You should not try to use fpc 2.6.4 as this compiler does not
support armhf. Most likely the 3.0 pre-release will compile the same
way, but I never tried.<br>
<br>
You need to have cross-binutils installed as you need
arm-linux-gnueabihf-* tools to be able to successfully compile. <br>
<br>
Michael<br>
<br>
<div class="moz-cite-prefix">Am 18.08.15 um 04:16 schrieb Chris
Moody:<br>
</div>
<blockquote cite="mid:55D2958A.3060804@greensnakedesign.com"
type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
<br>
<br>
<div class="moz-cite-prefix">On 08/15/2015 08:46 PM, Chris Moody
wrote:<br>
</div>
<blockquote cite="mid:55D007A6.2070809@greensnakedesign.com"
type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
<br>
<br>
<div class="moz-cite-prefix">On 08/15/2015 07:40 PM, Karoly
Balogh (Charlie/SGR) wrote:<br>
</div>
<blockquote
cite="mid:alpine.DEB.2.02.1508160432540.7280@scenergy.dfmk.hu"
type="cite">
<pre wrap="">Hi,
On Sat, 15 Aug 2015, Chris Moody wrote:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Is there a better guide on how to do this than:
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://wiki.freepascal.org/fpcup#Linux_ARM_cross_compiler">http://wiki.freepascal.org/fpcup#Linux_ARM_cross_compiler</a> ? specifically
as far as this
sentence is concerned:
* Linux/Unix build or install the relevant crossbinutils (Linux, unix)
</pre>
</blockquote>
<pre wrap="">With Ubuntu/Debian:
- apt-get install binutils-arm-linux-gnueabihf
**snip**
</pre>
</blockquote>
<pre wrap="">Thanks for that Charlie, I now have that installed. Do I have to do the
compile with fpc? or can I do it via Lazarus?
</pre>
</blockquote>
<pre wrap="">I'm pretty sure it's possible with Lazarus, but I can't give exact
instructions, because I rarely use Lazarus, I prefer using the compiler
itself directly from the command line.
However, this page has some pointers:
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM#Make_your_first_arm-linux_project_in_Lazarus">http://wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM#Make_your_first_arm-linux_project_in_Lazarus</a>
Charlie
_______________________________________________
</pre>
</blockquote>
Looks like I need to recompile FPC (or make a special compile of
it) to be able to compile to ARM. <br>
<br>
That URL you gave me says how to compile it, but not sure about
if I need to have some special cross compile code for the
CROSSBINDIR=/home/user/lazarus/fpc/binutils/ portion of it, or
do I just point it to where Linux installed the items installed
with apt-get install binutils-arm-linux-gnueabihf ?<br>
<br>
Thanks once again!<br>
<br>
Chris<br>
</blockquote>
<br>
So I tried to compile a special version of FPC for arm, I
installed: binutils-2.25<br>
<br>
And I got as far as this:<br>
<br>
/home/chris/Documents/fp/fpcbuild-2.6.4/binutils/bin/as -o
/home/chris/Documents/fp/fpcbuild-2.6.4/fpcsrc/rtl/units/arm-linux/prt0.o
arm/prt0.as<br>
arm/prt0.as: Assembler messages:<br>
arm/prt0.as:46: Error: unrecognized symbol type ""<br>
arm/prt0.as:49: Error: expecting operand after ','; got nothing<br>
arm/prt0.as:50: Error: no such instruction: `ldmia sp!,{a2}'<br>
arm/prt0.as:53: Error: no such instruction: `ldr
ip,=operatingsystem_parameter_argc'<br>
arm/prt0.as:54: Error: no such instruction: `ldr
a3,=operatingsystem_parameter_argv'<br>
arm/prt0.as:55: Error: invalid char '[' beginning operand 2 `[ip]'<br>
arm/prt0.as:58: Error: too many memory references for `add'<br>
arm/prt0.as:59: Error: too many memory references for `add'<br>
arm/prt0.as:60: Error: no such instruction: `ldr
ip,=operatingsystem_parameter_envp'<br>
arm/prt0.as:62: Error: invalid char '[' beginning operand 2 `[a3]'<br>
arm/prt0.as:63: Error: invalid char '[' beginning operand 2 `[ip]'<br>
arm/prt0.as:66: Error: no such instruction: `ldr ip,=__stkptr'<br>
arm/prt0.as:67: Error: invalid char '[' beginning operand 2 `[ip]'<br>
arm/prt0.as:69: Error: too many memory references for `sub'<br>
arm/prt0.as:72: Error: no such instruction: `bl PASCALMAIN'<br>
arm/prt0.as:75: Error: unrecognized symbol type ""<br>
arm/prt0.as:78: Error: no such instruction: `swi 0x900001'<br>
arm/prt0.as:79: Error: no such instruction: `b _haltproc'<br>
arm/prt0.as:82: Error: unrecognized symbol type ""<br>
arm/prt0.as:84: Error: no such instruction: `ldr
r0,=operatingsystem_result'<br>
arm/prt0.as:85: Error: no such instruction: `ldrb r0,[r0]'<br>
arm/prt0.as:86: Error: expecting operand after ','; got nothing<br>
arm/prt0.as:87: Error: no such instruction: `swi 0x0'<br>
arm/prt0.as:88: Error: no such instruction: `b _haltproc_eabi'<br>
make[6]: *** [prt0.o] Error 1<br>
make[6]: Leaving directory
`/home/chris/Documents/fp/fpcbuild-2.6.4/fpcsrc/rtl/linux'<br>
make[5]: *** [linux_all] Error 2<br>
make[5]: Leaving directory
`/home/chris/Documents/fp/fpcbuild-2.6.4/fpcsrc/rtl'<br>
make[4]: *** [rtl] Error 2<br>
make[4]: Leaving directory
`/home/chris/Documents/fp/fpcbuild-2.6.4/fpcsrc/compiler'<br>
make[3]: *** [cycle] Error 2<br>
make[3]: Leaving directory
`/home/chris/Documents/fp/fpcbuild-2.6.4/fpcsrc/compiler'<br>
make[2]: *** [compiler_cycle] Error 2<br>
make[2]: Leaving directory
`/home/chris/Documents/fp/fpcbuild-2.6.4/fpcsrc'<br>
make[1]: *** [build-stamp.arm-linux] Error 2<br>
make[1]: Leaving directory
`/home/chris/Documents/fp/fpcbuild-2.6.4/fpcsrc'<br>
make: *** [fpcsrc/build-stamp.arm-linux] Error 2<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
fpc-pascal maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a></pre>
</blockquote>
<br>
</body>
</html>