Closed Bug 480144 Opened 11 years ago Closed 11 years ago

fix spidermonkey to compile on mingw

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: ted, Assigned: ted)

References

Details

Attachments

(1 file)

Apparently this got broken. A lot.
This works for me on Win32+MSVC and Win32+mingw. (I'll tryserver it just as a sanity check elsewhere.)
Attachment #364134 - Flags: review?(benjamin)
Attachment #364134 - Flags: review?(jorendorff)
Comment on attachment 364134 [details] [diff] [review]
fix a bunch of stuff

r? jorendorff on the few little code bits.
Note that NanoJIT doesn't compile, so I just did --disable-jit. I guess I could file a followup on that, I didn't feel like dealing with it.
Attachment #364134 - Flags: review?(benjamin) → review+
Attachment #364134 - Flags: review?(jorendorff) → review+
Pushed to m-c:
http://hg.mozilla.org/mozilla-central/rev/39d814ba2422
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
Depends on: 483539
Comment on attachment 364134 [details] [diff] [review]
fix a bunch of stuff

Ted, sorry to ask, but why did you have to change this?
>+++ b/js/src/jsnum.cpp
>@@ -649,7 +649,7 @@ jsdouble js_NaN;
>  * to 53 bit mantissa.
>  * On Alpha platform this is handled via Compiler option.
>  */
>-#define FIX_FPU() _control87(MCW_EM | PC_53, MCW_EM | MCW_PC)
>+#define FIX_FPU() _control87(_MCW_EM | _PC_53, _MCW_EM | _MCW_PC)
> 
> #else
> 
Asking because it breaks OS/2 (bug483539). The change is within a !defined(__MINGW32__) block
>#if (defined XP_WIN || defined XP_OS2) &&                                     \
>    !defined WINCE &&                                                         \
>    !defined __MWERKS__ &&                                                    \
>    (defined _M_IX86 ||                                                       \
>     (defined __GNUC__ && !defined __MINGW32__))
>
/*
 * Set the exception mask to mask all exceptions and set the FPU precision
 * to 53 bit mantissa.
 * On Alpha platform this is handled via Compiler option.
 */
Thus, it should not change anything with regard to mingw (as it should according to the title of this bug). The standard windows float.h header does define MCW_EM and the others without the underscore. Therefore, for non-mingw windows build the change appears not to be necessary.
The mingw headers define _M_IX86, IIRC, so that block does get used.
The names with the underscores are what the Microsoft documentation cites:

http://msdn.microsoft.com/en-us/library/e9b52ceh(VS.71).aspx
http://msdn.microsoft.com/en-us/library/e9b52ceh(VS.80).aspx
http://msdn.microsoft.com/en-us/library/e9b52ceh.aspx

If OS/2 needs different constants, there should probably be a separate preprocessor conditional block to define FIX_FPU appropriately on such systems.
Thx for the fast reply, we'll find a solution.
You need to log in before you can comment on or make changes to this bug.