Last Comment Bug 387367 - mozilla-js.pc.in missing -DJS_THREADSAFE
: mozilla-js.pc.in missing -DJS_THREADSAFE
Status: RESOLVED FIXED
: fixed1.8.1.8
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: x86 Linux
: -- normal (vote)
: mozilla1.9alpha8
Assigned To: Braden
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-08 22:05 PDT by Braden
Modified: 2007-10-09 12:42 PDT (History)
4 users (show)
jwalden+bmo: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Adds -DJS_THREADSAFE to Cflags (512 bytes, patch)
2007-07-08 22:12 PDT, Braden
brendan: review+
dveditz: approval1.8.1.8+
dveditz: approval1.8.0.14-
Details | Diff | Review

Description Braden 2007-07-08 22:05:30 PDT
It appears that code that links with libmozjs now needs to be compiled with JS_THREADSAFE. -DJS_THREADSAFE is currently missing from mozilla-js.pc.in.
Comment 1 Braden 2007-07-08 22:12:24 PDT
Created attachment 271488 [details] [diff] [review]
Adds -DJS_THREADSAFE to Cflags
Comment 2 Benjamin Smedberg [:bsmedberg] 2007-07-11 14:18:28 PDT
Comment on attachment 271488 [details] [diff] [review]
Adds -DJS_THREADSAFE to Cflags

Where does that requirement come from? Is there some #ifdef in the jsapi.h header that requires it?
Comment 3 Braden 2007-07-11 14:39:24 PDT
Quite a few, in fact (in jsapi.h and other public SpiderMonkey headers):

$ grep -r JS_THREADSAFE /usr/include/firefox-2.0.0.4/js/
/usr/include/firefox-2.0.0.4/js/jsapi.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jsapi.h:#endif /* JS_THREADSAFE */
/usr/include/firefox-2.0.0.4/js/jsapi.h: * JS_THREADSAFE and used in a multi-threaded environment, this function must
/usr/include/firefox-2.0.0.4/js/jsapi.h: * if you compile the engine JS_THREADSAFE: this function may be called for a
/usr/include/firefox-2.0.0.4/js/jsapi.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jsapi.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jsapi.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jsapi.h:#endif /* JS_THREADSAFE */
/usr/include/firefox-2.0.0.4/js/jsscope.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jsscope.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jsinterp.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jsinterp.h:#else  /* !JS_THREADSAFE */
/usr/include/firefox-2.0.0.4/js/jsinterp.h:#endif /* !JS_THREADSAFE */
/usr/include/firefox-2.0.0.4/js/jsregexp.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jslock.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jslock.h:#else  /* !JS_THREADSAFE */
/usr/include/firefox-2.0.0.4/js/jslock.h:#endif /* !JS_THREADSAFE */
/usr/include/firefox-2.0.0.4/js/jsobj.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jsobj.h:#else   /* !JS_THREADSAFE */
/usr/include/firefox-2.0.0.4/js/jsobj.h:#endif /* !JS_THREADSAFE */
/usr/include/firefox-2.0.0.4/js/jsatom.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jsatom.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jspubtd.h:typedef int32     jsrefcount;   /* PRInt32 if JS_THREADSAFE, see jslock.h */
/usr/include/firefox-2.0.0.4/js/jsgc.h:#ifndef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jsgc.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jscntxt.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jscntxt.h:#endif /* JS_THREADSAFE */
/usr/include/firefox-2.0.0.4/js/jscntxt.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jscntxt.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jscntxt.h:#endif /* JS_THREADSAFE */
/usr/include/firefox-2.0.0.4/js/jscntxt.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jscntxt.h:#ifndef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jscntxt.h:#ifdef JS_THREADSAFE
/usr/include/firefox-2.0.0.4/js/jscntxt.h:#ifdef JS_THREADSAFE

Comment 4 Brendan Eich [:brendan] 2007-07-11 15:15:25 PDT
Comment on attachment 271488 [details] [diff] [review]
Adds -DJS_THREADSAFE to Cflags

How did JS_THREADSAFE get defined formerly? It was, somehow. I forget, if ever I knew.

/be
Comment 5 Braden 2007-07-11 15:36:59 PDT
It gets defined in mozilla-config.h; but that doesn't get pulled in by SpiderMonkey headers.

I can't say with certainty that it *was* getting defined before, in the absence of mozilla-config.h. However, if it was absent before, that circumstance didn't result in my code crashing so inevitably as it does with Firefox 2.0 (when this symbol is not defined).
Comment 6 Nickolay_Ponomarev 2007-07-14 14:58:03 PDT
Checking in mozilla-js.pc.in;
/cvsroot/mozilla/build/unix/mozilla-js.pc.in,v  <--  mozilla-js.pc.in
new revision: 1.7; previous revision: 1.6
done
Comment 7 Braden 2007-07-14 15:25:39 PDT
Comment on attachment 271488 [details] [diff] [review]
Adds -DJS_THREADSAFE to Cflags

Should be very low risk. At worst, I think someone would get a redefinition warning from JS_THREADSAFE if it's being defined elsewhere.

Without this, mozilla-js.pc is unusably broken. (Well, it can be used, but it requires augmentation.)
Comment 8 Daniel Veditz [:dveditz] 2007-08-29 15:39:52 PDT
Comment on attachment 271488 [details] [diff] [review]
Adds -DJS_THREADSAFE to Cflags

approved for 1.8.1.7, a=dveditz for release-drivers
Comment 9 :Gavin Sharp [email: gavin@gavinsharp.com] 2007-09-04 09:14:22 PDT
mozilla/build/unix/mozilla-js.pc.in 	1.6.4.1

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