movableink / webkit

Unofficial mirror of the WebKit SVN repository
http://www.webkit.org/
55 stars 11 forks source link

Error on LowLevelInterpreter with mingw build #28

Open aquiles2k opened 5 months ago

aquiles2k commented 5 months ago

Im trying to build the latest qt5 code with mxe crosscompiled for win.

After some initial patches it seems its getting configured but fails later with the following:

/home/adrian/dev/sources/mxe/tmp-qtwebkit2-i686-w64-mingw32.shared/qtwebkit-1/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp: In static member function 'static JSC::JSValue JSC::LLInt::CLoop::execute(JSC::OpcodeID, void*, JSC::VM*, JSC::ProtoCallFrame*, bool)':
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-i686-w64-mingw32.shared/qtwebkit-1.build_/JavaScriptCore/DerivedSources/Bytecodes.h:32:11: error: label 'op_create_this_wide16' used but not defined
   32 |     macro(op_create_this, 5) \
      |           ^~~~~~~~~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-i686-w64-mingw32.shared/qtwebkit-1/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp:257:63: note: in definition of macro 'OPCODE_ENTRY'
  257 |             opcodeMapWide16[__opcode] = bitwise_cast<void*>(&&__opcode##_wide16); \
      |                                                               ^~~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-i686-w64-mingw32.shared/qtwebkit-1/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp:273:9: note: in expansion of macro 'FOR_EACH_BYTECODE_ID'
  273 |         FOR_EACH_BYTECODE_ID(OPCODE_ENTRY)
      |         ^~~~~~~~~~~~~~~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-i686-w64-mingw32.shared/qtwebkit-1.build_/JavaScriptCore/DerivedSources/Bytecodes.h:33:11: error: label 'op_create_promise_wide16' used but not defined
   33 |     macro(op_create_promise, 5) \
      |           ^~~~~~~~~~~~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-i686-w64-mingw32.shared/qtwebkit-1/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp:257:63: note: in definition of macro 'OPCODE_ENTRY'
  257 |             opcodeMapWide16[__opcode] = bitwise_cast<void*>(&&__opcode##_wide16); \
      |                                                               ^~~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-i686-w64-mingw32.shared/qtwebkit-1/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp:273:9: note: in expansion of macro 'FOR_EACH_BYTECODE_ID'
  273 |         FOR_EACH_BYTECODE_ID(OPCODE_ENTRY)
      |         ^~~~~~~~~~~~~~~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-i686-w64-mingw32.shared/qtwebkit-1.build_/JavaScriptCore/DerivedSources/Bytecodes.h:34:11: error: label 'op_create_generator_wide16' used but not defined
   34 |     macro(op_create_generator, 4) \
      |           ^~~~~~~~~~~~~~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-i686-w64-mingw32.shared/qtwebkit-1/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp:257:63: note: in definition of macro 'OPCODE_ENTRY'
  257 |             opcodeMapWide16[__opcode] = bitwise_cast<void*>(&&__opcode##_wide16); \
      |                                                               ^~~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-i686-w64-mingw32.shared/qtwebkit-1/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp:273:9: note: in expansion of macro 'FOR_EACH_BYTECODE_ID'
  273 |         FOR_EACH_BYTECODE_ID(OPCODE_ENTRY)
      |         ^~~~~~~~~~~~~~~~~~~~

Has anyone any clue whats going wrong? Is it perhaps some misconfiguration? Some missing includes? This bytecode generation voodoo is so low level - i dont have a clue where to look for fixing this.

aquiles2k commented 5 months ago

So, annulen over at qtwebkit repo confirmed that 32bit JIT was abandoned long time ago which is why this code is falling back to CLoop which again is untested and unsupported on 32bit mingw. So i guess i have to give up on this.

Meanwhile i tried for 64bit mingw crosscompile which got me further but still errors out early.

There were some fixable errors like mispelled or not existing includes.

The first error that left me scratching my head was:

[ 16%] Building CXX object Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.obj
cd /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/Source/JavaScriptCore && /home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-g++ -DBUILDING_LLIntOffsetsExtractor -DBUILDING_QT__=1 -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1 -DHAVE_CONFIG_H=1 -DNOMINMAX -DPAS_BMALLOC=1 -DQT_ASCII_CAST_WARNINGS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_DYNAMIC_CAST -DQT_NO_EXCEPTIONS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_USE_QSTRINGBUILDER -DSTATICALLY_LINKED_WITH_WTF -DUNICODE -D_UNICODE -D_WINDOWS -D_WINSOCKAPI_="" -D__USE_MINGW_ANSI_STDIO=1 @CMakeFiles/LLIntOffsetsExtractor.dir/includes_CXX.rsp -Wextra -Wall -pipe -fmax-errors=20 -Wno-odr -Wno-stringop-overread -Wno-stringop-overflow -Wno-nonnull -Wno-array-bounds -Wno-expansion-to-defined -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-unknown-pragmas -Wno-tautological-compare -fpermissive -fno-strict-aliasing -fno-exceptions -fno-rtti -mno-ms-bitfields -fno-keep-inline-dllexport -O3 -DNDEBUG -std=c++20 -MD -MT Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.obj -MF CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.obj.d -o CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.obj -c /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp

In file included from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/heap/Heap.h:40,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/JSCell.h:29,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/JSCast.h:28,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/ClassInfo.h:26,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/Structure.h:28,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/bytecode/ArrayProfile.h:29,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp:29:
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/heap/IsoSubspace.h:81:23: error: function 'JSC::GCClient::IsoSubspace::~IsoSubspace()' definition is marked dllimport
   81 |     JS_EXPORT_PRIVATE ~IsoSubspace() = default;
      |                       ^
In file included from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/debugger/Debugger.h:26,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/VMInlines.h:28,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/CommonSlowPaths.h:39,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp:33:
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/debugger/DebuggerCallFrame.h:57:43: error: function 'const WTF::TextPosition& JSC::DebuggerCallFrame::position() const' definition is marked dllimport
   57 |     JS_EXPORT_PRIVATE const TextPosition& position() const { return m_position; }
      |                                           ^~~~~~~~
make[4]: *** [Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/build.make:169: Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.obj] Error 1

Since i have read somewhere that dllimport/export markings are more of a msvc thing and not gcc (which is used here), i disabled them:

diff --git a/Source/WTF/wtf/PlatformUse.h b/Source/WTF/wtf/PlatformUse.h
index 1111111..2222222 100644
--- a/Source/WTF/wtf/PlatformUse.h
+++ b/Source/WTF/wtf/PlatformUse.h
@@ -44,7 +44,7 @@

 /* Export macro support. Detects the attributes available for shared library symbol export
    decorations. */
-#if OS(WINDOWS) || (COMPILER_HAS_CLANG_DECLSPEC(dllimport) && COMPILER_HAS_CLANG_DECLSPEC(dllexport))
+#if (COMPILER_HAS_CLANG_DECLSPEC(dllimport) && COMPILER_HAS_CLANG_DECLSPEC(dllexport))
 #define USE_DECLSPEC_ATTRIBUTE 1
 #elif defined(__GNUC__)
 #define USE_VISIBILITY_ATTRIBUTE 1

Can anyone confirm this is the right approach?

Anyway, this got me some compilations further but now im getting an assembler error again:

[ 19%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/assembler/MacroAssemblerX86Common.cpp.obj
cd /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/Source/JavaScriptCore && /home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-g++ -DBUILDING_JavaScriptCore -DBUILDING_QT__=1 -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1 -DHAVE_CONFIG_H=1 -DNOMINMAX -DPAS_BMALLOC=1 -DQT_ASCII_CAST_WARNINGS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_DYNAMIC_CAST -DQT_NO_EXCEPTIONS -DQT_NO_KEYWORDS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_USE_QSTRINGBUILDER -DSTATICALLY_LINKED_WITH_WTF -DUNICODE -D_UNICODE -D_WINDOWS -D_WINSOCKAPI_="" -D__USE_MINGW_ANSI_STDIO=1 @CMakeFiles/JavaScriptCore.dir/includes_CXX.rsp -Wextra -Wall -pipe -fmax-errors=20 -Wno-odr -Wno-stringop-overread -Wno-stringop-overflow -Wno-nonnull -Wno-array-bounds -Wno-expansion-to-defined -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-unknown-pragmas -Wno-tautological-compare -fpermissive -fno-strict-aliasing -fno-exceptions -fno-rtti -mno-ms-bitfields -fno-keep-inline-dllexport -O3 -DNDEBUG -std=c++20 -ffp-contract=off -MD -MT Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/assembler/MacroAssemblerX86Common.cpp.obj -MF CMakeFiles/JavaScriptCore.dir/assembler/MacroAssemblerX86Common.cpp.obj.d -o CMakeFiles/JavaScriptCore.dir/assembler/MacroAssemblerX86Common.cpp.obj -c /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.cpp

{standard input}: Assembler messages:
{standard input}:131: Error: unknown pseudo-op: `.previous'
make[4]: *** [Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/build.make:964: Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/assembler/MacroAssemblerX86Common.cpp.obj] Error 1
make[4]: *** Waiting for unfinished jobs....

Here we are again with some compiler voodoo i dont understand. I suspect there will be some defines or compiler flags which would tell the assembler to make the right things, but im lost here for now.

Anyone else an idea?

quarcko commented 5 months ago

Hi,

I managed to fully compile QtWebkit for Qt 6.5.3 and Mingw 64 bit. But, mind you - i did not enable JIT (i dont know if its needed or not) final product - crashes spectacularly in LowLevel Interpreter:

`Program received signal SIGSEGV, Segmentation fault. llint_entry () at C:/Qt/webkit/Source/JavaScriptCore/llint\LowLevelInterpreter.asm:2022 2022 bbeq [t3], 0, .notFrozen (gdb) up

1 0x0000000001185288 in ?? ()

`

And here i am stuck for now.

Now for your errors: dllimport / export - used similar approach, they are not needed on GCC-like compiler.

Then your next error ".previous" opcode is only valid on ELF executables (LINUX) so you just basically wrap this opcode in

`

if !OS(WINDOWS)

".previous" "\n"

endif

`

i don't know if its right solution or not, but anyways OLD source code for this file (Qt-5) did not contain this opcode at all here.

Anyway - please continue building, at least until you get "jsc.exe" compiled im very interested if you will also get a SEGFAUL or not.

if it segfaults - no poin building further until we fix this, as i can assure you rest of the code builds OK but this SEGFAULT needs to be fixed first.

also - could it be because i did not enable JIT...

aquiles2k commented 5 months ago

Im coming further along (from 19% to 22% 😃 ). Next error is:

[ 22%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f2e18ffc-29.cpp.obj
cd /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/Source/JavaScriptCore && /home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-g++ -DBUILDING_JavaScriptCore -DBUILDING_QT__=1 -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1 -DHAVE_CONFIG_H=1 -DNOMINMAX -DPAS_BMALLOC=1 -DQT_ASCII_CAST_WARNINGS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_DYNAMIC_CAST -DQT_NO_EXCEPTIONS -DQT_NO_KEYWORDS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_USE_QSTRINGBUILDER -DSTATICALLY_LINKED_WITH_WTF -DUNICODE -D_UNICODE -D_WINDOWS -D_WINSOCKAPI_="" -D__USE_MINGW_ANSI_STDIO=1 @CMakeFiles/JavaScriptCore.dir/includes_CXX.rsp -Wextra -Wall -pipe -fmax-errors=20 -Wno-odr -Wno-stringop-overread -Wno-stringop-overflow -Wno-nonnull -Wno-array-bounds -Wno-expansion-to-defined -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-unknown-pragmas -Wno-tautological-compare -fpermissive -fno-strict-aliasing -fno-exceptions -fno-rtti -mno-ms-bitfields -fno-keep-inline-dllexport -O3 -DNDEBUG -std=c++20 -ffp-contract=off -MD -MT Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f2e18ffc-29.cpp.obj -MF CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f2e18ffc-29.cpp.obj.d -o CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f2e18ffc-29.cpp.obj -c /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f2e18ffc-29.cpp
In file included from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/WTF/Headers/wtf/Seconds.h:30,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/WTF/Headers/wtf/Lock.h:32,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/WTF/Headers/wtf/HashTable.h:34,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/WTF/Headers/wtf/HashMap.h:25,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/JSCJSValue.h:35,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/heap/HandleTypes.h:28,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/WriteBarrier.h:29,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/PropertyStorage.h:28,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/IndexingHeader.h:28,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/ArrayConventions.h:23,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/JSObject.h:25,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/MapPrototype.h:28,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/MapPrototype.cpp:27,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f2e18ffc-28.cpp:1:
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/MathCommon.cpp: In function 'double JSC::Math::stdPowDouble(double, double)':
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/WTF/Headers/wtf/MathExtras.h:393:19: error: 'wtf_pow' is not a member of 'std'; did you mean 'wtf_pow'?
  393 | #define pow(x, y) wtf_pow(x, y)
      |                   ^~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/WTF/Headers/wtf/MathExtras.h:393:19: note: in definition of macro 'pow'
  393 | #define pow(x, y) wtf_pow(x, y)
      |                   ^~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/WTF/Headers/wtf/MathExtras.h:375:15: note: 'wtf_pow' declared here
  375 | inline double wtf_pow(double x, double y)
      |               ^~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/runtime/MathCommon.cpp: In function 'float JSC::Math::stdPowFloat(float, float)':
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/WTF/Headers/wtf/MathExtras.h:393:19: error: 'wtf_pow' is not a member of 'std'; did you mean 'wtf_pow'?
  393 | #define pow(x, y) wtf_pow(x, y)
      |                   ^~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/WTF/Headers/wtf/MathExtras.h:393:19: note: in definition of macro 'pow'
  393 | #define pow(x, y) wtf_pow(x, y)
      |                   ^~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/WTF/Headers/wtf/MathExtras.h:375:15: note: 'wtf_pow' declared here
  375 | inline double wtf_pow(double x, double y)
      |               ^~~~~~~
quarcko commented 5 months ago

Strange, you said you use MSVC? Because this is related to compiling under MINGW... still, unfortunately MathExtras.h has pow redefinition as wtf_pow and code further down the line does this: std::pow -> expanding macro -> std::wtf_pow -> error wft_pow is not a member bla bla bla...

so what you do is this: in all files (there will be many of them) where you got this error:

if COMPILER(MINGW64) && (!defined(MINGW64_VERSION_RC) || MINGW64_VERSION_RC < 1)

return pow(x, y);

else

return std::pow(x, y);

endif

aquiles2k commented 5 months ago

Im doing both, msvc and mingw, just to see if i get at least one to compile. As the issue title states, here im talking about mingw progress. In the other issue about pearl im talking about msvc. Sorry if im confusing you 😄

patching the mingw build through mxe is very cumbersome since i have to create a patch file for every single line ... but i'll see what i can do. Thanks for the help so far!

aquiles2k commented 5 months ago

Ok, i had time for another build try, we are at a whooping 39% 🥳

The jsc.exe basically has the same linker errors i have in the other ticket with msvc:

[ 38%] Building CXX object Source/JavaScriptCore/shell/CMakeFiles/jsc.dir/__/jsc.cpp.obj 
cd /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/Source/JavaScriptCore/shell && /home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-g++ -DBUILDING_QT__=1 -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1 -DBUILDING_jsc -DHAVE_CONFIG_H=1 -DNOMINMAX -DPAS_BMALLOC=1 -DQT_ASCII_CAST_WARNINGS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_DYNAMIC_CAST -DQT_NO_EXCEPTIONS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_USE_QSTRINGBUILDER -DSTATICALLY_LINKED_WITH_JavaScriptCore -DSTATICALLY_LINKED_WITH_WTF -DUNICODE -D_UNICODE -D_WINDOWS -D_WINSOCKAPI_="" -D__USE_MINGW_ANSI_STDIO=1 @CMakeFiles/jsc.dir/includes_CXX.rsp -Wextra -Wall -pipe -fmax-errors=20 -Wno-odr -Wno-stringop-overread -Wno-stringop-overflow -Wno-nonnull -Wno-array-bounds -Wno-expansion-to-defined -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-unknown-pragmas -Wno-tautological-compare -fpermissive -fno-strict-aliasing -fno-exceptions -fno-rtti -mno-ms-bitfields -fno-keep-inline-dllexport -O3 -DNDEBUG -std=c++20 -MD -MT Source/JavaScriptCore/shell/CMakeFiles/jsc.dir/__/jsc.cpp.obj -MF CMakeFiles/jsc.dir/__/jsc.cpp.obj.d -o CMakeFiles/jsc.dir/__/jsc.cpp.obj -c /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/JavaScriptCore/jsc.cpp
[ 39%] Linking CXX executable ../../../bin/jsc.exe
cd /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07.build_/Source/JavaScriptCore/shell && /home/adrian/dev/sources/mxe/usr/x86_64-pc-linux-gnu/bin/cmake -E cmake_link_script CMakeFiles/jsc.dir/link.txt --verbose=1
/home/adrian/dev/sources/mxe/usr/x86_64-pc-linux-gnu/bin/cmake -E rm -f CMakeFiles/jsc.dir/objects.a
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ar qc CMakeFiles/jsc.dir/objects.a @CMakeFiles/jsc.dir/objects1.rsp
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-g++ -Wextra -Wall -pipe -fmax-errors=20 -Wno-odr -Wno-stringop-overread -Wno-stringop-overflow -Wno-nonnull -Wno-array-bounds -Wno-expansion-to-defined -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-unknown-pragmas -Wno-tautological-compare -fpermissive -fno-strict-aliasing -fno-exceptions -fno-rtti -mno-ms-bitfields -fno-keep-inline-dllexport -O3 -DNDEBUG -Wl,--whole-archive CMakeFiles/jsc.dir/objects.a -Wl,--no-whole-archive -o ../../../bin/jsc.exe -Wl,--out-implib,../../../lib/libjsc.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/jsc.dir/linkLibs.rsp
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.text+0xf4): undefined reference to `WTF::WorkQueueBase::platformInvalidate()'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.text+0x124): undefined reference to `WTF::WorkQueueBase::platformInvalidate()'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.text+0x70a): undefined reference to `WTF::WorkQueue::constructMainWorkQueue()'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.text+0x826): undefined reference to `WTF::WorkQueueBase::platformInitialize(char const*, WTF::WorkQueueBase::Type, WTF::Thread::QOS)'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.text+0x899): undefined reference to `WTF::WorkQueueBase::platformInitialize(char const*, WTF::WorkQueueBase::Type, WTF::Thread::QOS)'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.text+0x7d6): undefined reference to `WTF::WorkQueueBase::platformInitialize(char const*, WTF::WorkQueueBase::Type, WTF::Thread::QOS)'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.text$_ZN3WTF19ConcurrentWorkQueueD1Ev[_ZN3WTF19ConcurrentWorkQueueD1Ev]+0x14): undefined reference to `WTF::WorkQueueBase::platformInvalidate()'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.text$_ZN3WTF9WorkQueueD1Ev[_ZN3WTF9WorkQueueD1Ev]+0x14): undefined reference to `WTF::WorkQueueBase::platformInvalidate()'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.text$_ZN3WTF19ConcurrentWorkQueueD0Ev[_ZN3WTF19ConcurrentWorkQueueD0Ev]+0x14): undefined reference to `WTF::WorkQueueBase::platformInvalidate()'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.text$_ZN3WTF9WorkQueueD0Ev[_ZN3WTF9WorkQueueD0Ev]+0x14): undefined reference to `WTF::WorkQueueBase::platformInvalidate()'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.rdata$_ZTVN3WTF9WorkQueueE[_ZTVN3WTF9WorkQueueE]+0x20): undefined reference to `WTF::WorkQueueBase::dispatch(WTF::Function<void ()>&&)'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.rdata$_ZTVN3WTF9WorkQueueE[_ZTVN3WTF9WorkQueueE]+0x28): undefined reference to `WTF::WorkQueueBase::dispatchAfter(WTF::Seconds, WTF::Function<void ()>&&)'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.rdata$_ZTVN3WTF19ConcurrentWorkQueueE[_ZTVN3WTF19ConcurrentWorkQueueE]+0x20): undefined reference to `WTF::WorkQueueBase::dispatch(WTF::Function<void ()>&&)'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.rdata$_ZTVN3WTF19ConcurrentWorkQueueE[_ZTVN3WTF19ConcurrentWorkQueueE]+0x28): undefined reference to `WTF::WorkQueueBase::dispatchAfter(WTF::Seconds, WTF::Function<void ()>&&)'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.rdata$_ZTVN3WTF13WorkQueueBaseE[_ZTVN3WTF13WorkQueueBaseE]+0x20): undefined reference to `WTF::WorkQueueBase::dispatch(WTF::Function<void ()>&&)'
/home/adrian/dev/sources/mxe/usr/bin/x86_64-w64-mingw32.shared-ld: ../../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/WorkQueue.cpp.obj:WorkQueue.cpp:(.rdata$_ZTVN3WTF13WorkQueueBaseE[_ZTVN3WTF13WorkQueueBaseE]+0x28): undefined reference to `WTF::WorkQueueBase::dispatchAfter(WTF::Seconds, WTF::Function<void ()>&&)'
collect2: error: ld returned 1 exit status

