Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2020-11

AArch64 -> ARM cross compilation

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

J. Gareth Moreton

Hi everyone,

I need a little bit of assistance so I can stamp out these bugs for you.

As silly as this sounds, I've mislaid my Arm-32 SD card so I have to develop on AArch64 exclusively on the Raspberry Pi. As a result I only have the AArch64 implementation of FPC installed. Is there a way to cross- compile AArch64 to Arm, or better, install an Arm version of FPC alongside my AArch64 version? I gather it's not quite as simple as running i386 on x86_64. Admittedly my expertise with Linux is still lacking a bit, especially when it comes to getting the right software installed.

Gareth aka. Kit

P.S. Trying to run "make clean all CPU_TARGET=arm" doesn't seem to work properly - gcc returns errors (doesn't recognise "-m64") and CPU_TARGET seems to get reset back to aarch64. P.P.S. If I find my Arm-32 SD card again, I'll probably switch back to that for the testing and debugging.

Reply by email

J. Gareth Moreton

Thanks Sven, that worked a treat. Now I need
to try to reproduce these crashes that are
plaguing Arm.

Gareth aka. Kit

On Sat 14/11/20 16:07 , Sven Barth via fpc-
devel sent:

Am 14.11.2020 um 15:12 schrieb J. Gareth

Moreton via fpc-devel:

Show quoted text 6 lines
> Hi everyone, > > I need a little bit of assistance so I

can stamp

out these bugs for you. > > As silly as this sounds, I've mislaid my

Arm-32

SD card so I have to develop on AArch64

exclusively on the Raspberry Pi.

As a result I only have the AArch64

implementation of FPC installed. Is

there a way to cross- > compile AArch64 to Arm, or better,

install an

Arm version of FPC alongside my AArch64

version? I gather it's not quite

as simple as running i386 on x86_64.

Admittedly my expertise with Linux is

still lacking a bit, > especially when it comes to getting the

right

Show quoted text 9 lines
software installed. > > Gareth aka. Kit > > P.S. Trying to run "make clean all CPU_TARGET=arm" doesn't seem to work

properly - gcc returns errors

(doesn't recognise "-m64") and CPU_TARGET

seems to get reset back

to aarch64. > P.P.S. If I find my Arm-32 SD card

again, I'll

probably switch back to that for the

testing and debugging.

You need to install arm-linux binutils

(don't know what the package is

called) and then you need to invoke make

like this:

make all CPU_TARGET=arm

BINUTILSPREFIX=arm-linux- FPMAKEOPT="-T

4" -j 4 Note 1: don't use "clean" and "all"

together with

Show quoted text 6 lines
parallel compilation (the "-j 4") Note 2: your prefix might be different,

e.g. arm-linux-gnueabi- or

something like that. Best try to execute

as/ld using tab completion in

Show quoted text 6 lines
the shell. In theory it should also be possible to

run 32-bit ARM applications on

Show quoted text 10 lines
AArch64 though I have not tested that yet. Regards, Sven

Reply by email

Sven Barth
to J. Gareth Moreton: I need a little bit of assistance so I can stamp out these bugs for you. As silly as this…
J. Gareth Moreton wrote 12 lines
Hi everyone, I need a little bit of assistance so I can stamp out these bugs for you. As silly as this sounds, I've mislaid my Arm-32 SD card so I have to develop on AArch64 exclusively on the Raspberry Pi. As a result I only have the AArch64 implementation of FPC installed. Is there a way to cross- compile AArch64 to Arm, or better, install an Arm version of FPC alongside my AArch64 version? I gather it's not quite as simple as running i386 on x86_64. Admittedly my expertise with Linux is still lacking a bit, especially when it comes to getting the right software installed. Gareth aka. Kit P.S. Trying to run "make clean all CPU_TARGET=arm" doesn't seem to work properly - gcc returns errors (doesn't recognise "-m64") and CPU_TARGET seems to get reset back to aarch64. P.P.S. If I find my Arm-32 SD card again, I'll probably switch back to that for the testing and debugging.

You need to install arm-linux binutils (don't know what the package is called) and then you need to invoke make like this:

make all CPU_TARGET=arm BINUTILSPREFIX=arm-linux- FPMAKEOPT="-T 4" -j 4

Note 1: don't use "clean" and "all" together with parallel compilation (the "-j 4")

Note 2: your prefix might be different, e.g. arm-linux-gnueabi- or something like that. Best try to execute as/ld using tab completion in the shell.

In theory it should also be possible to run 32-bit ARM applications on AArch64 though I have not tested that yet.

Regards,
Sven

Reply by email

J. Gareth Moreton

Thanks Sven, that worked a treat. Now I need
to try to reproduce these crashes that are
plaguing Arm.

Gareth aka. Kit

On Sat 14/11/20 16:07 , Sven Barth via fpc-
devel sent:

Am 14.11.2020 um 15:12 schrieb J. Gareth

Moreton via fpc-devel:

Show quoted text 6 lines
> Hi everyone, > > I need a little bit of assistance so I

can stamp

out these bugs for you. > > As silly as this sounds, I've mislaid my

Arm-32

SD card so I have to develop on AArch64

exclusively on the Raspberry Pi.

As a result I only have the AArch64

implementation of FPC installed. Is

there a way to cross- > compile AArch64 to Arm, or better,

install an

Arm version of FPC alongside my AArch64

version? I gather it's not quite

as simple as running i386 on x86_64.

Admittedly my expertise with Linux is

still lacking a bit, > especially when it comes to getting the

right

Show quoted text 9 lines
software installed. > > Gareth aka. Kit > > P.S. Trying to run "make clean all CPU_TARGET=arm" doesn't seem to work

properly - gcc returns errors

(doesn't recognise "-m64") and CPU_TARGET

seems to get reset back

to aarch64. > P.P.S. If I find my Arm-32 SD card

again, I'll

probably switch back to that for the

testing and debugging.

You need to install arm-linux binutils

(don't know what the package is

called) and then you need to invoke make

like this:

make all CPU_TARGET=arm

BINUTILSPREFIX=arm-linux- FPMAKEOPT="-T

4" -j 4 Note 1: don't use "clean" and "all"

together with

Show quoted text 6 lines
parallel compilation (the "-j 4") Note 2: your prefix might be different,

e.g. arm-linux-gnueabi- or

something like that. Best try to execute

as/ld using tab completion in

Show quoted text 6 lines
the shell. In theory it should also be possible to

run 32-bit ARM applications on

Show quoted text 10 lines
AArch64 though I have not tested that yet. Regards, Sven

Reply by email