Closed Bug 1299823 Opened 8 years ago Closed 2 years ago

ld: warning: cannot export hidden symbol _PR_XLock from ../nspr/pr/unix.o

Categories

(NSPR :: NSPR, defect)

Unspecified
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ted, Assigned: glandium)

References

Details

Attachments

(1 file)

The nss.symbols file has a wildcard export of PR_*:
https://dxr.mozilla.org/mozilla-central/rev/b7f7ae14590aced450bb0b0469dfb38edd2c0ace/config/external/nss/nss.symbols#13

Unfortunately NSPR has a few private symbols that start with PR_, and the linker complains about these on Mac:
04:17:57     INFO -  ld: warning: cannot export hidden symbol _PR_XLock from ../nspr/pr/unix.o
04:17:57     INFO -  ld: warning: cannot export hidden symbol _PR_XUnlock from ../nspr/pr/unix.o
04:17:57     INFO -  ld: warning: cannot export hidden symbol _PR_XIsLocked from ../nspr/pr/unix.o
04:17:57     INFO -  ld: warning: cannot export hidden symbol _PR_XWait from ../nspr/pr/unix.o
04:17:57     INFO -  ld: warning: cannot export hidden symbol _PR_XNotify from ../nspr/pr/unix.o
04:17:57     INFO -  ld: warning: cannot export hidden symbol _PR_XNotifyAll from ../nspr/pr/unix.o

I don't know if we can put an exclusion in the symbols file (probably depends on the syntax of linker scripts and symbol version scripts). Alternately, it's possible we could just remove this code from NSPR, since the only thing that calls it has a comment that mentions code in Mozilla that no longer exists:
https://dxr.mozilla.org/mozilla-central/rev/b7f7ae14590aced450bb0b0469dfb38edd2c0ace/nsprpub/pr/src/md/unix/uxwrap.c#186
Product: Core → Firefox Build System

lld turns these warnings into errors.

Blocks: 1743536
Assignee: nobody → mh+mozilla
Component: General → NSPR
Product: Firefox Build System → NSPR
Version: unspecified → other

None of these symbols are in a public header, they are not NSPR_API, and
only available on XP_UNIX builds, which in the vast majority of cases,
means built with -fvisibility=hidden (i.e. the symbols are not even
exported in the first place).

The convention for non-exported symbols is to start with _PR rather than
PR, so we rename those symbols.

The PR_XWait, PR_XNotify and PR_XNotifyAll symbols are however never used,
so we just remove them.

Blocks: 1743566
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: