Closed Bug 728719 Opened 10 years ago Closed 10 years ago
_Get Version, undefined reference during linking
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.
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 #598838 - Flags: review?(mh+mozilla) → review+
Thanks. I will land this together with bug 673381 when that one is ready.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.