Difference between revisions of "Lazarus on Solaris"
Line 55: | Line 55: | ||
$ gtk-demo | $ gtk-demo | ||
+ | |||
+ | |||
+ | '''gld''' | ||
+ | |||
+ | Gnu ld creates binaries that are not completely solaris abi compatible. malloc (libc) for example always returns a null pointer. FPC uses the solaris linker by using the -Xn compiler option (not documented). Solaris ld is in /usr/css/bin and gnu binutils has installed the link /usr/bin/ld : | ||
+ | |||
+ | <nowiki># rm /usr/bin/ld</nowiki> | ||
+ | |||
+ | <nowiki># ln -s /usr/css/bin/ld /usr/bin/ld</nowiki> | ||
+ | |||
+ | Note that you need to specify the -Xn compiler option for all your fpc and lazarus programs. Lazarus programs linked without -Xn crash with the message GLib-ERROR ... Failed to allocate 42 bytes... core dump. | ||
== Get and Build Sources == | == Get and Build Sources == | ||
Line 62: | Line 73: | ||
$ cd fpc | $ cd fpc | ||
− | $ make clean all | + | $ make clean all OPT="-Xn" |
$ su | $ su | ||
Line 74: | Line 85: | ||
$ cd lazarus | $ cd lazarus | ||
− | $ make clean all OPT="-k- | + | $ make clean all OPT="-Xn -k-L/usr/local/lib" FPC=/usr/lib/fpc/2.5.1/ppc386 |
− | |||
− | |||
− | |||
− | |||
− | |||
== Solaris 11 Express== | == Solaris 11 Express== | ||
Line 87: | Line 93: | ||
Depending on the installation media, gnome is already installed or can easily be installed by installing the slim_install package. subversion and gnu-binutils can be installed from the solaris repository with "pkg install" or the graphical Package Manager. | Depending on the installation media, gnome is already installed or can easily be installed by installing the slim_install package. subversion and gnu-binutils can be installed from the solaris repository with "pkg install" or the graphical Package Manager. | ||
− | + | '''gld''' | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | '' | ||
− | + | solaris ld is already installed in /usr/bin. The use of -Xn is still mandatory. |
Revision as of 13:38, 15 July 2011
This howto explains the steps to get lazarus svn and fpc svn up and running starting from a clean Solaris 10 system (adapt to your processor, I'm on x86). It assumes that you have already used svn and build fpc and lazarus from source before.
Install the FPC Compiler Binaries
Get and install fpc 2.4.4 from ftp://193.224.143.39/pub/fpc/dist/2.4.4/i386-solaris/fpc-2.4.4.i386-solaris.tar.gz and the install script ftp://193.224.143.39/pub/fpc/dist/2.4.4/i386-solaris/install.sh for x86.
For Solaris SPARC the most recent version is 2.4.2. It can be downloaded from ftp://193.224.143.39/pub/fpc/dist/2.4.2/sparc-solaris/fpc-2.4.2.sparc-solaris.tar.gz, the install script from ftp://193.224.143.39/pub/fpc/dist/2.4.2/sparc-solaris/install.sh.
Install Required Libraries
Install following packages from http://sunfreeware.com/. These are the versions at the time of writing (7/2011). This is a long list because gnu binutils, make, subversion (with a lot of dependencies) and gtk2 are pulled in:
apache-2.2.19 atk-1.18.0 binutils-2.21.1 cairo-1.4.10 coreutils-8.11 expat-2.0.1 fontconfig-2.8.0 freetype-2.4.2 gcc-3.4.6 gdb-6.8 glib-2.25.13 gtk+-2.12.0 jpeg-8a libiconv-1.13.1 libintl-3.4.0 make-3.82 ncurses-5.7 neon-0.29.5 openldap-2.4.24 openssl-1.0.0d pango-1.18.2 render-0.8-sol10-intel-local renderproto-0.9.3 sasl-2.1.21 subversion-1.6.12 tiff-3.9.4 xft-2.1.2-sol10-intel-local xrender-0.8.3-sol10-intel-local zlib-1.2.5
These versions are all available for SPARC.
Adapt your PATH variable to get the gnu version of the binutils:
$ export PATH=/usr/local/bin:$PATH
$ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
Check your GTK2 installation:
$ gtk-demo
gld
Gnu ld creates binaries that are not completely solaris abi compatible. malloc (libc) for example always returns a null pointer. FPC uses the solaris linker by using the -Xn compiler option (not documented). Solaris ld is in /usr/css/bin and gnu binutils has installed the link /usr/bin/ld :
# rm /usr/bin/ld
# ln -s /usr/css/bin/ld /usr/bin/ld
Note that you need to specify the -Xn compiler option for all your fpc and lazarus programs. Lazarus programs linked without -Xn crash with the message GLib-ERROR ... Failed to allocate 42 bytes... core dump.
Get and Build Sources
$ svn co http://svn.freepascal.org/svn/fpc/trunk fpc
$ cd fpc
$ make clean all OPT="-Xn"
$ su
# make install INSTALL_PREFIX=/usr
/etc/fpc.cfg installed with 2.4.4 is fine for your new 2.5.1 installation.
$ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
$ cd lazarus
$ make clean all OPT="-Xn -k-L/usr/local/lib" FPC=/usr/lib/fpc/2.5.1/ppc386
Solaris 11 Express
Dependencies
Depending on the installation media, gnome is already installed or can easily be installed by installing the slim_install package. subversion and gnu-binutils can be installed from the solaris repository with "pkg install" or the graphical Package Manager.
gld
solaris ld is already installed in /usr/bin. The use of -Xn is still mandatory.