Note: There are a few cases of duplicates in user autocompletion which are being worked on.

mozilla-js.pc.in missing -DJS_THREADSAFE

RESOLVED FIXED in mozilla1.9alpha8

Status

()

Core
Build Config
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: Braden, Assigned: Braden)

Tracking

({fixed1.8.1.8})

Trunk
mozilla1.9alpha8
x86
Linux
fixed1.8.1.8
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

10 years ago
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.
(Assignee)

Comment 1

10 years ago
Created attachment 271488 [details] [diff] [review]
Adds -DJS_THREADSAFE to Cflags
Attachment #271488 - Flags: review?
(Assignee)

Updated

10 years ago
Attachment #271488 - Flags: review? → review?(benjamin)
(Assignee)

Updated

10 years ago
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)
(Assignee)

Comment 3

10 years ago
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+
(Assignee)

Comment 5

10 years ago
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).
(Assignee)

Updated

10 years ago
Keywords: checkin-needed

Comment 6

10 years ago
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
Last Resolved: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta1
Version: 1.8 Branch → Trunk
(Assignee)

Comment 7

10 years ago
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?
(Assignee)

Updated

10 years ago
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-
(Assignee)

Updated

10 years ago
Keywords: checkin-needed
Whiteboard: needs checkin for 1.8.1.7
mozilla/build/unix/mozilla-js.pc.in 	1.6.4.1
Keywords: checkin-needed → fixed1.8.1.7
Whiteboard: needs checkin for 1.8.1.7
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.