[Lazarus] My Lazarus Dream: Cross Compile Linux64 -> Linux32 on Ubuntu 12.04

Bernd prof7bit at gmail.com
Wed Aug 22 18:07:02 CEST 2012


2012/8/22 Alexsander Rosa <alexsander.rosa at gmail.com>:
> Is it even possible? I've seen rumours of people doing this, but every
> tutorial I've tried failed.

I am successfully cross-compiling stuff (although no LCL) from Linux32
to Linux64. I assume the other way around should also be possible. It
looks like you are almost there, you only need to satisfy the library
dependencies.

Getting the cross compiler set up and running was easy, I did it from
source, not using any apt-get at all to not compromise my system. It
turned out that as and ld on Ubuntu 32 bit are already capable of
working with 32 and 64 binaries, all that was needed are the correct
command line switches, i found two small one-liner wrapper scripts for
as and ld somewhere in the wiki. Then I got FPC working, I assume you
have mastered this first step already.

The next problem are the linker errors. My concrete library that I am
cross compiling (its a libpurple plugin) depends on far less libraries
than lcl but I still got a whole bunch of linker errors, then I did he
following:

I made a new empty folder /usr/lib64 (I guess you might want to make a
folder /usr/lib32) and make sure it is on the library search path for
ld, then I went through each of the errors one by one and searched
which deb package (the libsomething and the corresponding
libsomething-dev) would contain these libs on the target platform,
downloaded the .deb and extracted them manually (NOT with dpkg!) and
copied the libs (and the symlinks from the -dev packages) to my new
lib folder, made sure all symlinks were working and tried to compile
and link again and each time I added more needed libraries the errors
got less until it finally succeeded. It looks like this is the only
thing that is still missing and you are only a few hours away from
success.




More information about the Lazarus mailing list