[ANNOUNCEMENT] fpcup diving deeper into crosscompiling

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

[ANNOUNCEMENT] fpcup diving deeper into crosscompiling

Reinier Olislagers
fpcup is a program that automates downloading and installing fpc and
Lazarus from svn.

I've finished the first "real" crosscompiling module [2] for win=>linux
i386 using the cross binutils and libs supplied by www.crossfpc.com [1]

If you want to test it, add a cross directory under the fpcup "root"
installdir directory (e.g. c:\development\cross, and e.g. regular fpc
sources in c:\development\fpc etc)

Then place the directory layout provided by the crossfpc project there,
so you get

c:\development\cross\bin\arm-android\arm-linux-androideabi-ar.exe
c:\development\cross\bin\arm-android\arm-linux-androideabi-as.exe
...
c:\development\cross\bin\i386-linux\i386-linux-ar.exe
c:\development\cross\bin\i386-linux\i386-linux-as.exe
...
c:\development\cross\lib\arm-android\libc.a
c:\development\cross\lib\arm-android\libc.so
...
c:\development\cross\lib\x86_64-linux\libc.a
c:\development\cross\lib\x86_64-linux\libc.so
...

then run regular fpcup
fpcup
followed by the cross compiler version:
fpcup --cputarget=i386 --ostarget=linux

Now continuing to work on:
- win32=>arm-android
- win32=>arm-linux
- win64=>linux

Contributions for other cross compilers are welcome - see the
m_cross*.pas units for simple examples (you only need to fill in the
code that checks for the proper binutils and crosslibs in the right
location).

The fpcup source code can be downloaded via
https://bitbucket.org/reiniero/fpcup/src
Haven't updated the binary downloads yet

Lots of thanks to the crossfpc guys!

[1] You can also download them via
https://bitbucket.org/reiniero/fpcup/downloads/CrossFPC_binutils_libs.7z
[2] the Linux,FreeBSD,OSX=>Windows one was not too hard thanks to built
in FPC support ;)
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: [ANNOUNCEMENT] fpcup diving deeper into crosscompiling

Jonas Maebe-2

On 02 Aug 2013, at 16:00, Reinier Olislagers wrote:

> c:\development\cross\lib\arm-android\libc.a
> c:\development\cross\lib\arm-android\libc.so
> ...
> c:\development\cross\lib\x86_64-linux\libc.a
> c:\development\cross\lib\x86_64-linux\libc.so

That is only guaranteed to produce binaries that will work correctly on whatever distribution these *.so files come from (linking against the static versions will in principle work fine anywhere, although there have been some bug reports about statically linking FPC programs to libc). You cannot distribute a "generic" version of Linux shared libraries libraries to which you can link and after which the result will always work anywhere. It may work most of the time, but definitely not always and should not be promoted. Developers should always link against the libraries from the Linux distribution/version they want to support.


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

Re: [ANNOUNCEMENT] fpcup diving deeper into crosscompiling

Reinier Olislagers
On 02/08/2013 16:27, Jonas Maebe wrote:
> That is only guaranteed to produce binaries that will work correctly
> on whatever distribution these *.so files come from
<snip>
> Developers should
> always link against the libraries from the Linux distribution/version
> they want to support.

Yes, that is why fpcup does not automatically download any .so/.a files.
Users can download whatever libraries they want. fpcup will check for a
couple of filenames to see if attempting the cross compile makes sense
and go. It does not force a certain library version.

The crossfpc package is a nice way to get a lot of cross compiling
binutils in one go... having some libs is a bonus.

NB: currently working on modifying fpc.cfg for cross compilation. Had
forgotten about that :)

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

Re: [ANNOUNCEMENT] fpcup diving deeper into crosscompiling

Anthony Walter-3
In reply to this post by Reinier Olislagers
Keep up the good work. When you get to android + arm please keep me advised. I will be providing the next version of my framework in a few days and the version after that will be focused on getting android + arm projects working.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal