Sign in Join

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

Mailing lists / fpc-pascal / 2012-03

Why can't you cross-compile from x86_64-linux to i386-linux?

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

As the subject line says? As can be seen below, i386 is not a supported target.

-------------------------------
$ fpc -i
Free Pascal Compiler version 2.6.1

Compiler Date : 2012/02/29
Compiler CPU Target: x86_64

Supported targets:
Linux for x86-64
FreeBSD for x86-64
Win64 for x64
Darwin for x86_64
Solaris for x86-64 (under development)

...
-------------------------------

Regards,   - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net
Sven Barth
to Graeme Geldenhuys
Graeme Geldenhuys wrote 19 lines
As the subject line says? As can be seen below, i386 is not a supported target. ------------------------------- $ fpc -i Free Pascal Compiler version 2.6.1 Compiler Date : 2012/02/29 Compiler CPU Target: x86_64 Supported targets: Linux for x86-64 FreeBSD for x86-64 Win64 for x64 Darwin for x86_64 Solaris for x86-64 (under development) ... -------------------------------

Graeme, please. You should be around here long enough to already know that. ;)

Your fpc is compiled for x86_64 which defaults to calling ppcx64 which can only compile for x86_64. If you now pass "fpc -i -Pi386" and have a ppcross386 compiler available in the location fpc looks for then you'll see the available targets for i386 (cross-)compilation. Same for other platforms like ARM, Sparc, PowerPC, etc.

Regards,
Sven

Graeme Geldenhuys
to Sven Barth
Sven Barth wrote
Graeme, please. You should be around here long enough to already know that. ;)

I hate cross-compiling because it never works for me, or gives very unstable executable as end result. But I wanted to cross-compile in a pinch - which clearly is not a good choice.

Your fpc is compiled for x86_64 which defaults to calling ppcx64 which can only compile for x86_64. If you now pass "fpc -i -Pi386" and have a ppcross386 compiler available in the location fpc looks for then you'll see

I have a ppc386 symlink in the same 'bin' directory as my 64-bit 'fpc' executable and this is what Lazarus gives me when I changed linking Target and CPU settings.... I guess there is a big difference between ppc386 and ppcross386. ;-)

[ see attached images ]

I guess I'll just have to setup a full blown "native" FPC for each platform I want to support in separate VM's. This clearly seems the safest and most reliable option (and what I have used to date - but I don't have a current 32-bit FPC for FreeBSD 9.0 setup, hence my attempt at cross compiling).

Thanks for responding though... I'm installing FPC from scratch in my FreeBSD VM now.

Regards,   - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net
Sven Barth
to Graeme Geldenhuys
Graeme Geldenhuys wrote 8 lines
On 7 March 2012 10:37, Sven Barth wrote: > > Graeme, please. You should be around here long enough to already know that. > ;) I hate cross-compiling because it never works for me, or gives very unstable executable as end result. But I wanted to cross-compile in a pinch - which clearly is not a good choice.

I normally don't have much problems with cross compiling...

Show quoted text 9 lines
> Your fpc is compiled for x86_64 which defaults to calling ppcx64 which can > only compile for x86_64. If you now pass "fpc -i -Pi386" and have a > ppcross386 compiler available in the location fpc looks for then you'll see I have a ppc386 symlink in the same 'bin' directory as my 64-bit 'fpc' executable and this is what Lazarus gives me when I changed linking Target and CPU settings.... I guess there is a big difference between ppc386 and ppcross386. ;-)

Hmm... according to the source of the fpc binary it should look for ppc386 as well as ppcross386 in the following directories:
* the directory given by -Xp
* the directory of the fpc binary
* all directories in $PATH

Thanks for responding though... I'm installing FPC from scratch in my FreeBSD VM now.

That's what I'm here for ;)

Regards,
Sven