Last Comment Bug 693886 - Non-threadsafe builds broken with JS_CallOnce link error
: Non-threadsafe builds broken with JS_CallOnce link error
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: x86_64 Linux
-- normal (vote)
: mozilla10
Assigned To: general
: Jason Orendorff [:jorendorff]
Depends on:
  Show dependency treegraph
Reported: 2011-10-11 17:55 PDT by Steve Fink [:sfink] [:s:]
Modified: 2011-10-12 03:23 PDT (History)
1 user (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Fix linkage of JS_CallOnce (649 bytes, patch)
2011-10-11 17:55 PDT, Steve Fink [:sfink] [:s:]
jwalden+bmo: review+
Details | Diff | Splinter Review

Description User image Steve Fink [:sfink] [:s:] 2011-10-11 17:55:53 PDT
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.
Comment 1 User image Jeff Walden [:Waldo] (remove +bmo to email) 2011-10-11 18:03:22 PDT
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.
Comment 2 User image Steve Fink [:sfink] [:s:] 2011-10-11 21:49:42 PDT
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.
Comment 3 User image Marco Bonardo [::mak] 2011-10-12 03:23:08 PDT

Note You need to log in before you can comment on or make changes to this bug.