There is also good stuff ahead:

In file included from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/dom/ElementContext.h:32,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/loader/FrameLoaderTypes.h:31,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/dom/Document.h:44,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/page/Frame.h:32,
                 from /home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/page/UserMessageHandler.cpp:31:
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/platform/ScriptExecutionContextIdentifier.h: In static member function 'static WebCore::ProcessQualified<_GUID> WebCore::ProcessQualified<_GUID>::generate()':
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/platform/ScriptExecutionContextIdentifier.h:37:97: error: could not convert '{WTF::UUID::createVersion4(), WebCore::Process::identifier()}' from '<brace-enclosed initializer list>' to 'WebCore::ProcessQualified<_GUID>'
   37 |     static ProcessQualified generate() { return { UUID::createVersion4(), Process::identifier() }; }
      |                                                                                                 ^
      |                                                                                                 |
      |                                                                                                 <brace-enclosed initializer list>
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/platform/ScriptExecutionContextIdentifier.h: In constructor 'WebCore::ProcessQualified<_GUID>::ProcessQualified()':
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/platform/ScriptExecutionContextIdentifier.h:40:11: warning: missing initializer for member '_GUID::Data2' [-Wmissing-field-initializers]
   40 |         : m_object(UUID::emptyValue)
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/platform/ScriptExecutionContextIdentifier.h:40:11: warning: missing initializer for member '_GUID::Data3' [-Wmissing-field-initializers]
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/platform/ScriptExecutionContextIdentifier.h:40:11: warning: missing initializer for member '_GUID::Data4' [-Wmissing-field-initializers]
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/platform/ScriptExecutionContextIdentifier.h: In constructor 'WebCore::ProcessQualified<_GUID>::ProcessQualified(WTF::HashTableDeletedValueType)':
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/platform/ScriptExecutionContextIdentifier.h:51:11: warning: missing initializer for member '_GUID::Data2' [-Wmissing-field-initializers]
   51 |         : m_object(WTF::HashTableDeletedValue)
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/platform/ScriptExecutionContextIdentifier.h:51:11: warning: missing initializer for member '_GUID::Data3' [-Wmissing-field-initializers]
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/platform/ScriptExecutionContextIdentifier.h:51:11: warning: missing initializer for member '_GUID::Data4' [-Wmissing-field-initializers]
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/platform/ScriptExecutionContextIdentifier.h: In member function 'WebCore::ProcessQualified<_GUID>::operator bool() const':
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/platform/ScriptExecutionContextIdentifier.h:56:37: error: no match for 'operator!' (operand type is 'const UUID' {aka 'const GUID'})
   56 |     operator bool() const { return !!m_object; }
      |                                     ^~~~~~~~~
/home/adrian/dev/sources/mxe/tmp-qtwebkit2-x86_64-w64-mingw32.shared/webkit-2022-09-07/Source/WebCore/platform/ScriptExecutionContextIdentifier.h:56:37: note: candidate: 'operator!(bool)' (built-in)
aquiles2k commented 5 months ago

After fixing the linker errors jsc.exe builds now. Did not have time to test it yet since i'm on a mac at work now. Trying to fix the ScriptExecutionContextIdentifier.h error next.

quarcko commented 5 months ago

Thats strange, i did not have this one error (or maybe i dont remember having it)

Waiting for your test run of jsc.exe.

aquiles2k commented 5 months ago

I'm compiling the "2022-09-07" tag. I thought this would mean less friction than using newer code. Thats why you didn't see this one.

The is related to https://bugs.webkit.org/show_bug.cgi?id=234696 The qt6 branch already has the changes integrated.

Anyway i fixed it and the next one is:

/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp: At global scope:
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp:1744:5: error: no declaration matches 'HDC__* WebCore::GraphicsContextQt::getWindowsContext(const WebCore::IntRect&, bool)'
 1744 | HDC GraphicsContextQt::getWindowsContext(const IntRect& dstRect, bool supportAlphaBlend)
      |     ^~~~~~~~~~~~~~~~~
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp:1744:5: note: no functions named 'HDC__* WebCore::GraphicsContextQt::getWindowsContext(const WebCore::IntRect&, bool)'
In file included from /Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp:40:
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/WebCore/platform/graphics/qt/GraphicsContextQt.h:35:22: note: 'class WebCore::GraphicsContextQt' defined here
   35 | class WEBCORE_EXPORT GraphicsContextQt final : public GraphicsContext {
      |                      ^~~~~~~~~~~~~~~~~
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp:1800:6: error: no declaration matches 'void WebCore::GraphicsContextQt::releaseWindowsContext(HDC, const WebCore::IntRect&, bool)'
 1800 | void GraphicsContextQt::releaseWindowsContext(HDC hdc, const IntRect& dstRect, bool supportAlphaBlend)
      |      ^~~~~~~~~~~~~~~~~
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp:1800:6: note: no functions named 'void WebCore::GraphicsContextQt::releaseWindowsContext(HDC, const WebCore::IntRect&, bool)'
In file included from /Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp:40:
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/WebCore/platform/graphics/qt/GraphicsContextQt.h:35:22: note: 'class WebCore::GraphicsContextQt' defined here
   35 | class WEBCORE_EXPORT GraphicsContextQt final : public GraphicsContext {
      |                      ^~~~~~~~~~~~~~~~~
aquiles2k commented 5 months ago

Btw, i copied the compiled exe to a win laptop and a basic execution works:

PS C:\Users\alex\Desktop\jsc> .\jsc.exe -h
Usage: jsc [options] [files] [-- arguments]
  -d         Dumps bytecode (debug builds only)
  -e         Evaluate argument as script code
  -f         Specifies a source file (deprecated)
  -h|--help  Prints this help message
  -i         Enables interactive mode (default if no files are specified)
  -m         Execute as a module
  -p <file>  Outputs profiling data to a file
  -x         Output exit code before terminating

  --sample                   Collects and outputs sampling profiler data
  --test262-async            Check that some script calls the print function with the string 'Test262:AsyncTestComplete'
  --strict-file=<file>       Parse the given file as if it were in strict mode (this option may be passed more than once)
  --module-file=<file>       Parse and evaluate the given file as module (this option may be passed more than once)
  --exception=<name>         Check the last script exits with an uncaught exception with the specified name
  --watchdog-exception-ok    Uncaught watchdog exceptions exit with success
  --dumpException            Dump uncaught exception text
  --footprint                Dump memory footprint after done executing
  --options                  Dumps all JSC VM options and exits
  --dumpOptions              Dumps all non-default JSC VM options before continuing
  --<jsc VM option>=<value>  Sets the specified JSC VM option
  --destroy-vm               Destroy VM before exiting
  --can-block-is-false       Make main thread's Atomics.wait throw

Files with a .mjs extension will always be evaluated as modules.

PS C:\Users\alex\Desktop\jsc>

Do you have any special command i should test or is this sufficient as proof of concept?

quarcko commented 5 months ago

Try to run "jsc.exe" without any flags, so it tries to load interpreter. with "-h" flag my jsc.exe works as well (because id does not load interpreter).

Some info from you: 1) do you have JIT enabled? 2) MSVC or MINGW? (Cause they generate different assembly code)...

