Closed Bug 598279 Opened 14 years ago Closed 14 years ago

Building Javascript as shared library broken wrt xpconnect: xpcjsruntime.cpp:806: undefined reference to `js::TriggerOperationCallback(JSContext*)'

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
blocker

Tracking

()

RESOLVED FIXED
mozilla2.0b7

People

(Reporter: standard8, Assigned: standard8)

References

Details

(Keywords: regression)

Attachments

(1 file)

Non-libxul builds, which also are --disable-shared-js are broken when linking:

../../js/src/xpconnect/src/libxpconnect_s.a(xpcjsruntime.o): In function `XPCJSRuntime::WatchdogMain(void*)':
/buildbot/linux-comm-central-bloat/build/mozilla/js/src/xpconnect/src/xpcjsruntime.cpp:806: undefined reference to `js::TriggerOperationCallback(JSContext*)'
/usr/bin/ld: libgklayout.so: hidden symbol `js::TriggerOperationCallback(JSContext*)' isn't defined
/usr/bin/ld: final link failed: Nonrepresentable section on output

This is a regression from bug 589193.

The change made xpcjsruntime.cpp (in the xpconnect libary) reference a mozjs *inline* function:

http://hg.mozilla.org/mozilla-central/annotate/e6cfaf0840cb/js/src/xpconnect/src/xpcjsruntime.cpp#l806

http://hg.mozilla.org/mozilla-central/annotate/e6cfaf0840cb/js/src/jscntxt.h#l1194

As the function is inline, it cannot be referenced externally. Builds with static js get away with this as mozjs and xpconnect parts are linked into the same library.
Attached patch Proposed fixSplinter Review
I was slightly wrong previously about the inline function. It is actually this function that is not public:

http://hg.mozilla.org/mozilla-central/annotate/e6cfaf0840cb/js/src/jscntxt.h#l3271

(TriggerOperationCallback is not the same as triggerOperationCallback!)

Looking at the set-up, it seems the obvious thing to do is to make this accessible externally, and set it up as a JS_FRIEND_API function.

As this changes the interfaces, requesting review for this bustage fix (needed for Thunderbird/SeaMonkey trees and non-libxul builds).
Attachment #477090 - Flags: review?(igor)
Attachment #477090 - Flags: review?(igor) → review+
Checked in with a=bustage fix, as tinderbox said that was valid.

http://hg.mozilla.org/mozilla-central/rev/2ef97f492c59
Assignee: general → bugzilla
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b7
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: