Last Comment Bug 212708 - nspr pulls in libdl on macosx
: nspr pulls in libdl on macosx
Status: RESOLVED FIXED
: fixed1.8
Product: NSPR
Classification: Components
Component: NSPR (show other bugs)
: other
: PowerPC Mac OS X
: -- normal (vote)
: 4.6.1
Assigned To: cls
: Wan-Teh Chang
:
Mentors:
Depends on:
Blocks: 299661
  Show dependency treegraph
 
Reported: 2003-07-14 19:07 PDT by timeless
Modified: 2005-09-15 15:41 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
copy mozilla/configure.in behavior (836 bytes, patch)
2003-07-15 09:02 PDT, timeless
wtc: review+
Details | Diff | Splinter Review
skip pthread checks on darwin v1.0 (1.02 KB, patch)
2003-07-28 21:40 PDT, cls
no flags Details | Diff | Splinter Review
Just skip libpthread check (765 bytes, patch)
2003-08-04 12:36 PDT, cls
wtc: review-
Details | Diff | Splinter Review
v1.1 (799 bytes, patch)
2005-07-24 17:27 PDT, cls
no flags Details | Diff | Splinter Review
v1.2 (775 bytes, patch)
2005-07-24 17:30 PDT, cls
wtc: review+
asa: approval1.8b5+
Details | Diff | Splinter Review

Description timeless 2003-07-14 19:07:34 PDT
I'm borrowing a friend's computer and it has fink and libdl.
I tried packaging mozilla (which is fun if you aren't logged into the console)
i believe that libdl came from nspr, mozilla's configure explicitly suppresses it

This is what i found:
nsprpub/config.status:s%@OS_LIBS@%-lpthread -ldl %g
Comment 1 Wan-Teh Chang 2003-07-14 21:14:18 PDT
NSPR doesn't use that OS_LIBS value when building its
three .dylib's.  For example, when building libnspr4.dylib,
NSPR uses this OS_LIBS value:
(http://lxr.mozilla.org/seamonkey/source/nsprpub/pr/src/Makefile.in#201)

201 ifeq ($(OS_TARGET),MacOSX)
202 OS_LIBS         = -framework CoreServices -framework CoreFoundation
203 endif

You can verify this by searching for the build command lines
for libnspr4.dylib, libplc4.dylib, and libplds4.dylib in a
Tinderbox build log.

The best we can do is to also suppress the configure tests for
-ldl on Darwin in mozilla/nsprpub/configure.in.
Comment 2 timeless 2003-07-15 09:02:19 PDT
Created attachment 127815 [details] [diff] [review]
copy mozilla/configure.in behavior

the problem isn't that nspr itself links to libdl.dylib, it's that it leaves it
listed in OS_LIBS and the rest of mozilla picks that up when it does stuff, the
end result is that DEPENDENT_LIBS includes it (bad) and most libraries other
than nspr are linked against it (bad).
Comment 3 timeless 2003-07-15 09:16:15 PDT
Comment on attachment 127815 [details] [diff] [review]
copy mozilla/configure.in behavior

with this change the rest of mozilla doesn't link against libdl
Comment 4 timeless 2003-07-15 09:50:31 PDT
for the record:
Darwin cobra 6.6 Darwin Kernel Version 6.6: Thu May  1 21:48:54 PDT 2003; root:xnu/xnu-344.34.obj~1/RELEASE_PPC  Power Macintosh powerpc
GNU bash, version 2.05a.0(1)-release (powerpc-apple-darwin6.0)
[cobra:~] timeless% which bash
/bin/bash
[cobra:~] timeless% ls -l /usr/lib/libdl.0.dylib
-rwxr-xr-x    1 sfalken  staff       16404 Aug 19  2002 /usr/lib/libdl.0.dylib

So cobra has apple bash
which contributes /usr/lib/libdl.0.dylib
which results in nspr defining OS_LIBS to include -ldl
which results in the rest of mozilla pulling in -ldl
which results in things that i can't distribute

please check this patch in when you find it acceptable, i don't have access to the nspr partition and am taking a vacation for a bit.
Comment 5 timeless 2003-07-15 09:52:31 PDT
for the record:
Darwin cobra 6.6 Darwin Kernel Version 6.6: Thu May  1 21:48:54 PDT 2003; root:xnu/xnu-344.34.obj~1/RELEASE_PPC  Power Macintosh powerpc
GNU bash, version 2.05a.0(1)-release (powerpc-apple-darwin6.0)
[cobra:~] timeless% which bash
/bin/bash
[cobra:~] timeless% ls -l /usr/lib/libdl.0.dylib
-rwxr-xr-x    1 sfalken  staff       16404 Aug 19  2002 /usr/lib/libdl.0.dylib

So cobra has apple bash
which contributes /usr/lib/libdl.0.dylib
which results in nspr defining OS_LIBS to include -ldl
which results in the rest of mozilla pulling in -ldl
which results in things that i can't distribute

please check this patch in when you find it acceptable, i don't have access to the nspr partition and am taking a vacation for a bit.
Comment 6 timeless 2003-07-15 09:55:18 PDT
wrong button
Comment 7 timeless 2003-07-15 09:58:04 PDT
and even midair collisions in bugzilla aren't doing what i want.
today is not my day, i need a vacation. it's a good thing i'm taking one tonight.
Comment 8 Wan-Teh Chang 2003-07-15 11:08:03 PDT
Chris, could you take care of this?
Comment 9 Wan-Teh Chang 2003-07-15 11:11:37 PDT
Comment on attachment 127815 [details] [diff] [review]
copy mozilla/configure.in behavior

This patch looks good.	We should fix the indentation
and the use of tabs before checking it in.

While we are at it, we should also get rid of the -lpthread
in OS_LIBS for Mac OS X.  Mac OS X doesn't need -lpthread.
There is /usr/lib/libpthread.dylib, which is a symlink to
/usr/lib/libSystem.dylib and is to make it easy to port
Unix code to Mac OS X.
Comment 10 cls 2003-07-17 19:10:50 PDT
The patch has been checked in on the NSPR trunk & client branch.



Checking in configure.in;
/cvsroot/mozilla/nsprpub/configure.in,v  <--  configure.in
new revision: 1.148; previous revision: 1.147
done
Checking in configure;
/cvsroot/mozilla/nsprpub/configure,v  <--  configure
new revision: 1.143; previous revision: 1.142
done


Checking in configure;
/cvsroot/mozilla/nsprpub/configure,v  <--  configure
new revision: 1.78.2.64; previous revision: 1.78.2.63
done
Checking in configure.in;
/cvsroot/mozilla/nsprpub/configure.in,v  <--  configure.in
new revision: 1.83.2.64; previous revision: 1.83.2.63
done
Comment 11 cls 2003-07-28 21:40:10 PDT
Created attachment 128760 [details] [diff] [review]
skip pthread checks on darwin v1.0
Comment 12 Wan-Teh Chang 2003-07-29 11:08:32 PDT
Comment on attachment 128760 [details] [diff] [review]
skip pthread checks on darwin v1.0

We should not link with -lpthread on Mac OS X.
However, we probably should continue to use the
-pthread compiler flag.  The -pthread flag is
still documented in Apple's gcc man page, even
though -pthread seems to be always enabled (based
on the fact that 'errno' has only one definition --
a macro that expands to a function call).
Comment 13 cls 2003-08-04 12:36:54 PDT
Created attachment 129172 [details] [diff] [review]
Just skip libpthread check
Comment 14 Wan-Teh Chang 2005-07-05 10:06:06 PDT
Comment on attachment 129172 [details] [diff] [review]
Just skip libpthread check

cls, in the "darwin*" case, we need to set _HAVE_PTHREADS=1
(without performing any test).
Comment 15 cls 2005-07-24 17:27:36 PDT
Created attachment 190353 [details] [diff] [review]
v1.1
Comment 16 cls 2005-07-24 17:30:51 PDT
Created attachment 190354 [details] [diff] [review]
v1.2
Comment 17 Wan-Teh Chang 2005-07-25 11:05:06 PDT
Comment on attachment 190354 [details] [diff] [review]
v1.2

r=wtc.	Thank you, Chris.

Could you indent the original MOZ_CHECK_PTHREADS code
when you check in this patch?
Comment 18 cls 2005-09-01 19:47:19 PDT
The v1.2 patch (with indention fixes) has been checked in on the NSPR trunk &
client branch.

Checking in nsprpub/configure;
/cvsroot/mozilla/nsprpub/configure,v  <--  configure
new revision: 1.197; previous revision: 1.196
done
Checking in nsprpub/configure.in;
/cvsroot/mozilla/nsprpub/configure.in,v  <--  configure.in
new revision: 1.199; previous revision: 1.198
done

Checking in nsprpub/configure;
/cvsroot/mozilla/nsprpub/configure,v  <--  configure
new revision: 1.78.2.114; previous revision: 1.78.2.113
done
Checking in nsprpub/configure.in;
/cvsroot/mozilla/nsprpub/configure.in,v  <--  configure.in
new revision: 1.83.2.112; previous revision: 1.83.2.111
done
Comment 19 Wan-Teh Chang 2005-09-14 16:57:11 PDT
Comment on attachment 190354 [details] [diff] [review]
v1.2

Requesting mozilla1.8b5 approval.

This is a simple configure script change that only
affects Mac OS X.  It turns off the pthread library
checks for Mac OS X because pthread functions are in
the default "libSystem.dylib" library on Mac OS X,
not in a separate pthread library.

The risk of this patch is very low.  cls wrote the
patch.	I reviewed it.
Comment 20 Wan-Teh Chang 2005-09-15 15:41:53 PDT
Patch checked in on the MOZILLA_1_8_BRANCH
for mozilla1.8b5.

Note You need to log in before you can comment on or make changes to this bug.