Bug 38747 - mingw-w64 and JIT support
Summary: mingw-w64 and JIT support
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Nobody
Depends on:
Blocks: 35784
  Show dependency treegraph
Reported: 2010-05-07 07:15 PDT by vanboxem.ruben
Modified: 2010-05-11 03:22 PDT (History)
12 users (show)

See Also:

proposed patch (1.28 KB, patch)
2010-05-09 13:59 PDT, Laszlo Gombos
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description vanboxem.ruben 2010-05-07 07:15:20 PDT
Since the recently landed patches for bug https://bugs.webkit.org/show_bug.cgi?id=35607 (which have been introduced in QtWebkit as well), I have stumbled upon a serious issue with mingw-w64 and enabled JIT.

The above patches (see bug report) enable JIT for a X86_64 Windows when using mingw-w64. This was a mistake, as even MSVC x64 builds don't enable it and the JIT crashes any webkit program using the build. Without it, everything is perfectly fine.

I'm sorry I didn't upload a patch, but there are only two lines to be removed (line 943-944 (trunk) of JavaScriptCore/wtf/Platform.h, those enabling JIT on the x64 Windows builds with mingw-w64).

It would of course be better to fix JIT on Win64, but I am in no position (knowledge or otherwise) to do so, and I'm leaving that to more experienced people.
Comment 1 Benjamin Poulain 2010-05-07 07:20:44 PDT
Thanks for adding me in CC. This is blocking for QtWebKit.
Comment 2 vanboxem.ruben 2010-05-09 02:15:11 PDT
Any chance this could still be pushed to 4.7 before release?

The true fixing for Win64 JIT can come later...
Comment 3 Kenneth Rohde Christiansen 2010-05-09 09:14:54 PDT
(In reply to comment #2)
> Any chance this could still be pushed to 4.7 before release?
> The true fixing for Win64 JIT can come later...

It is already blocking on the release bug, so we will have to look at this before the release, yes.
Comment 4 Laszlo Gombos 2010-05-09 13:59:36 PDT
Created attachment 55509 [details]
proposed patch
Comment 5 Laszlo Gombos 2010-05-09 14:01:31 PDT
Gabor, any idea what is involved actually fixing JIT for MINGW64 ?
Comment 6 Darin Adler 2010-05-09 19:25:19 PDT
Comment on attachment 55509 [details]
proposed patch

Seems OK, rs=me
Comment 7 Gabor Loki 2010-05-09 23:20:14 PDT
At first I do not see why it is not working. JSValue64 is enabled, JIT stubs routines are there for GCC. There's nothing missing here. I am going to ask Ossy or someone else to reproduce the error.
Comment 8 WebKit Commit Bot 2010-05-10 06:07:41 PDT
Comment on attachment 55509 [details]
proposed patch

Clearing flags on attachment: 55509

Committed r59074: <http://trac.webkit.org/changeset/59074>
Comment 9 WebKit Commit Bot 2010-05-10 06:07:49 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Gabor Loki 2010-05-10 06:23:19 PDT
Unfortunately, we were not able to build QtWebKit with mingw-w64. It would be nice if someone writes a "works-for-me" section for mingw-w64 at http://trac.webkit.org/wiki/BuildingQtOnWindows wiki. Apart from that, no other magic should be needed to fire JIT up with mingw-w64.
In additional, the x86_64 based QtWebKit runs fine on linux, see at http://www.sed.hu/webkit/qtbuildbot/builders/x86-64%20Linux%20Qt%20Release. It is red, but the JIT runs (only 3 layout tests fail).
The JIT only has the following OS dependent sections: memory allocation, make a mem. range executable, flush a mem. region on some targets, and the function call abi (nothing else). So if this problem is not related to mingw-w64 compiler, the bug should be in ExecutableAllocator or JITStubs (or maybe in privateCompileCTIMachineTrampolines), but they look nice.
Well, a good back-trace is essential for efficient debugging. ;) Could someone make a detailed bug report for mingw-w64 JIT?
Comment 11 WebKit Review Bot 2010-05-10 06:37:59 PDT
http://trac.webkit.org/changeset/59074 might have broken Qt Linux ARMv5 Release
Comment 12 vanboxem.ruben 2010-05-10 06:50:39 PDT
By popular demand:


If it doesn't work, please say so, then I may have missed a step...
Comment 13 Simon Hausmann 2010-05-11 03:22:18 PDT
Revision r59074 cherry-picked into qtwebkit-2.0 with commit dc5821c3df2ef60456d85263160852f5335cf946