<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Adam Sherman &#187; solaris</title>
	<atom:link href="http://www.sherman.ca/archives/tag/solaris/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sherman.ca</link>
	<description>Mostly random thoughts on software, gear and the great outdoors.</description>
	<lastBuildDate>Fri, 09 Jul 2010 14:12:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Solaris Shared Library Troubleshooting Notes</title>
		<link>http://www.sherman.ca/archives/2008/03/25/solaris-shared-library-troubleshooting-notes/</link>
		<comments>http://www.sherman.ca/archives/2008/03/25/solaris-shared-library-troubleshooting-notes/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 15:28:35 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://www.sherman.ca/?p=108</guid>
		<description><![CDATA[Recently I have been building a few packages under an OpenSolaris Zone hosted by Joyent. Ran into a few issues with shared libraries, so here are my notes: Telling the Linker Where to Look You will often get an error like ld.so.1: conftest: fatal: libreadline.so.5: open failed: No such file or directory. This simply means [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been building a few packages under an OpenSolaris Zone hosted by <a title="Joyent" href="http://www.joyent.com/">Joyent</a>. Ran into a few issues with shared libraries, so here are my notes:</p>

<h4>Telling the Linker Where to Look</h4>

<p>You will often get an error like <code>ld.so.1: conftest: fatal: libreadline.so.5: open failed: No such file or directory</code>. This simply means the linker can not find your library. The following command will tell the linker to append a new entry to the existing search path:
 
<pre># crle -u /path/to/lib/dir</pre>
You can retrieve the current configuration by simply running <code>crle</code> on it&#8217;s own, output should be something like this:
<pre>$ crle
Configuration file [version 4]: /var/ld/ld.config
  Platform:     32-bit LSB 80386
  Default Library Path (ELF):   /opt/local/lib:/opt/csw/lib:/usr/lib:/lib
  Trusted Directories (ELF):    /lib/secure:/usr/lib/secure  (system default)
Command line:
  crle -c /var/ld/ld.config -l /opt/local/lib:/opt/csw/lib:/usr/lib:/lib</pre>
 </p>

<h4>Getting Yourself Out of Trouble</h4>

<p>You can easily get yourself into a situation where your system is a brick by having an incomplete search path for the linker. For example, if you run <code>crle -l /foo/path/lib</code>, you will no longer be able to run anything at all since the linker will not find basic libraries it needs. I found a <a title="Changing Search Paths with crle(1) - they are a replacement" href="http://blogs.sun.com/rie/entry/changing_search_paths_with_crle">great post</a> on this topic which instructs you do use the <code>LD_NOCONFIG</code> environment variable to tell the linker to use a default configuration. You can then fix the issue:
<pre>$ sudo crle -l /opt/local/lib -l /opt/csw/lib -l /usr/lib -l /lib
ld.so.1: sudo: fatal: libpam.so.1: open failed: No such file or directory
Killed
$ LD_NOCONFIG=yes sudo crle -l /opt/local/lib -l /opt/csw/lib -l /usr/lib -l /lib</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sherman.ca/archives/2008/03/25/solaris-shared-library-troubleshooting-notes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
