Appendix B
Solaris, Shared Library, GCC

On Sun Solaris platforms when one tries to use the shared library version of LYRIC in an application (or other shared library), it is not possible to catch C++ exceptions. Strangely all exceptions coming from a shared library trap into a call to the abort function, even if the calling code embeds calls in try - catch frames.

This problem seems to be related to fact that the GCC collection that ships with Solaris, or that is available for download for the Solaris platform does not use the GNU linker per default. Experiences have shown that this problem is removed if the GNU linker from the binutils package is used to link the shared library.

Here are the steps to build GCC such that it uses the assembler and linker from the binutils package:

  1. Download the GNU binutils package from your favourite GNU mirror site.
  2. Build and install the binutils package:
    % tar -zxvf binutils-version.tar.gz
    % cd binutils-version
    % ./configure
    % make
    % make install
    Use command ./configure --help to see all options than can be configured, for example to change the default install path (/usr/local).
  3. Download the GNU gcc package from your favourite GNU mirror site.
  4. Build and install the gcc package:
    % tar -zxvf gcc-version.tar.gz
    % cd gcc-version
    % mkdir build
    % cd build
    % ../configure --with-gnu-as --with-gnu-ld \
          --with-as=gnu-path/bin/as \
          --with-ld=gnu-path/bin/ld
    % make bootstrap
    % make install
    Use command ./configure --help to see all options than can be configured, for example to change the default install path (/usr/local).
    The gnu-path is the path where ld and as from the binutils package got installed.