From owner-freebsd-hackers Mon Feb 12 15:42:24 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id PAA13438 for hackers-outgoing; Mon, 12 Feb 1996 15:42:24 -0800 (PST) Received: from werple.net.au (werple.mira.net.au [203.9.190.21]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id PAA13433 for ; Mon, 12 Feb 1996 15:42:21 -0800 (PST) Received: from cimaxp1.UUCP (Ucimlogi@localhost) by werple.net.au (8.7/8.7.1) with UUCP id KAA27706 for hackers@FreeBSD.org; Tue, 13 Feb 1996 10:00:23 +1100 (EST) Message-Id: <199602122300.KAA27706@werple.net.au> X-Authentication-Warning: werple.net.au: Ucimlogi set sender to cimaxp1!jb using -f Received: by cimaxp1.cimlogic.com.au; (5.65/1.1.8.2/10Sep95-0953AM) id AA04021; Tue, 13 Feb 1996 10:00:14 +1100 From: John Birrell Subject: rtld LD_NO_INTERN_SEARCH and LD_LIBRARY_PATH To: hackers@FreeBSD.org Date: Tue, 13 Feb 1996 10:00:11 +1100 (EST) Cc: jb@cimlogic.com.au X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@FreeBSD.org Precedence: bulk G'day, The man file for rtld describes an environment variable called LD_NO_INTERN_SEARCH. This does not appear to be implemented. The man file says that LD_LIBRARY_PATH is "A colon separated list of directories, overriding the default search path for shared libraries." We *always* use -nostdlib and *never* -l to specify libraries. Our build process gives an explicit path to the shared library that we want it to link against. This path is written by ld into the executable file. When we release the programs and libraries, we expect to be able to set LD_LIBRARY_PATH to the place where the libraries are installed, not where they were when the program was linked. This does not work because rtld is always taking the path in the executable. Was the LD_NO_INTERN_SEARCH option to rtld supposed to stop it using the paths out of the execuable? FWIW, here is an example of a link command (edited to multiple lines to make it halfway readable) we use: gcc -Xlinker -e -Xlinker start -nostdlib -nostartfiles -Xlinker -o pre bld00000.w /u/dev/usr/lib/crt0.ws pre.w pre_uap.w pre_uapd.w pre_uapi.w pre_uapp.w pre_uapr.w pre_uaps.w pre.a /u/dev/cim/lib/dhu.so.1.1 /u/dev/cim/lib/st5.so.1.2 /u/dev/cim/lib/t5s.so.1.2 /u/dev/cim/lib/t5c.so.1.2 /u/dev/cim/lib/uap.so.1.2 prl.so.1.2 /u/dev/cim/lib/sd.so.1.2 /u/dev/cim/lib/sm.so.1.2 /u/dev/cim/lib/elg.so.1.2 /u/dev/lib/pro.so.1.2 /u/dev/lib/dhl.so.1.2 /u/dev/lib/io.so.1.2 /u/dev/lib/ex.so.1.2 /u/dev/lib/ll.so.1.2 /u/dev/lib/ic.so.1.2 /u/dev/lib/mem.so.1.2 /u/dev/lib/dbg.so.1.2 /u/dev/lib/uf.so.1.2 /u/dev/lib/c.so.1.2 /u/dev/usr/lib/libgcc.so.1.1 /u/dev/usr/lib/libc.so.1.2 After running automatic tests on programs like this, we release to a /u/rel tree. We don't want to have released programs using shared libraries out of the /u/dev tree. Any hints as to how we can do this? Regards, -- John Birrell CIMlogic Pty Ltd jb@cimlogic.com.au 119 Cecil Street Ph +61 3 9690 6900 South Melbourne Vic 3205 Fax +61 3 9690 6650 Australia Mob +61 18 353 137