Sign in Join

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

Mailing lists / fpc-devel / 2009-12

Re: how to build FPC for armel

6 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Jonas Maebe
to Unknown author: To resolve problem from http://bugs.freepascal.org/view.php?id=15312 about EABI binares…
Show quoted text 5 lines
this is good (mentioned bug goes off) configuration make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/darek2008/fpcarm/arm-linux-uclibc/bin CROSSOPT="-dFPC_ARMEL -CfSOFT -gl -O2" INSTALL_PREFIX=/home/darek2008/fpcarm COMPILER_OPTIONS="cpufpemu -a"

Always first do a "make clean all" before doing any kind of install. Directly doing a "make install" or "make crossinstall" without doing a regular "make all" first is not supported. Also, when building a cross-compiler, make sure that you start with a native compiler built from the same FPC revision, because when building a cross-compiler the native compiler will not be fully cycled first.

This is how I built my cross-compiler (ppn40 is a native i386 compiler):

make FPC=~/afshome/bin/ppn40 OPT="-dFPC_ARMEL" CROSSOPT="-XParm-linux-gnueabi- -FD/home/jmaebe/crosstest/bin -dFPC_ARMEL -Cfsoft -Xd -O2" CPU_TARGET=arm all -j 2

I don't understand what your COMPILER_OPTIONS parameter is for. The "cpufpemu" will be interpreted by the compiler as the name of a source file (and subsequently be overridden by the real source file that comes after it), and "-a" tells the compiler to leave the generated assembler files behind. You can just as well use OPT="-a".

Jonas

Reply by email

Unknown author

To resolve problem from http://bugs.freepascal.org/view.php?id=15312 about EABI binares (compiler says that is EABI, but its not EABI, -CaEABI and FPC_ARMEL are enable)

I try to build FPC for Target OS: Linux for ARMEL (as Jonas say)

But all try was wrong
CPU_TARGET=armel : not build
CPU_TARGET=armeb : build armeb-linux, but compiler target was arm-linux CPU_TARGET=arm CROSSOPT="-CaEABI -dFPC_ARMEL ... bug was present (notice tat only remove -CaEABI for good configuration)

no one options to receive target: Linux for ARMEL

this is good (mentioned bug goes off) configuration make crossinstall CPU_TARGET=arm OS_TARGET=linux
CROSSBINDIR=/home/darek2008/fpcarm/arm-linux-uclibc/bin CROSSOPT="-dFPC_ARMEL -CfSOFT -gl -O2"
INSTALL_PREFIX=/home/darek2008/fpcarm COMPILER_OPTIONS="cpufpemu -a"

Darek

Reply by email

Jonas Maebe
to Unknown author: I always do this No luck to build. Below last part of make: /bin/mkdir -p…
Show quoted text 13 lines
/home/darek2008/fpcarm/arm-linux-uclibc/bin/ld:./link.res: file format not recognized; treating as linker script /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld:./link.res:289: syntax error pp.pas(223,27) Error: Error while linking pp.pas(223,27) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted make[3]: *** [ppcarm] Błąd 1 make[3]: Opuszczenie katalogu `/home/darek2008/svn-fpc/compiler' make[2]: *** [cycle] Błąd 2 make[2]: Opuszczenie katalogu `/home/darek2008/svn-fpc/compiler' make[1]: *** [compiler_cycle] Błąd 2 make[1]: Opuszczenie katalogu `/home/darek2008/svn-fpc' make: *** [build-stamp.arm-linux] Błąd 2

I can't help with uclibc, I have a regular GNU toolchain. What kind of linker are you using? (what does "ld --version" write?)

the same as crossinstall build has success,

That's probably because it doesn't recompile everything, so it is just copying some old files.

Jonas

Reply by email

Unknown author
to Jonas Maebe: Always first do a "make clean all" before doing any kind of install. Directly doing a…
Show quoted text 15 lines
On 12 Dec 2009, at 01:14, wrote: > this is good (mentioned bug goes off) configuration > make crossinstall CPU_TARGET=arm OS_TARGET=linux > CROSSBINDIR=/home/darek2008/fpcarm/arm-linux-uclibc/bin > CROSSOPT="-dFPC_ARMEL -CfSOFT -gl -O2" > INSTALL_PREFIX=/home/darek2008/fpcarm COMPILER_OPTIONS="cpufpemu -a" Always first do a "make clean all" before doing any kind of install. Directly doing a "make install" or "make crossinstall" without doing a regular "make all" first is not supported. Also, when building a cross-compiler, make sure that you start with a native compiler built from the same FPC revision, because when building a cross-compiler the native compiler will not be fully cycled first.

I always do this

Show quoted text 6 lines
This is how I built my cross-compiler (ppn40 is a native i386 compiler): make FPC=~/afshome/bin/ppn40 OPT="-dFPC_ARMEL" CROSSOPT="-XParm-linux-gnueabi- -FD/home/jmaebe/crosstest/bin -dFPC_ARMEL -Cfsoft -Xd -O2" CPU_TARGET=arm all -j 2

