Closed Bug 83880 Opened 19 years ago Closed 19 years ago
nspr-config --libs doesn't return all libs needed to resolve link deps
Currently, doing a static build (bug 46775) fails on solaris because nspr-config --libs doesn't return the full set of OS libs needed to resolve dependencies when linking into a static binary. This is caused by OS_LIBS not being complete for solaris.
I put some comments in bug #46775 explaining why you must not link with static NSPR libraries. In particular, linking with static NSPR libraries on Solaris SPARC degrades the performance of atomic increment and decrement, two operations heavily used by XPCOM to update object reference counts. So this bug should not block bug #46775. This patch seems fine although the OS_LIBS value is only correct for libnspr4. Or is it only used for static linking (which we don't support)? So I'm not sure whether we should check this in.
Status: NEW → ASSIGNED
Oops. I didn't know that static libs were no longer supported. So does this mean that platforms without shared library support (lke BSDI 3.x) are no longer supported? The first patch appears to only be needed when building static nspr libs.
We still support static libraries on platforms without shared libraries. We need to reserve the right to only support shared libraries (on platforms that have both static and shared libraries) because some techniques (such as thread attach/detach hooks and the dynamic loading of CPU architecture specific code) require the use of shared libraries. Therefore, removing the --disable-shared configure option for NSPR is a good idea. The first patch is not needed for NSPR shared libraries on Solaris because our shared libraries are implicitly linked with their dependencies. Note that nspr-config cannot convey the fact that we need to link -lpthread -lthread before all other system libraries. The makefile needs to either look for -lpthread -lthread and move them up to the head of the list of system libraries, or use the -mt or -pthread compiler flag.
I'm going to mark the bug WONTFIX because the first patch is not necessary for linking with NSPR shared libraries. I did check in your second patch on the main trunk of NSPR. Thank you.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → WONTFIX
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.