Ok, so after much head banging I appear to have a working toolchain that will allow me to compile
lazarus for powerpc-linux from my i386 machine.
The binutils and fpc part was easy. Getting the gtk2 and other required libs was a bit harder (made
much easier by Debian's new "Multistrap" application).
I had a huge fight for a couple of hours until I realised the -XR option of freepascal did not do
what I thought it did.. (either that or its broken)
To get it to compile, I need to remove the absolute paths in /opt/cross/api/powerpc/usr/lib/libc6.so
& /opt/cross/api/powerpc/usr/lib/libpthread.so. Once I do that I get the following error.
The result is I can compile lazarus, startlazarus and all my own applications, but the compile of
lazbuild dies with the following ..
/opt/cross/bin/powerpc-linux-ar: creating ../units/powerpc-linux/libplazbuild.a
Compiling resource ../units/powerpc-linux/lazbuild.or
Linking ../lazbuild
/opt/cross/bin/powerpc-linux-ld: warning: ../link.res contains output sections;
did you forget -T?
/opt/cross/api/powerpc/usr/lib/libc_nonshared.a(elf-init.oS): In function
`__libc_csu_init':
(.text+0x54): undefined reference to `_init'
lazbuild.lpr(1227) Error: Error while linking
lazbuild.lpr(1227) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[2]: *** [lazbuild] Error 1
I'm compiling with :
make OS_TARGET=linux CPU_TARGET=powerpc LCL_PLATFORM=gtk2 OPT="-gl -CX
-k'-L/opt/cross/api/powerpc/lib -L/opt/cross/api/powerpc/usr/lib -rpath-link
/opt/cross/api/powerpc/usr/lib -rpath-link /opt/cross/api/powerpc/lib' -Xd " all
It does not fuss me as I never use lazbuild anyway on my cross architectures, but I thought I'd post
it just in case someone bumps up against it.
In addition to native, I can now compile i386-mingw-win32, i386-darwin-carbon,
powerpc-darwin-carbon, powerpc-linux-gtk2. Onwards to arm-linux-gtk2... :)
b...@bkmac:~/devel/fpc/lazarus$ fpc
Free Pascal Compiler version 2.4.1 [2010/06/04] for i386
Copyright (c) 1993-2009 by Florian Klaempfl
/opt/cross/lib/fpc/2.4.1/ppc386 [options] <inputfile> [options]
b...@bkmac:~/devel/fpc/lazarus$ /opt/cross/bin/powerpc-linux-ld -v
GNU ld (GNU Binutils) 2.20.51.20100604
Brad
--
Dolphins are so intelligent that within a few weeks they can
train Americans to stand at the edge of the pool and throw them
fish.
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus