When compiling software on the Solaris OS, great care must go into setting the proper environment variables prior to building the software.  Recently while making an entire suite of libraries and application software, I noticed one of two things would happen:

  1. The software would not compile until /usr/ucblib was added to the library path
  2. The software would compile, but not run until /usr/ucblib was added to the library path

I found that some of my newly compiled software was linking in the legacy /usr/ucblib/ucblib.so.1 library.  To prevent this from happening, I removed /usr/ucb from my PATH environment variable, and made sure that /usr/ucblib was not defined in my LD_LIBRARY_PATH at build time.

The following command helps show library dependencies:

$ ldd httpd
        libz.so =>       /usr/lib/libz.so
        libssl.so.0.9.8 =>       /usr/sfw/lib/libssl.so.0.9.8
        libcrypto.so.0.9.8 =>    /usr/sfw/lib/libcrypto.so.0.9.8
        libaprutil-0.so.0 =>     /usr/sfw/lib/libaprutil-0.so.0
        libexpat.so.0 =>         /usr/lib/libexpat.so.0
        libiconv.so.2 =>         /usr/lib/libiconv.so.2
        libapr-0.so.0 =>         /usr/sfw/lib/libapr-0.so.0
        libsendfile.so.1 =>      /usr/lib/libsendfile.so.1
        librt.so.1 =>    /usr/lib/librt.so.1
        libm.so.1 =>     /usr/lib/libm.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libresolv.so.2 =>        /usr/lib/libresolv.so.2
        libpthread.so.1 =>       /usr/lib/libpthread.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libgcc_s.so.1 =>         /usr/sfw/lib/libgcc_s.so.1
        libaio.so.1 =>   /usr/lib/libaio.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        libthread.so.1 =>        /usr/lib/libthread.so.1
        /usr/platform/SUNW,Sun-Fire-V240/lib/libc_psr.so.1

The command issued above shows that the httpd binary file does NOT have any dependencies on the /usr/ucblib libraries.