Closed Bug 728719 Opened 8 years ago Closed 8 years ago

NSSUTIL_GetVersion, undefined reference during linking

Categories

(Toolkit Graveyard :: Build Config, defect)

x86
Linux
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla13

People

(Reporter: kaie, Assigned: kaie)

References

Details

Attachments

(1 file, 1 obsolete file)

I attempt to build Firefox with NSS 3.13.2, including a local change that calls the recently added function NSSUTIL_GetVersion()

I get an error while linking:
  hidden symbol NSSUTIL_GetVersion isn't defined.

I inspected the code, but everything looks right to me.

(If I remove the call NSSUTIL_GetVersion(), but keep other calls like NSS_GetVersion(), it links fine, which makes it even more spooky.)

I ended up experimenting. If I move the declaration away from it's current position in nssutil.h, moving it to secoid.h, then the linker succeeds.

At both places (current nonworking place and experimental other place), the declaration is wrapped inside SEC_BEGIN_PROTOS / SEC_END_PROTOS.

To my surprise the problem cannot be reproduced using NSS command line utilities. Still having the declaration of NSSUTIL_GetVersion(), adding a call to NSSUTIL_GetVersion() inside cmd/pp/pp.c, linking and execution work fine.


I'm not sure if we should spend analyzing what happens here.
Maybe we should simply move it to the other header.
Attached patch Patch v1 (obsolete) — Splinter Review
Attachment #598680 - Flags: review?(wtc)
Blocks: 673381
Depends on: 673115
Assignee: nobody → kaie
Ok, it's not a bug in NSS.

The problem is that nssutil.h is not listed as a system header when building Mozilla, and that probably causes those symbols to be hidden. The important detail is, I tried adding the file to the config/system-headers and js/src/config/system-headers files, and the build succeeds.

Thanks a lot to Mike Hommey for pointing me to this solution.
Component: Libraries → Build Config
Product: NSS → Toolkit
QA Contact: libraries → build-config
Version: 3.13.2 → Trunk
Attachment #598680 - Attachment is obsolete: true
Attachment #598680 - Flags: review?(wtc)
Attached patch Patch v2Splinter Review
Attachment #598838 - Flags: review?(mh+mozilla)
Attachment #598838 - Flags: review?(mh+mozilla) → review+
Thanks. I will land this together with bug 673381 when that one is ready.
https://hg.mozilla.org/mozilla-central/rev/1f3c7742021c
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.