The default bug view has changed. See this FAQ.

nspr pulls in libdl on macosx

RESOLVED FIXED in 4.6.1

Status

NSPR
NSPR
RESOLVED FIXED
14 years ago
12 years ago

People

(Reporter: timeless, Assigned: cls)

Tracking

({fixed1.8})

other
4.6.1
PowerPC
Mac OS X
fixed1.8

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 4 obsolete attachments)

(Reporter)

Description

14 years ago
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

14 years ago
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.
(Reporter)

Comment 2

14 years ago
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).
(Reporter)

Comment 3

14 years ago
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)
(Reporter)

Comment 4

14 years ago
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
Last Resolved: 14 years ago
Resolution: --- → FIXED
(Reporter)

Comment 5

14 years ago
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.
(Reporter)

Comment 6

14 years ago
wrong button
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Reporter)

Comment 7

14 years ago
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

Comment 8

14 years ago
Chris, could you take care of this?
Assignee: timeless → seawood
Status: ASSIGNED → NEW

Comment 9

14 years ago
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+
(Assignee)

Comment 10

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

Comment 11

14 years ago
Created attachment 128760 [details] [diff] [review]
skip pthread checks on darwin v1.0
(Assignee)

Updated

14 years ago
Attachment #128760 - Flags: review?(wtc)

Comment 12

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

Comment 13

14 years ago
Created attachment 129172 [details] [diff] [review]
Just skip libpthread check
Attachment #128760 - Attachment is obsolete: true
(Assignee)

Updated

14 years ago
Attachment #128760 - Flags: review?(wtc)
(Assignee)

Updated

14 years ago
Attachment #129172 - Flags: review?(wtc)
(Reporter)

Updated

13 years ago
Assignee: netscape → cls

Updated

12 years ago
Target Milestone: --- → 4.6
(Assignee)

Updated

12 years ago
Blocks: 299661

Comment 14

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

Comment 15

12 years ago
Created attachment 190353 [details] [diff] [review]
v1.1
Attachment #127815 - Attachment is obsolete: true
Attachment #129172 - Attachment is obsolete: true
Attachment #190353 - Flags: review?(wtchang)
(Assignee)

Updated

12 years ago
Attachment #190353 - Attachment is obsolete: true
Attachment #190353 - Flags: review?(wtchang)
(Assignee)

Comment 16

12 years ago
Created attachment 190354 [details] [diff] [review]
v1.2
Attachment #190354 - Flags: review?(wtchang)

Comment 17

12 years ago
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+
(Assignee)

Comment 18

12 years ago
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
Last Resolved: 14 years ago12 years ago
Resolution: --- → FIXED
Target Milestone: 4.6 → 4.6.3

Updated

12 years ago
Target Milestone: 4.6.3 → 4.6.1

Comment 19

12 years ago
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?

Updated

12 years ago
Attachment #190354 - Flags: approval1.8b5? → approval1.8b5+

Comment 20

12 years ago
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.