Closed Bug 124318 Opened 23 years ago Closed 23 years ago

We should use the linker option -rpath-link to locate libsoftokn3.so on Linux.

Categories

(NSS :: Build, defect, P1)

x86
Linux
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wtc, Assigned: wtc)

Details

Attachments

(1 file)

In NSS 3.4, libnss3.so has an implicit dependency: libsoftokn3.so.
On Unix platforms, if you say -L<dir> -lnss3, the linker searches
for the implicit dependencies of libnss3.so in <dir>.  However,
the Linux ld does not do this, and we must instruct it to look
in <dir> for implicit dependencies with the -rpath-link <dir>
option.  Otherwise, we get a linker error like this:

/usr/bin/ld: warning: libsoftokn3.so, needed by
../../../../dist/Linux2.4_x86_glibc_PTH_DBG.OBJ/lib//libnss3.so, not found (try
using -rpath or -rpath-link)
../../../../dist/Linux2.4_x86_glibc_PTH_DBG.OBJ/lib//libnss3.so: undefined
reference to `NSC_ModuleDBFunc@SOFTOKEN_3.4'
../../../../dist/Linux2.4_x86_glibc_PTH_DBG.OBJ/lib//libnss3.so: undefined
reference to `FC_GetFunctionList@SOFTOKEN_3.4'
../../../../dist/Linux2.4_x86_glibc_PTH_DBG.OBJ/lib//libnss3.so: undefined
reference to `NSC_GetFunctionList@SOFTOKEN_3.4'
collect2: ld returned 1 exit status

We have been working around this problem in security/nss/cmd by
linking with -lsoftokn3 explicitly.  While this is a reasonable
solution, this makes nss test programs such as selfserv and
strsclnt explicitly depend on libsoftokn3.so, and will prevent
us from removing libsoftokn3.so (such as putting it back in
libnss3.so or breaking it up into two .so's) in a future NSS 3.x
release.
This patch has been tested on Solaris, HP-UX, AIX, and Linux.
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → 3.4
Fix checked into the tip of NSS.

We are running into a similar problem on Darwin (Mac OS X).
I don't have a solution yet.

Not linking the NSS tools and tests with -lsoftokn3 directly
allows us to easily drop in the NSS 3.3.x shared libraries.
This is useful when verifying a bug does not exist in 3.3.x.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: