Linking improvements in Cool Stack 1.3

linkingimprovements CoolStack 1.3 has improved linking of various components. To make recent versions of apache, php and other web stack components, coolstack needs lots of base libraries. Some of these libraries are installed in /usr/lib and some are installed in /usr/sfw/lib. Here are the requirements for coolstack :
  • Need to bundle higher version of library than is available in S10. Example is libxml2. php 5 doesn't compile with libxml2 shipped with S10.
  •  Use as many as /usr/lib and /usr/sfw/lib libraries to avoid huge download size of packages.
  • When a library is present at two location, set the RPATH/RUNPATH in libraries correctly so that application will look in /opt/coolstack/lib directory first and then it will look into /usr/sfw/lib directory.

Duplicated libraries caused lots of trouble in coolstack. Here are few issues which we encountered in Cool Stack 1.2.
  1.  CoolStack 1.2 bundled libxml2 but didn't bundle libxslt. libxslt needs libxml2.  Let us run the ldd on php extension xsl.so. I have edited the output to make it brief :
    bash-3.00# ldd /opt/coolstack/php5/lib/php/extensions/no-debug-non-zts-20060613/xsl.so
    libreadline.so.5 => /opt/coolstack/lib/libreadline.so.5
    libcurses.so.1 => /lib/libcurses.so.1
    libexslt.so.0 => /usr/lib/libexslt.so.0
    libxslt.so.1 => /usr/lib/libxslt.so.1
    libxml2.so.2 => /opt/coolstack/lib/libxml2.so.2
    ...
    libxml2.so.2 => /usr/lib/libxml2.so.2
    ...
    Note that libxml2 is loaded twice. The reason is that when libxslt.so was loaded, it loaded libxml2.so from /usr/lib directory not from /opt/coolstack/lib directory. Reason is obvious /usr/lib/libxslt.so looks for a particular libxml2 (SUNW_1.6) and find it in /usr/lib directory. The result was obvious, xsl application failed to work with coolstack 1.2. Php crashed.

  2. CoolStack 1.2 bundled libfreetype but didn't bundle libfontconfig. Php's gd extension needs libgd.so. Here is the output (edited) of ldd on libgd.so.
    bash-3.00# ldd /opt/coolstack/lib/libgd.so
    ...
    libfontconfig.so.1 => /usr/lib/libfontconfig.so.1
    libfreetype.so.6 => /opt/coolstack/lib/libfreetype.so.6
    libpng12.so.0 => /usr/lib/libpng12.so.0
    libiconv.so.2 => /opt/coolstack/lib/libiconv.so.2
    ...
    libfreetype.so.6 => /usr/sfw/lib/libfreetype.so.6
    libexpat.so.0 => /usr/sfw/lib/libexpat.so.0
    ...
    Note that libfreetype.so is loaded twice. Once from /opt/coolstack/lib directory and once from /usr/sfw/lib directory. /usr/sfw/lib/libfreetype.so was loaded by /usr/lib/libfontconfig.so. If you look at the RPATH of libfontconfig, libfontconfig looks for libfreetype from /usr/sfw/lib directory.
    bash-3.00# dump -Lvp /usr/lib/libfontconfig.so.1 | grep PATH
    [9] RUNPATH /usr/sfw/lib
    [10] RPATH /usr/sfw/lib
    I don't know what was the effect of the above problem but I believe it would have caused problem in gd's functionality.
  3. libexpat.so is present in /usr/sfw/lib which can be accedently get preference over /opt/coolstack/apache2/lib/libexpat.so
  4. libmysqlclient.so is present in /usr/sfw/lib. Clients can accidently load /usr/sfw/lib version, instead of /opt/coolstack/mysql_32bit/lib/mysql/libmysqlclient.so
Linking improvements in Cool Stack 1.3
  • 1. libxslt is now bundled in CSKruntime package.
  • libfontconfig is now bundled in CSKlibs package.
  • To handle dependent libraries on /usr/sfw/lib CoolStack 1.3 now creates symlink in /opt/coolstack/lib directory. Similarily symlinks have been created to include header files from /usr/sfw/include.
  • To the best of it's effort, none of the libraries have /usr/sfw/lib in it's RPATH/RUNPATH.
  • Almost all of the places where /usr/sfw was passed in configure options, now /opt/coostack is passed as a configure option. E.g. --with-ssl=/usr/sfw is replaced with --with-ssl=/opt/coolstack
  • Any library which links with libmysqlclient, /opt/coolstack/mysql_32bit/lib/mysql is added into it's RPATH.
  • libtool files create problems in linking other components. Therefore libtool files (.la) are not bundled in coolstack 1.3.
Comments:

Post a Comment:
Comments are closed for this entry.
About

Basant Kukreja

Search

Top Tags
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today