| 1 |
(This file public domain. Originally written by Mojca Miklavec, 2015-16.) |
| 2 |
|
| 3 |
Compiling TeX binaries on Solaris |
| 4 |
|
| 5 |
Solaris 9 has been out of official support for a while and making |
| 6 |
software compile on that platform is challenging, so it hardly makes any |
| 7 |
sense to try to support it. |
| 8 |
|
| 9 |
Solaris 10 reaches end of support in January 2021: |
| 10 |
http://en.wikipedia.org/wiki/Solaris_(operating_system)#Version_history |
| 11 |
and TeX Live binaries try to stay compatible with that OS version. |
| 12 |
|
| 13 |
Every once in a while a new Update is shipped: |
| 14 |
U1 2006-01 |
| 15 |
U2 2006-06 |
| 16 |
U3 2006-11 |
| 17 |
U4 2007-08 |
| 18 |
U5 2008-05 |
| 19 |
U6 2008-10 |
| 20 |
U7 2009-05 |
| 21 |
U8 2009-10 |
| 22 |
U9 2010-09 |
| 23 |
U10 2011-08 |
| 24 |
U11 2013-01 |
| 25 |
and the problem is that binaries compiled on an updated system might not |
| 26 |
run on an older one. |
| 27 |
|
| 28 |
You can check the libc version with |
| 29 |
> pvs -no /usr/lib/libc.so |
| 30 |
|
| 31 |
> pvs -d /lib/libc.so.1 | grep SUNW |
| 32 |
SUNW_1.23; |
| 33 |
SUNW_1.22.7; |
| 34 |
SUNW_1.22.6; |
| 35 |
/.../ |
| 36 |
SUNW_1.1; |
| 37 |
SUNW_0.9; |
| 38 |
SUNW_0.8; |
| 39 |
SUNW_0.7; |
| 40 |
|
| 41 |
Building for 64-bit |
| 42 |
=================== |
| 43 |
|
| 44 |
All binaries have been compiled with gcc-5.5. |
| 45 |
The only thing that is needed to build for 64-bit is to define |
| 46 |
export CC="/path/to/gcc-5.5 -m64" |
| 47 |
export CXX="/path/to/g++-5.5 -m64" |
| 48 |
|
| 49 |
Building wget |
| 50 |
============= |
| 51 |
|
| 52 |
Building wget on the latest version of Solaris 10 will make the binary |
| 53 |
useless on older Updates of Solaris 10 as it would depend on SUNW_1.22.7. |
| 54 |
|
| 55 |
One option to build wget in a "compatible way" would be to build it on |
| 56 |
Solaris 9 with "cc". The other hack is the usage of map files. |
| 57 |
|
| 58 |
To make it work on older systems the following hack was used (thanks to |
| 59 |
the OpenCSW community): |
| 60 |
https://buildfarm.opencsw.org/source/xref/opencsw/csw/mgar/pkg/wget/trunk/files/map.wget |
| 61 |
|
| 62 |
> cat mapfile |
| 63 |
libc.so - SUNW_1.22 SUNWprivate_1.1 $ADDVERS=SUNW_1.22; |
| 64 |
|
| 65 |
export LD_OPTIONS="-M $PWD/mapfile" |
| 66 |
|
| 67 |
And the following configuration was used to get rid of dependencies (which |
| 68 |
are not installed on Solaris by default): |
| 69 |
|
| 70 |
> ./configure --enable-ipv6 --disable-iri --disable-nls \ |
| 71 |
--disable-ntlm --disable-pcre --without-libiconv-prefix \ |
| 72 |
--without-libintl-prefix --without-libuuid --without-libpsl \ |
| 73 |
--without-ssl --without-zlib |
| 74 |
|
| 75 |
The binary was built with gcc 5.2. |
| 76 |
The definition '#define _XOPEN_SOURCE 500' has been removed from 'src/sysdep.h' |
| 77 |
to avoid compile error due to the fact that GCC 5 switched to -std=99. |
| 78 |
|
| 79 |
On i386 and x86_64 one has to manually add "-lsocket -lnsl" to the last linker command. |
| 80 |
This should be reported upstream. |
| 81 |
|
| 82 |
> pvs Master/tlpkg/installer/wget/wget.sparc-solaris |
| 83 |
libsocket.so.1 (SUNW_1.4); |
| 84 |
libnsl.so.1 (SUNW_1.7); |
| 85 |
librt.so.1 (SUNW_1.2); |
| 86 |
libc.so.1 (SUNW_1.22, SUNWprivate_1.1); |
| 87 |
|
| 88 |
> ./Master/tlpkg/installer/wget/wget.sparc-solaris --version |
| 89 |
GNU Wget 1.17.1 built on solaris2.10. |
| 90 |
+digest -gpgme -https +ipv6 -iri +large-file -metalink -nls -ntlm |
| 91 |
+opie -psl -ssl |
| 92 |
|
| 93 |
(That list of configure options is current as of the above version of |
| 94 |
wget; not all those dependencies are present in earlier versions.) |
| 95 |
|
| 96 |
Building xz |
| 97 |
=========== |
| 98 |
|
| 99 |
The xz binaries would likewise depend on SUNW_1.22.6 by default, so we |
| 100 |
used the same hack with a map file to make it work on slightly older |
| 101 |
systems. |
| 102 |
|
| 103 |
> cat mapfile |
| 104 |
libc.so - SUNW_1.22 SUNWprivate_1.1 $ADDVERS=SUNW_1.22; |
| 105 |
|
| 106 |
> export LD_OPTIONS="-M $PWD/mapfile" |
| 107 |
> ./configure --disable-nls --disable-shared |
| 108 |
|
| 109 |
> pvs Master/tlpkg/installer/xz/xz.sparc-solaris |
| 110 |
librt.so.1 (SUNW_1.2); |
| 111 |
libpthread.so.1 (SUNW_1.2); |
| 112 |
libc.so.1 (SUNW_1.22); |
| 113 |
> pvs Master/tlpkg/installer/xz/xzdec.sparc-solaris |
| 114 |
libc.so.1 (SUNW_1.22); |
| 115 |
|
| 116 |
If users need binaries to run on even older systems, we can target what |
| 117 |
is desired by changing the map file. |
| 118 |
|
| 119 |
Building asymptote |
| 120 |
================== |
| 121 |
|
| 122 |
Asymptote has been built with the following flags: |
| 123 |
|
| 124 |
export CC=/opt/csw/bin/gcc-5.5 |
| 125 |
export CXX=/opt/csw/bin/g++-5.5 |
| 126 |
./configure --prefix=/tmp/asyinst --enable-texlive-build \ |
| 127 |
--disable-fftw --disable-offscreen --disable-sigsegv \ |
| 128 |
--disable-gl --disable-gsl --disable-readline |
| 129 |
|
| 130 |
Even though GL, GSL and readline should generally not be disabled, |
| 131 |
the resulting binaries would not be portable enough otherwise. |
| 132 |
|
| 133 |
Because a newer gcc compiler was used we had to link statically against stdlib. |
| 134 |
The following patch/hack took care of this: |
| 135 |
|
| 136 |
--- Makefile.in.orig |
| 137 |
+++ Makefile.in |
| 138 |
@@ -12,7 +12,7 @@ |
| 139 |
GCPPLIB = @GCPPLIB@ |
| 140 |
GCLIBS = $(GCPPLIB) $(GCLIB) |
| 141 |
LFLAGS = @LDFLAGS@ |
| 142 |
-LIBS = $(LFLAGS) @PTHREAD_LIBS@ @GLEW@ @LIBS@ $(GCLIBS) |
| 143 |
+LIBS = $(LFLAGS) $(GCLIBS) -nodefaultlibs -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic @PTHREAD_LIBS@ @GLEW@ @LIBS@ -lgcc_eh -lgcc -lc -lm |
| 144 |
DOSLIBS = $(subst -lncurses, -ltermcap, $(LIBS)) -lgdi32 -lwinmm -s -static |
| 145 |
|
| 146 |
PERL = perl |
| 147 |
------ |
| 148 |
|
| 149 |
The resulting binary depends on: |
| 150 |
|
| 151 |
> pvs asy |
| 152 |
libnsl.so.1 (SUNW_0.7); |
| 153 |
librt.so.1 (SUNW_1.2); |
| 154 |
libm.so.2 (SUNW_1.2); |
| 155 |
libc.so.1 (SUNW_1.22, SUNWprivate_1.1); |
| 156 |
> ldd asy |
| 157 |
libnsl.so.1 => /lib/libnsl.so.1 |
| 158 |
librt.so.1 => /lib/librt.so.1 |
| 159 |
libz.so.1 => /usr/lib/libz.so.1 |
| 160 |
libm.so.2 => /lib/libm.so.2 |
| 161 |
libc.so.1 => /lib/libc.so.1 |
| 162 |
libmp.so.2 => /lib/libmp.so.2 |
| 163 |
libmd.so.1 => /lib/libmd.so.1 |
| 164 |
libscf.so.1 => /lib/libscf.so.1 |
| 165 |
libaio.so.1 => /lib/libaio.so.1 |
| 166 |
libdoor.so.1 => /lib/libdoor.so.1 |
| 167 |
libuutil.so.1 => /lib/libuutil.so.1 |
| 168 |
libgen.so.1 => /lib/libgen.so.1 |
| 169 |
|
| 170 |
Building texlive |
| 171 |
================ |
| 172 |
|
| 173 |
Additional settings were needed to compile TeX Live with gcc 5.5: |
| 174 |
* ./Build --without-iconv |
| 175 |
|
| 176 |
The '--without-iconv' makes sure to avoid linking against libiconv |
| 177 |
which is not available on SunOS by default. |
| 178 |
|
| 179 |
luajittex seems to be broken on Solaris 10 x86_64 (even if it works |
| 180 |
with Solaris 11) and doesn't support Sparc, so it was only compiled |
| 181 |
for i386. |
| 182 |
|