CnUnix

[알림판목록 I] [알림판목록 II] [글목록][이 전][다 음]
[ CnUnix ] in KIDS
글 쓴 이(By): Zaharang (_자하랑)
날 짜 (Date): 2002년 3월 18일 월요일 오후 04시 18분 29초
제 목(Title): Re: Solaris 7에서 라이브러리 디렉토리 추



저는 편한 Solaris 쓰다가 Linux 쓸때마다 한숨이 나오던데...
물론 제가 Linux에 익숙치 않은 탓이겠지만,  여튼 사람마다 다르네요. ;-)

Solairs 8 FAQ에 있는 내용인데,
7에도 대동소이하리라고 생각이 됩니다만...

---
Document ID: 3057

SYNOPSIS:     How to configure runtime linking in Solaris 8.

DETAIL DESCRIPTION:


With the advent of 64-bit Solaris with Solaris 7 and now 8, the use of 
the environment variable LD_LIBRARY_PATH has become frowned upon, as it
can break the management of linking 32-bit and 64-bit executables against
different library versions.

Also, in the Linux Operating System, there is a configurable run-time
linking system managed through the ld.so.config file and the ldconfig
command which leads to a far more efficient means of finding dynamic
libraries.

How are we supposed to solve the first point, and does/will Solaris
offer us something like the second?


SOLUTION SUMMARY:


There is a new command and file in Solaris 8 that gives very similar, but
better and finer grained, functionality to that seen in Linux.  The
command is crle(1) and the file is ld.config, which exists in /var/ld for
32-bit executables and /var/ld/64 for 64-bit executables, allowing
separate configurations for each.

This new command allows the configuration of dynamic library search
paths, cacheing of the locations of dynamic libraries, and the setting of
alternate object files for standard libraries, as well as a number of
other options - see the manual page for full details.

As an example, the following command:

  crle -l /usr/lib -l /usr/local/lib -i /usr/lib -i /usr/local/lib \
  -a /usr/lib/libthread.so.1 -o /usr/lib/lwp

has the following effect:

o  Sets the default 32-bit library path to /usr/lib:/usr/local/lib;
o  Creates a cached list of libraries in these directories;
o  Tells ld.so to use the libthread.so in /usr/lib/lwp instead.

The first is basically a system-wide version of the LD_LIBRARY_PATH
environment variable that only effects 32-bit applications.  Note that
LD_LIBRARY_PATH is still honoured, but it's use is not recommended.

The second means that, rather than search each directory in the library
path in turn for each library when it starts up a new executable, ld.so
can instead simply consult the cache file to find it, speeding up
application start times considerably.  This offers functionality matching
the Linux ldconfig command.

The third example is a simple method to experiment with the new, single
level threads library supplied in Solaris 8 which is expected to provide
better performance for multithreaded applications, especially on single
processor systems.

These are just some of the options available with crle - it is highly
recommended that the reader acquaints themselves fully with the crle(1)
man page before experimenting with it, and there are many more examples
there, too.


DATE APPROVED: 05/15/00

KEYWORDS:     ld ld.so ldconfig crle ld.so.conf link LD_LIBRARY_PATH 

OS RELEASE:   8



[알림판목록 I] [알림판목록 II] [글 목록][이 전][다 음]
키 즈 는 열 린 사 람 들 의 모 임 입 니 다.