Recent

Author Topic: Cross compiling instalation issues  (Read 4272 times)

guest63552

  • Guest
Cross compiling instalation issues
« on: January 14, 2019, 10:07:40 pm »
Following this tutorial:

http://wiki.lazarus.freepascal.org/Cross_compiling_for_Win32_under_Linux

On Ubuntu 18.10 and with FPC 3.0.4 I have installed Win32 and Win64 cross compilers. Actually, it seems that only Win64 is compiled, while after selecting Win32 In lazarus, IDE started to complain about missing CFG.

With ppc for 64-bit linux executable there are both new executable for Win32 and 64.

Is there anyone with experience in cross compiler installation to point what can be done. Is there any FPC utility which will show which versions of compiler executable  are installed and supported with Lazarus currently?


Handoko

  • Hero Member
  • *****
  • Posts: 5129
  • My goal: build my own game engine using Lazarus
Re: Cross compiling instalation issues
« Reply #1 on: January 15, 2019, 09:38:15 am »
It does not answer your question, but I think maybe you're interested to read this:
http://forum.lazarus.freepascal.org/index.php/topic,43204.msg302062.html#msg302062

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Cross compiling instalation issues
« Reply #2 on: January 15, 2019, 10:54:50 am »
po123, here are my notes from last time I did what you are trying to do. I hope they may be of some use to you ! In particular, note the Ubuntu problems I had in June 18

Davo

use (eg) Gdebi to install first the fpc then fpc-src. In this model, described here, I will then build the Lazarus IDE from source so all lazarus files end up in my home directory and I don't need to mess with permissions to to change them. The alt is to use the sourceforge lazarus deb but I found that a bit constricting.

So, in your home directory -

mkdir lazarus; cd lazarus
svn checkout  http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_8_4
svn checkout http://svn.freepascal.org/svn/fpcdocs/trunk fpcdocs
cd lazarus_1_8_4
make CPU_TARGET=x86_64

mv ~/.lazarus ~/.lazarus-180
./lazarus    // all good ? well done, thats a working Lazarus for this platform.

Setup Linux i386 compiler and Windows compilers

we need libc6-dev-i386 (they are just little bash scripts that call ld and as with specific options) :
which i386-linux-ld
which i386-linux-as

This needs to be done as root as the FPC source files are in /usr/share

$!/usr/bin/bash
FPCVER="3.0.4"
# Setup i386 underlying stuff
cd /usr/share/fpcsrc/$FPCVER
make all CPU_TARGET=i386
make crossinstall CPU_TARGET=i386

# Setup 32bit and 64 bit Windows
cd /usr/share/fpcsrc/$FPCVER
make clean all OS_TARGET=win32 CPU_TARGET=i386
make crossinstall OS_TARGET=win32 CPU_TARGET=i386 INSTALL_PREFIX=/usr
ln -sf /usr/lib/fpc/$FPCVER/ppcross386 /usr/bin/ppcross386

make clean all OS_TARGET=win64 CPU_TARGET=x86_64
make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64 INSTALL_PREFIX=/usr
ln -sf /usr/lib/fpc/$FPCVER/ppcrossx64 /usr/bin/ppcrossx64

# Make sure its all there (we should see ppcross386, ppcrossx64)
echo "watch for ppcross386, ppcrossx64"
ls -la /usr/lib/fpc/$FPCVER/ppcross*
ls -la /usr/bin/ppcross*

Test. In June 18 after upgrading desktop to 18.04 I found 32bit linux would fail because of three issues -
1. In /usr/lib/i386-linux-gnu  libpangocairo-1.0.so was a broken link. pointed to ~.4 and should have pointed to .14
2. In /usr/lib/i386-linux-gnu there was no libglib-2.0.so, however there was libglib-2.0.so.0 -> libglib-2.0.so.0.5600.1
3. the  fpc.cfg section #ifdef cpu386 needed to point to above
eg
-Fl/usr/lib/i386-linux-gnu
-Fl/usr/lib/gcc/x86_64-linux-gnu/7/32
-Fl/usr/lib32

update - Oct 18, apparenly glib was updated, my symlink was red, needed to update,  ln -s libglib-2.0.so.0.5600.2 libglib-2.0.so

On 16.04, /lib/i386-linux-gnu/libglib-2.0.so.0

Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018