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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Graeme Geldenhuys-2
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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

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

Sven Barth-2
Am 07.03.2012 08:33, schrieb 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)
>
> ...
> -------------------------------
>

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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

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

Graeme Geldenhuys-2
On 7 March 2012 10:37, Sven Barth <pascaldragon@*****> 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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Screenshot-Error.png (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Sven Barth-2
Am 07.03.2012 10:04, schrieb Graeme Geldenhuys:
> On 7 March 2012 10:37, Sven Barth<pascaldragon@*****>  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...

>> 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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal