Sign in Join

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

Mailing lists / fpc-devel / 2009-04

Can you cross compile from Intel OS X to Linux?

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Chas. Owens

Is it possible to cross compile a Pascal program from Intel OS X to Intel Linux using fpc? I see the -Tlinux option in the docs, but I get

/usr/local/bin/fpc -Tlinux hw.pas
Free Pascal Compiler version 2.2.2 [2008/08/03] for i386 Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Linux for i386
Compiling hw.pas
Fatal: Can't find unit system used by HelloWorld
Fatal: Compilation aborted
Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)

when I try to use it (I have no problem compiling native code).

Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.

Reply by email

Jonas Maebe
to Chas. Owens
Chas. Owens wrote
Is it possible to cross compile a Pascal program from Intel OS X to Intel Linux using fpc?

Yes, but you first need
a) cross-compiled GNU binutils for targeting Linux b) compile the FPC units for the Linux target

From a previous mail (to fpc-pascal):

***
You have compile and install the GNU binutils for Linux/i386 (or Linux/ powerpc) by downloading the binutils sources, unpacking them, and executing the following commands in the resulting directory: ./configure --target=i386-linux-gnu
make
sudo make install

(use "--target=powerpc-linux-gnu" for powerpc)

Then compile the rtl and all other units for this target ("make CPU_TARGET=i386 OS_TARGET=linux all" or so in the top level FPC directory). See http://www.stack.nl/~marcov/buildfaq.pdf for more information.
***

Jonas

Reply by email

Dr. Karl-Michael Schindler

Hi

If you use fink for the installation of fpc, you can install everything you need with

fink install fpc-i386-linux

then compiling with -Tlinux should work.

this installs also the linux binutils as dependencies. I haven't tested it heavily, so I am interested in feedback.

Best wishes - Michael

Reply by email

Chas. Owens
to Dr. Karl-Michael Schindler
Dr. Karl-Michael Schindler wrote 10 lines
Hi If you use fink for the installation of fpc, you can install everything you need with fink install fpc-i386-linux then compiling with -Tlinux should work. this installs also the linux binutils as dependencies. I haven't tested it heavily, so I am interested in feedback.

Well, it worked for my hello world program.

Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.

Reply by email