[fpc-pascal] Cross compile from x86 to Pi

2015-08-15 Thread Chris Moody

Hi all,

I think my project is almost done, wanted to see how fast it ran under 
the Pi which its destined to be on. After spending a long time trying to 
get it to compile there I decided I'd see if cross compiling may be any 
faster.


Is there a better guide on how to do this than: 
http://wiki.freepascal.org/fpcup#Linux_ARM_cross_compiler ? specifically 
as far as this sentence is concerned:


 * Linux/Unix build or install the relevant crossbinutils (Linux, unix)

Thanks in advance!

Chris


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Cross compile from x86 to Pi

2015-08-15 Thread Karoly Balogh (Charlie/SGR)
Hi,

On Sat, 15 Aug 2015, Chris Moody wrote:

> Is there a better guide on how to do this than:
> http://wiki.freepascal.org/fpcup#Linux_ARM_cross_compiler ? specifically as 
> far as this
> sentence is concerned:
>
>  *  Linux/Unix build or install the relevant crossbinutils (Linux, unix)

With Ubuntu/Debian:
- apt-get install binutils-arm-linux-gnueabihf

The various binutils executables will be available then as
arm-linux-gnueabihf-*, so you need to use parameter
-XParm-linux-gnueabihf- when invoking the compiler.

If you're using a different Linux distribution, look up a similar package
in your distribution, most bigger distros provide cross-binutils packages
these days for ARM.

You can also build cross-binutils from source, but that's not FPC specific
at all. Among many others, this GCC cross-howto explains how to build a
cross binutils (see chapter 1):

http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/

But on the RPi, instead of TARGET=aarch64-linux one has to use
TARGET=arm-linux-gnueabihf, if I'm correct.

Charlie
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Cross compile from x86 to Pi

2015-08-15 Thread Chris Moody



On 08/15/2015 06:40 PM, Karoly Balogh (Charlie/SGR) wrote:

Hi,

On Sat, 15 Aug 2015, Chris Moody wrote:


Is there a better guide on how to do this than:
http://wiki.freepascal.org/fpcup#Linux_ARM_cross_compiler ? specifically as far 
as this
sentence is concerned:

  *  Linux/Unix build or install the relevant crossbinutils (Linux, unix)

With Ubuntu/Debian:
- apt-get install binutils-arm-linux-gnueabihf

The various binutils executables will be available then as
arm-linux-gnueabihf-*, so you need to use parameter
-XParm-linux-gnueabihf- when invoking the compiler.

If you're using a different Linux distribution, look up a similar package
in your distribution, most bigger distros provide cross-binutils packages
these days for ARM.

You can also build cross-binutils from source, but that's not FPC specific
at all. Among many others, this GCC cross-howto explains how to build a
cross binutils (see chapter 1):

http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/

But on the RPi, instead of TARGET=aarch64-linux one has to use
TARGET=arm-linux-gnueabihf, if I'm correct.

Charlie

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?

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Cross compile from x86 to Pi

2015-08-15 Thread Karoly Balogh (Charlie/SGR)
Hi,

On Sat, 15 Aug 2015, Chris Moody wrote:

> > > Is there a better guide on how to do this than:
> > > http://wiki.freepascal.org/fpcup#Linux_ARM_cross_compiler ? specifically
> > > as far as this
> > > sentence is concerned:
> > >
> > >   *  Linux/Unix build or install the relevant crossbinutils (Linux, unix)
> > With Ubuntu/Debian:
> > - apt-get install binutils-arm-linux-gnueabihf
> >
> > **snip**
>
> 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?

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:
http://wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM#Make_your_first_arm-linux_project_in_Lazarus

Charlie
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Cross compile from x86 to Pi

2015-08-15 Thread Chris Moody



On 08/15/2015 07:40 PM, Karoly Balogh (Charlie/SGR) wrote:

Hi,

On Sat, 15 Aug 2015, Chris Moody wrote:


Is there a better guide on how to do this than:
http://wiki.freepascal.org/fpcup#Linux_ARM_cross_compiler ? specifically
as far as this
sentence is concerned:

   *  Linux/Unix build or install the relevant crossbinutils (Linux, unix)

With Ubuntu/Debian:
- apt-get install binutils-arm-linux-gnueabihf

**snip**

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?

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:
http://wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM#Make_your_first_arm-linux_project_in_Lazarus

Charlie
___

Looks like I need to recompile FPC (or make a special compile of it) to 
be able to compile to ARM.


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 ?


Thanks once again!

Chris


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Cross compile from x86 to Pi

2015-08-15 Thread Martin Schreiber
On Sunday 16 August 2015 02:33:24 Chris Moody wrote:
> Hi all,
>
> I think my project is almost done, wanted to see how fast it ran under
> the Pi which its destined to be on. After spending a long time trying to
> get it to compile there I decided I'd see if cross compiling may be any
> faster.
>
I use MSEide in order to cross compile and do remote debugging from Linux x86 
to Raspberry Pi. With that setup it is possible to work on the X86 PC like 
locally on the Pi - solely faster.
Linux x86 -> arm cross environments with cross FPC, cross binutils and cross 
gdb are here:
http://sourceforge.net/projects/mseide-msegui/files/fpcrossarm/

MSEide has a project template for cross-Pi development, please read 
MSEide+MSEgui README.TXT.
For GUI on the Pi I use MSEgui which is extremely fast. Also MSEide runs 
amazingly fast on Pi, the problem is long FPC compilation times.

FPC fixes_3_0 needs current git master MSEide+MSEgui from here:
https://gitlab.com/mseide-msegui/mseide-msegui

Please ask questions on the mailinglist:
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Mail archive:
http://www.mail-archive.com/mseide-msegui-talk@lists.sourceforge.net/
NNTP gateway:
nntp://news.gmane.org/gmane.comp.ide.mseide.user

Martin
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal