Closed Bug 212708 Opened 21 years ago Closed 19 years ago

nspr pulls in libdl on macosx

Categories

(NSPR :: NSPR, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: timeless, Assigned: cls)

References

Details

(Keywords: fixed1.8)

Attachments

(1 file, 4 obsolete files)

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
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.
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 on attachment 127815 [details] [diff] [review]
copy mozilla/configure.in behavior

with this change the rest of mozilla doesn't link against libdl
Attachment #127815 - Flags: review?(wtc)
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.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
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.
wrong button
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
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.
Status: REOPENED → ASSIGNED
Chris, could you take care of this?
Assignee: timeless → seawood
Status: ASSIGNED → NEW
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.
Attachment #127815 - Flags: review?(wtc) → review+
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
Attachment #128760 - Flags: review?(wtc)
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).
Attached patch Just skip libpthread check (obsolete) — Splinter Review
Attachment #128760 - Attachment is obsolete: true
Attachment #128760 - Flags: review?(wtc)
Attachment #129172 - Flags: review?(wtc)
Assignee: netscape → cls
Target Milestone: --- → 4.6
Blocks: 299661
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).
Attachment #129172 - Flags: review?(wtchang) → review-
Attached patch v1.1 (obsolete) — Splinter Review
Attachment #127815 - Attachment is obsolete: true
Attachment #129172 - Attachment is obsolete: true
Attachment #190353 - Flags: review?(wtchang)
Attachment #190353 - Attachment is obsolete: true
Attachment #190353 - Flags: review?(wtchang)
Attached patch v1.2Splinter Review
Attachment #190354 - Flags: review?(wtchang)
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?
Attachment #190354 - Flags: review?(wtchang) → review+
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
Status: NEW → RESOLVED
Closed: 21 years ago19 years ago
Resolution: --- → FIXED
Target Milestone: 4.6 → 4.6.3
Target Milestone: 4.6.3 → 4.6.1
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.
Attachment #190354 - Flags: approval1.8b5?
Attachment #190354 - Flags: approval1.8b5? → approval1.8b5+
Patch checked in on the MOZILLA_1_8_BRANCH
for mozilla1.8b5.
Keywords: fixed1.8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: