Sign in Join

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

Mailing lists / fpc-pascal / 2009-11

make CPU_TARGET=arm OS_TARGET=linux ignores both flags

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

ik

Hello,

I'm trying to cross compile FPC 2.5.1 in Linux 64 bit (in Arch Linux) to arm (eabi) cpu.
When I'm using

make CPUT_TARGET=arm OS=TARGET=linux all

The make file build an x86_64 units and not arm units. The result is also not ppcrossarm but ppcx64.

Only when I'm doing:
make OPT='-dFPC_ARMEL -dFPC_ABI_EABI -Xd -Tlinux -CaEABI -Op arm' CROSSCOMPILE=1 CPU_TARGET=arm OS_TARGET=linux

It compiles it to ppcrossarm, but when I'm making it with 'zipinstall' it does not pack inside the archive the ppcrossarm compiler.

What am I missing ?

Thank,

Ido

http://ik.homelinux.org/

Reply by email

Jonas Maebe
to ik
ik wrote 6 lines
I'm trying to cross compile FPC 2.5.1 in Linux 64 bit (in Arch Linux) to arm (eabi) cpu. When I'm using make CPUT_TARGET=arm OS=TARGET=linux all

That should be CPU_TARGET, not CPUT_TARGET, and OS_TARGET instead of OS=TARGET

The make file build an x86_64 units and not arm units. The result is also not ppcrossarm but ppcx64.

That's probably because of the above.

Only when I'm doing: make OPT='-dFPC_ARMEL -dFPC_ABI_EABI -Xd -Tlinux -CaEABI -Op arm' CROSSCOMPILE=1 CPU_TARGET=arm OS_TARGET=linux

I think you have to add at least OPT='-dFPC_ARMEL -dFPC_ABI_EABI -Xd' to the first command anyway, otherwise you'll probably get an OABI instead of an EABI compiler (and the -Xd makes sure the compiler ignores the standard search paths). The "-Op arm" is a bogus parameter, so remove that (-Op expects a cpu type right after the p, without a space; right now, you are not setting any cpu type, and passing "arm" as separate parameter to the compiler).

If ain't broken, don't try to fix it. The second command works (and I think the only things that may be superfluous, when you compile under linux, are the "-Tlinux -Op arm" parameters).

Jonas

Reply by email

ik
to Jonas Maebe

Thanks Jonas.

doing:
make OPT='dFPC_ARMEL -dFPC_ABI_EABI -Xd' OS=TARGET=linux CPU_TARGET=arm zipdistinstall

does create a cross compile, but does not pack the ppcrossarm . Is there a way I can make a cross compiler zipinstall to install (at the end) as a package in my linux ?

Thanks,
Ido

http://ik.homelinux.org/

Jonas Maebe wrote 46 lines
On 23 Nov 2009, at 13:58, ik wrote: I'm trying to cross compile FPC 2.5.1 in Linux 64 bit (in Arch Linux) to > arm > (eabi) cpu. > When I'm using > > make CPUT_TARGET=arm OS=TARGET=linux all > That should be CPU_TARGET, not CPUT_TARGET, and OS_TARGET instead of OS=TARGET The make file build an x86_64 units and not arm units. The result is also > not ppcrossarm but ppcx64. > That's probably because of the above. Only when I'm doing: > make OPT='-dFPC_ARMEL -dFPC_ABI_EABI -Xd -Tlinux -CaEABI -Op arm' > CROSSCOMPILE=1 CPU_TARGET=arm OS_TARGET=linux > I think you have to add at least OPT='-dFPC_ARMEL -dFPC_ABI_EABI -Xd' to the first command anyway, otherwise you'll probably get an OABI instead of an EABI compiler (and the -Xd makes sure the compiler ignores the standard search paths). The "-Op arm" is a bogus parameter, so remove that (-Op expects a cpu type right after the p, without a space; right now, you are not setting any cpu type, and passing "arm" as separate parameter to the compiler). If ain't broken, don't try to fix it. The second command works (and I think the only things that may be superfluous, when you compile under linux, are the "-Tlinux -Op arm" parameters). Jonas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Jonas Maebe
to ik
ik wrote
Is there a way I can make a cross compiler zipinstall to install (at the end) as a package in my linux ?

Try this:

make OPT='dFPC_ARMEL -dFPC_ABI_EABI -Xd' OS=TARGET=linux CPU_TARGET=arm FPC=`pwd`/compiler/ppcrossarm zipdistinstall

Jonas

Reply by email

ik
to Jonas Maebe: Try this: make OPT='dFPC_ARMEL -dFPC_ABI_EABI -Xd' OS=TARGET=linux CPU_TARGET=arm…

That did not added the cross compile to the tar.

But I was able to work with it anyway using package manager (still playing with it, and when it will be ready I'll release it to AUR -> arch linux community packages build).

I have another problem. I'm trying to create an Hello world for OpenMoko (SHR unstable distro).
The file that FPC created for me is:
hello: ELF 32-bit LSB executable, ARM, version 1, statically linked, not stripped

While SHR's programs signature is:
./e2fsck.e2fsprogs: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.24, dynamically linked (uses shared libs), stripped

When I try to execute the hello binary it gives me the following error: Illegal instruction

Debugging it with gdb gives the following:
Starting program: /var/volatile/tmp/hello

Program received signal SIGILL, Illegal instruction. 0x00008638 in SYSTEM_SYSINITFPU ()
(gdb) bt
#0 0x00008638 in SYSTEM_SYSINITFPU ()
#1 0x00008654 in SYSTEM_FPC_CPUINIT ()
#2 0x0000af18 in fpc_initializeunits ()
#3 0x0000807c in main () at /tmp/hello.pp:3

Is there a way to create FPC/program differently to make it work ? How I can provide additional information about the problem if needed ?

Thanks,
Ido

http://ik.homelinux.org/

Jonas Maebe wrote 20 lines
On 23 Nov 2009, at 15:37, ik wrote: Is there a > way I can make a cross compiler zipinstall to install (at the end) as a > package in my linux ? > Try this: make OPT='dFPC_ARMEL -dFPC_ABI_EABI -Xd' OS=TARGET=linux CPU_TARGET=arm FPC=`pwd`/compiler/ppcrossarm zipdistinstall Jonas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email