Non-threadsafe builds broken with JS_CallOnce link error

RESOLVED FIXED in mozilla10

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: sfink, Unassigned)

Tracking

unspecified
mozilla10
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Created attachment 566408 [details] [diff] [review]
Fix linkage of JS_CallOnce

jslock.cpp defines JS_CallOnce, but does not #include jsapi.h (directly or indirectly) if JS_THREADSAFE is not defined. This causes JS_CallOnce to be compiled with C++ name mangling.
Attachment #566408 - Flags: review?(jwalden+bmo)
Comment on attachment 566408 [details] [diff] [review]
Fix linkage of JS_CallOnce

Review of attachment 566408 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jslock.cpp
@@ +38,5 @@
>   * ***** END LICENSE BLOCK ***** */
>  
>  #include "jstypes.h"
>  #include "jspubtd.h"
> +#include "jsapi.h"

I don't think the order here matters, so let's alphabetize.  But past that, jsapi.h includes the other two.  Should we be over-including here, or no?  (Shades of the iwyy bug, about which I still have no idea what we want.)  At least alphabetize these, at most remove the other two includes if you think that's reasonable.
Attachment #566408 - Flags: review?(jwalden+bmo) → review+
I'm going to alphabetize for now, but this is gross -- jslock.cpp previously only had internally-used functionality and so could carefully pick a subset of headers.

I've filed bug 693907 to move JS_CallOnce to jsapi.cpp so the headers are back the way they were, but I'm going to land this first.
https://hg.mozilla.org/mozilla-central/rev/69369e7dad6c
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
You need to log in before you can comment on or make changes to this bug.