Sign in Join

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

Mailing lists / lazarus / 2012-03

FPC cross compiling

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Antonio Fortuny

Hi all.

I want to turn my current Lazarus installation to cross-compile for Linux. The current environment is:
- openSuse 12.1 x86_64
- FPC 2.4.4 x86_64
- Lazarus 0.9.31 x86_64
I want to compile for Linux i386 too.

I have dowloaded & installed ppc386 and compiled fpc basics using:
0. # cd /usr/share/fpcsrc/rtl/linux
1. # make all CPU_TARGET=i386
a lot of warnings but all ran OK, then
2. # make install CPU_TARGET=i386
same for fpc packages
got *.ppu in /usr/local/lib/fpc/2.4.4/units/i386-linux and not in /usr/lib64/fpc/2.4.4/units/i386-linux as I expected. no problem I moved from one directory to the second one aprarently all rtl units have been compiled.
same thing with Makefile in /usr/share/fpcsrc/packages with same result: move all ppu
Is it some variable to play with that I missed ?
After this I compiled the Lazarus components and packages until I could compile my project itself
All i386 lib folders appear to be OK so I have now in lib folders two subfolder named "i386-linux" and x86_-64-linux".
So far so good. But when compiling the project I get an error from the linker:
"Error: Error while linking" without any other explanation and a new created tab page in the editor whose name is the proejct name and, on the first lines this text:
????%??
which look like binary data and followed by the compiler warnings. The reference is on this wiki page:
"http://wiki.lazarus.freepascal.org/Cross_compiling" At this point I wonder is I did everything I need

Is it serious, doctor ?

Antonio.

Reply by email

Sven Barth
to Antonio Fortuny
Antonio Fortuny wrote 15 lines
Hi all. I want to turn my current Lazarus installation to cross-compile for Linux. The current environment is: - openSuse 12.1 x86_64 - FPC 2.4.4 x86_64 - Lazarus 0.9.31 x86_64 I want to compile for Linux i386 too. I have dowloaded & installed ppc386 and compiled fpc basics using: 0. # cd /usr/share/fpcsrc/rtl/linux 1. # make all CPU_TARGET=i386 a lot of warnings but all ran OK, then 2. # make install CPU_TARGET=i386 same for fpc packages

I would do a

"make all CPU_TARGET=i386"

at the top level of the fpc source directory (you need to have full FPC sources for compilation). Then you can do a

"make crossinstall CPU_TARGET=i386"

When you've done this please report back whether your situation has improved (also it's adivceable to ask such questions on fpc-pascal instead of lazarus).

Regards,
Sven

Reply by email

Antonio Fortuny
to Sven Barth

Le 26/03/2012 10:21, Sven Barth a ?crit :

Show quoted text 15 lines
I would do a "make all CPU_TARGET=i386" at the top level of the fpc source directory (you need to have full FPC sources for compilation). Then you can do a "make crossinstall CPU_TARGET=i386" When you've done this please report back whether your situation has improved (also it's adivceable to ask such questions on fpc-pascal instead of lazarus). Regards, Sven

Can't "make all CPU_TARGET=i386" at root fpc source folder: no Makefile. Only at rtl and packages level
I guess that some veriables has to be set for destination units folder but I can cope with this for the time being.

More boring is the linking problem
I'll forget on this problem because I have some other things to do Tnaks anyway.

Antonio.

Reply by email

Sven Barth
to Antonio Fortuny
Antonio Fortuny wrote 21 lines
Le 26/03/2012 10:21, Sven Barth a ?crit : > I would do a > > "make all CPU_TARGET=i386" > > at the top level of the fpc source directory (you need to have full > FPC sources for compilation). Then you can do a > > "make crossinstall CPU_TARGET=i386" > > When you've done this please report back whether your situation has > improved (also it's adivceable to ask such questions on fpc-pascal > instead of lazarus). > > Regards, > Sven Can't "make all CPU_TARGET=i386" at root fpc source folder: no Makefile. Only at rtl and packages level I guess that some veriables has to be set for destination units folder but I can cope with this for the time being.

This is why I said you need the full source code. The only supported way is a full compilation. Anything else might work by luck only.

Regards,
Sven

Reply by email