No luck to build. Below last part of make:

/bin/mkdir -p arm/units/arm-linux
/home/darek2008/svn-fpc/compiler/ppcrossarm -Parm -Ur -Xs -O2 -n -Fuarm -Fusystems -Fu/home/darek2008/svn-fpc/rtl/units/arm-linux -Fiarm -FD/home/darek2008/fpcarm/arm-linux-uclibc/bin -FE. -FUarm/units/arm-linux -dRELEASE -dFCP_ARMEL -Cfsoft -Xd -O2 -dFCP_ARMEL -Cfsoft -Xd -O2 -darm -dGDB -dBROWSERLOG pp.pas
cgobj.pas(3478,38) Warning: range check error while evaluating constants symdef.pas(4952,10) Warning: User defined: : this is completely wrong on so many levels...
/home/darek2008/fpcarm/arm-linux-uclibc/bin/ld:./link.res: file format not recognized; treating as linker script
/home/darek2008/fpcarm/arm-linux-uclibc/bin/ld:./link.res:289: syntax error pp.pas(223,27) Error: Error while linking
pp.pas(223,27) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
make[3]: *** [ppcarm] Błąd 1
make[3]: Opuszczenie katalogu `/home/darek2008/svn-fpc/compiler' make[2]: *** [cycle] Błąd 2
make[2]: Opuszczenie katalogu `/home/darek2008/svn-fpc/compiler' make[1]: *** [compiler_cycle] Błąd 2
make[1]: Opuszczenie katalogu `/home/darek2008/svn-fpc' make: *** [build-stamp.arm-linux] Błąd 2

the same as crossinstall build has success, but compile program has linking error:

Free Pascal Compiler version 2.5.1 [2009/12/12] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARMEL
Compiling hello.pas
Assembling hello
Linking hello
/home/darek2008/fpcarm/arm-linux-uclibc/bin/ld:link.res:207: syntax error hello.pas(20) Error: Error while linking
hello.pas(20) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted

I don't understand what your COMPILER_OPTIONS parameter is for. The "cpufpemu" will be interpreted by the compiler as the name of a source

that was drawn from net

file (and subsequently be overridden by the real source file that comes after it), and "-a" tells the compiler to leave the generated assembler files behind. You can just as well use OPT="-a".

Darek

Reply by email

Jonas Maebe
to Unknown author: I found the error link.res should be so (its generic from compiler/systems/tlinux.pas):…
Show quoted text 20 lines
> > On 12 Dec 2009, at 15:38, wrote: > >> /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld:./link.res: file format >> not >> recognized; treating as linker script >> /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld:./link.res:289: syntax >> error I found the error link.res should be so (its generic from compiler/systems/tlinux.pas): /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ . = ALIGN(0x8000) - ((0x8000 - .) & (0x8000 - 1)); . = DATA_SEGMENT_ALIGN (0x8000, 0x1000); /* Exception handling */ I've it compare with my and codesourcery binutils

I guess it's because you are using GNU ld 2.17. The built-in FPC linker script comes from GNU ld 2.18.

Jonas

Reply by email

Unknown author
to Jonas Maebe: I can't help with uclibc, I have a regular GNU toolchain. What kind of linker are you…
Show quoted text 8 lines
On 12 Dec 2009, at 15:38, wrote: > /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld:./link.res: file format > not > recognized; treating as linker script > /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld:./link.res:289: syntax > error

I found the error

link.res should be so (its generic from compiler/systems/tlinux.pas):

/* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ . = ALIGN(0x8000) - ((0x8000 - .) & (0x8000 - 1)); . = DATA_SEGMENT_ALIGN (0x8000, 0x1000);
/* Exception handling */

I've it compare with my and codesourcery binutils

Darek

Show quoted text 13 lines
> pp.pas(223,27) Error: Error while linking > pp.pas(223,27) Fatal: There were 1 errors compiling module, stopping > Fatal: Compilation aborted > make[3]: *** [ppcarm] Błąd 1 > make[3]: Opuszczenie katalogu `/home/darek2008/svn-fpc/compiler' > make[2]: *** [cycle] Błąd 2 > make[2]: Opuszczenie katalogu `/home/darek2008/svn-fpc/compiler' > make[1]: *** [compiler_cycle] Błąd 2 > make[1]: Opuszczenie katalogu `/home/darek2008/svn-fpc' > make: *** [build-stamp.arm-linux] Błąd 2 I can't help with uclibc, I have a regular GNU toolchain. What kind of linker are you using? (what does "ld --version" write?)

from toolchain
GNU ld version 2.17
Copyright 2005 Free Software Foundation, Inc.

Show quoted text 5 lines
> the same as crossinstall build has success, That's probably because it doesn't recompile everything, so it is just copying some old files.

Its not that case

Darek

Reply by email