quarcko commented 5 months ago

About your error:

please pu this code in GraphicsContextQt.h: and remove it from GraphicsContents.h:

// FIXED: Moved from GraphicsContext.h to GraphicContextQt.h, probably belongs here. #if OS(WINDOWS) HDC getWindowsContext(const IntRect&, bool supportAlphaBlend); // The passed in rect is used to create a bitmap for compositing inside transparency layers. void releaseWindowsContext(HDC, const IntRect&, bool supportAlphaBlend); // The passed in HDC should be the one handed back by getWindowsContext. #endif

aquiles2k commented 5 months ago

It's mingw (crosscompiled through mxe https://github.com/mxe/mxe)

In 5.212 it directly showed if JIT was enabled with "ENABLE_JIT=ON" It's not showing this in my log so i'm actually not sure.

PS C:\Users\alex\Desktop\jsc> .\jsc.exe
PS C:\Users\alex\Desktop\jsc> $LastExitCode
-1073741819
PS C:\Users\alex\Desktop\jsc>

-1073741819 in hex is 0xC0000005 which is STATUS_ACCESS_VIOLATION

aquiles2k commented 5 months ago

It seems qtwebkit default disabled it 7 years ago for mingw (https://github.com/qtwebkit/qtwebkit/commit/52fcce005c04a86d9a4a941287183547972692df)

When i enable it i error out early:

[ 17%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f0a787a9-12.cpp.obj
cd /Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07.build_/Source/JavaScriptCore && /Users/adrian/dev/mxe_webfix/usr/bin/x86_64-w64-mingw32.shared.seh-g++ -DBUILDING_JavaScriptCore -DBUILDING_QT__=1 -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1 -DHAVE_CONFIG_H=1 -DNOMINMAX -DPAS_BMALLOC=1 -DQT_ASCII_CAST_WARNINGS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_DYNAMIC_CAST -DQT_NO_EXCEPTIONS -DQT_NO_KEYWORDS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_USE_QSTRINGBUILDER -DSTATICALLY_LINKED_WITH_WTF -DUNICODE -D_UNICODE -D_WINDOWS -D_WINSOCKAPI_="" -D__USE_MINGW_ANSI_STDIO=1 @CMakeFiles/JavaScriptCore.dir/includes_CXX.rsp -Wextra -Wall -pipe -fmax-errors=20 -Wno-odr -Wno-stringop-overflow -Wno-nonnull -Wno-array-bounds -Wno-expansion-to-defined -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-unknown-pragmas -Wno-tautological-compare -fpermissive -fno-strict-aliasing -fno-exceptions -fno-rtti -mno-ms-bitfields -fno-keep-inline-dllexport -O3 -DNDEBUG -std=c++2a -ffp-contract=off -MD -MT Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f0a787a9-12.cpp.obj -MF CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f0a787a9-12.cpp.obj.d -o CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f0a787a9-12.cpp.obj -c /Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07.build_/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f0a787a9-12.cpp
In file included from /Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/JavaScriptCore/bytecode/CodeBlock.cpp:54,
                 from /Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07.build_/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f0a787a9-3.cpp:6:
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/JavaScriptCore/jit/JIT.h:738:18: error: explicit specialization in non-namespace scope 'class JSC::JIT'
  738 |         template<>
      |                  ^
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/JavaScriptCore/jit/JIT.h:744:30: error: too many template-parameter-lists
  744 |         MacroAssembler::Call callOperation(OperationType operation, Args... args)
      |                              ^~~~~~~~~~~~~
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/JavaScriptCore/jit/JIT.h:765:14: error: too many template-parameter-lists
  765 |         void callOperation(Address target, Args... args)
      |              ^~~~~~~~~~~~~
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/JavaScriptCore/jit/JIT.h:777:9: error: too many template-parameter-lists
  777 |         callOperationWithProfile(const Bytecode& bytecode, OperationType operation, VirtualRegister result, Args... args)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/JavaScriptCore/jit/JIT.h:785:9: error: too many template-parameter-lists
  785 |         callOperationWithProfile(const Bytecode& bytecode, Address target, VirtualRegister result, Args... args)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/JavaScriptCore/jit/JIT.h:792:30: error: too many template-parameter-lists
  792 |         MacroAssembler::Call callOperationWithResult(OperationType operation, JSValueRegs resultRegs, Args... args)
      |                              ^~~~~~~~~~~~~~~~~~~~~~~
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/JavaScriptCore/jit/JIT.h:802:30: error: too many template-parameter-lists
  802 |         MacroAssembler::Call callOperationNoExceptionCheck(OperationType operation, Args... args)
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/JavaScriptCore/jit/JIT.h:822:30: error: too many template-parameter-lists
  822 |         MacroAssembler::Call callThrowOperationWithCallFrameRollback(OperationType operation, Args... args)
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/JavaScriptCore/jit/JIT.h:837:14: error: too many template-parameter-lists
  837 |         void emitBitBinaryOpFastPath(const JSInstruction* currentInstruction, ProfilingPolicy shouldEmitProfiling = ProfilingPolicy::NoProfiling);
      |              ^~~~~~~~~~~~~~~~~~~~~~~
/Users/adrian/dev/mxe_webfix/tmp-qtwebkit-x86_64-w64-mingw32.shared.seh/webkit-2022-09-07/Source/JavaScriptCore/jit/JIT.h:842:14: error: too many template-parameter-lists
  842 |         void emitRightShiftFastPath(const JSInstruction* currentInstruction, JITRightShiftGenerator::ShiftType);
      |              ^~~~~~~~~~~~~~~~~~~~~~
quarcko commented 5 months ago

So yeah, your jsc is crashing same way.. so let's wait if someone replies at qtwebkt repo to my request, or try to forward my collected info to someone at webkit mailing list...

what i tried additionally: building on Ubuntu with and without JIT - jsc runs perfectly fine in both cases. so disabled JIT should not be the issue there (assume).

P.S. my building for MINGW consists of full Qt 6.5.3 install under wine. all additional libraries that i link to are collected from MSYS project. MINGW i use is standard which comes with Qt 6.5.3.

Also tried building in VM Windows 10 - results are same. so environment is not to blame either.