Closed Bug 256217 Opened 20 years ago Closed 20 years ago

Implement PR_GetLibraryFilePathname for FreeBSD

Categories

(NSPR :: NSPR, enhancement)

4.4.1
x86
FreeBSD
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wtc, Assigned: wtc)

Details

This bug was reported in the netscape.public.mozilla.nspr
newsgroup with a proposed fix:

From: Dale Jordan <dale@hom>
Newsgroups: netscape.public.mozilla.nspr,netscape.public.mozilla.xpcom
Subject: NSPR problem with FreeBSD
Date: Sat, 14 Aug 2004 12:25:01 -0700
To: mozilla-nspr@mozilla.org

While trying to get the xpcom nsSample component to work on version
1.7.2 of Mozilla compiled for FreeBSD, I kept getting a 80040154 error
(NS_ERROR_FACTORY_NOT_REGISTERED).  I tracked this down to
PR_GetLibraryFilePathname in prlink.c in libnspr.  FreeBSD falls into
the final "Not Implemented" case.  Changing line 1719 to:

   #if defined(SOLARIS) || defined(LINUX) || defined(FREEBSD)

fixed the problem for me.  Wiser heads may have a more inclusive fix.

Dale Jordan
Dale Jordan confirmed that FreeBSD has the Dl_info
structure and the dladdr function.

He provided the following test output (with the
patch applied):
~/mozilla/nsprpub/pr/tests> ./libfilename -d
Pathname is /home/dale/mozilla/dist/bin/libnspr4.so
Loading library dll/libmy.so
Pathname is dll/libmy.so
PASS 

This shows that the patch works.
Status: NEW → ASSIGNED
I checked in the fix on the NSPR trunk (NSPR 4.6) and
NSPRPUB_PRE_4_2_CLIENT_BRANCH (Mozilla 1.8a4).
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: --- → 4.6
You need to log in before you can comment on or make changes to this bug.