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

RESOLVED FIXED in 3.4

Status

NSS
Build
P1
normal
RESOLVED FIXED
17 years ago
17 years ago

People

(Reporter: Wan-Teh Chang, Assigned: Wan-Teh Chang)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

17 years ago
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.
(Assignee)

Comment 1

17 years ago
Created attachment 68490 [details] [diff] [review]
Patch for mozilla/security/nss/cmd

This patch has been tested on Solaris, HP-UX, AIX, and Linux.
(Assignee)

Updated

17 years ago
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → 3.4
(Assignee)

Comment 2

17 years ago
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
Last Resolved: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.