Closed Bug 387367 Opened 17 years ago Closed 17 years ago

mozilla-js.pc.in missing -DJS_THREADSAFE

Categories

(Firefox Build System :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9alpha8

People

(Reporter: braden, Assigned: braden)

Details

(Keywords: fixed1.8.1.8)

Attachments

(1 file)

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.
Attachment #271488 - Flags: review?
Attachment #271488 - Flags: review? → review?(benjamin)
Status: NEW → ASSIGNED
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?
Attachment #271488 - Flags: review?(benjamin) → review?(brendan)
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 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
Attachment #271488 - Flags: review?(brendan) → review+
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).
Keywords: checkin-needed
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
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta1
Version: 1.8 Branch → Trunk
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.)
Attachment #271488 - Flags: approval1.8.1.5?
Attachment #271488 - Flags: approval1.8.0.13?
Attachment #271488 - Flags: approval1.8.1.5? → approval1.8.1.6?
Attachment #271488 - Flags: approval1.8.0.13? → approval1.8.0.14?
Comment on attachment 271488 [details] [diff] [review]
Adds -DJS_THREADSAFE to Cflags

approved for 1.8.1.7, a=dveditz for release-drivers
Attachment #271488 - Flags: approval1.8.1.7?
Attachment #271488 - Flags: approval1.8.1.7+
Attachment #271488 - Flags: approval1.8.0.14?
Attachment #271488 - Flags: approval1.8.0.14-
Keywords: checkin-needed
Whiteboard: needs checkin for 1.8.1.7
mozilla/build/unix/mozilla-js.pc.in 	1.6.4.1
Whiteboard: needs checkin for 1.8.1.7
Flags: in-testsuite-
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: