Closed Bug 320335 Opened 20 years ago Closed 14 years ago

remove unnecessary -lsoftokn3

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED WORKSFORME

People

(Reporter: KaiE, Assigned: KaiE)

Details

Wan-Teh suggested to remove softokn3 from linker command lines, because it's not necessary, as it will be accessed using PR_LoadLibrary. See also bug 255408. More comments from Wan-Teh: Although I suggested that you remove -lsoftokn3 from the linker flags, it needs to be replaced with -Wl,-rpath-link,... on platforms that use GNU ld (Linux, FreeBSD, etc.), and with -dylib_file ... on Mac OS X. See http://lxr.mozilla.org/security/source/security/nss/cmd/platlibs.mk as an example of how to do the right thing. I know doing the right thing is a lot of work, so I give you my blessing to continue to link with -lsoftokn3, especially in the --without-system-nss case. In the --with-system-nss case, we can add -Wl,-rpath-link,... to the nss-config and mozilla-nss.pc files. Also, system nss is usually installed in a standard directory like /usr/lib, which makes the -Wl,-rpath-link,... flag unnecessary. Benjamin said: You can use the MOZ_FIX_LINK_PATHS macro to get the correct -rpath-link or -executable_path link flags if you wish (we'll need to fixup autoconf.mk.in to set it unconditionally, and upgrade a few of the oldest mac tboxen, but that's already the plan).
The reason -lsoftokn3 is not necessary is that it is an implementation detail that we split libnss3.so into libnss3.so and libsoftokn3.so in NSS 3.4. Applications only need to know about libnss3.so, and libnss3.so is responsible for loading its dependencies, including libsoftokn3.so. (libnss3.so is linked with libsoftokn3.so, so libsoftokn3.so is loaded automatically, rather than using PR_LoadLibrary, when libnss3.so is loaded.)
Is this still actual?
(In reply to Phoenix from comment #2) > Is this still actual? No, thanks for the reminder. I checked mozilla/configure.in, and softokn is NOT part of NSS_DEP_LIBS
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
Kai: thank you for checking. I verified your conclusion. Note: the important variable for this bug in mozilla/configure.in is NSS_LIBS, not NSS_DEP_LIBS.
Status: RESOLVED → VERIFIED
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.