movableink / webkit

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

Errors when compiling with msvc #33

Open aquiles2k opened 6 months ago

aquiles2k commented 6 months ago

Hi, i still can't get msvc to compile webkit for qt5.

With the help of @quarcko and others i already smashed a lot of errors but there are still some left and i have not yet found out how to fix these.

Error 1:

You've instantiated std::aligned_storage<Len, Align> with an extended alignment (in other words, Align > alignof(max_align_t)). 
Before VS 2017 15.8, the member "type" would non-conformingly have an alignment of only alignof(max_align_t). VS 2017 15.8 was fixed to handle this correctly, 
but the fix inherently changes layout and breaks binary compatibility (*only* for uses of aligned_storage with extended alignments). 
Please define either (1) _ENABLE_EXTENDED_ALIGNED_STORAGE to acknowledge that you understand this message and that you actually want a type with an extended alignment, 
or (2) _DISABLE_EXTENDED_ALIGNED_STORAGE to silence this message and get the old non-conforming behavior. 

(compiling source file D:\Dev\Builds\qtwebkitcmake\WebCore\DerivedSources\unified-sources\UnifiedSource-c57e08af-5.cpp) WebCore (WebCore\WebCore)   
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\type_traits

Error 2:

'WebCore::XMLDocumentParserScope::XMLDocumentParserScope(WebCore::CachedResourceLoader *,xmlGenericErrorFunc,xmlStructuredErrorFunc,void *)': 
cannot convert argument 3 from 'void (__cdecl *)(void *,xmlError *)' to 'xmlStructuredErrorFunc'

(compiling source file D:\Dev\Builds\qtwebkitcmake\WebCore\DerivedSources\unified-sources\UnifiedSource-42f7b70e-2.cpp) WebCore (WebCore\WebCore)   
D:\Dev\Sources\qtwebkit-2022-09-07-src\Source\WebCore\xml\XSLStyleSheetLibxslt.cpp  143 

Error 3:

'void xmlSetStructuredErrorFunc(void *,xmlStructuredErrorFunc)': 
cannot convert argument 2 from 'void (__cdecl *)(void *,xmlError *)' to 'xmlStructuredErrorFunc' 

(compiling source file D:\Dev\Builds\qtwebkitcmake\WebCore\DerivedSources\unified-sources\UnifiedSource-42f7b70e-2.cpp) WebCore (WebCore\WebCore)   
D:\Dev\Sources\qtwebkit-2022-09-07-src\Source\WebCore\xml\XSLTProcessorLibxslt.cpp  134 

Error 4:

missing type specifier - int assumed. Note: C++ does not support default-int    

WebKitLegacy (WebKitLegacy\WebKitLegacy)    D:\Dev\Builds\qtwebkitcmake\WebCore\PrivateHeaders\WebCore\ProgressTrackerClient.h  33  

So does anyone know how to fix these? Thanks and best wishes!

aquiles2k commented 6 months ago

Only error 4 remaining.

I fixed error 1 by defining _ENABLE_EXTENDED_ALIGNED_STORAGE as sugested though i dont know what implications this has.

I fixed error 2 and 3 by adding a missing const to XSLTProcessor::parseErrorFunc in .cpp and .h

I still don't know for error 4. ProgressTrackerClient.h looks like:

namespace WebCore {

class Frame;

class ProgressTrackerClient {
    WTF_MAKE_FAST_ALLOCATED;
public:

The error is in the macro WTF_MAKE_FAST_ALLOCATED which expands to some crazy code overwriting new and delete operators.

quarcko commented 6 months ago

Sorry i did not encounter any of these errors on my build with MINGW. But maybe you should try building "qt6" or "qt6-gha" branches as code in ProgressTrackerClient.h is different than the one you are building...

aquiles2k commented 6 months ago

After expanding the macro to actual code i found a fix for error 4 by just adding a <WTF/FastMalloc.h> include.

Now the next thing are linker errors for WebKitLegacy with QWebPluginFactory in FrameLoaderClientQt.obj and QWebPageAdapter.obj:

Severity    Code    Description Project File    Line    Suppression State
Error   LNK2019 unresolved external symbol "public: bool __cdecl QWebPluginFactory::MimeType::operator==(struct QWebPluginFactory::MimeType const &)const " (??8MimeType@QWebPluginFactory@@QEBA_NAEBU01@@Z) referenced in function "public: bool __cdecl QWebPluginFactory::MimeType::operator!=(struct QWebPluginFactory::MimeType const &)const " (??9MimeType@QWebPluginFactory@@QEBA_NAEBU01@@Z)   WebKitLegacy (WebKitLegacy\WebKitLegacy)    D:\Dev\Builds\qtwebkitcmake\Source\WebKitLegacy\FrameLoaderClientQt.obj 1   
Error   LNK2001 unresolved external symbol "public: bool __cdecl QWebPluginFactory::MimeType::operator==(struct QWebPluginFactory::MimeType const &)const " (??8MimeType@QWebPluginFactory@@QEBA_NAEBU01@@Z)    WebKitLegacy (WebKitLegacy\WebKitLegacy)    D:\Dev\Builds\qtwebkitcmake\Source\WebKitLegacy\QWebPageAdapter.obj 1   
Error   LNK2019 unresolved external symbol "public: __cdecl QWebPluginFactory::QWebPluginFactory(class QObject *)" (??0QWebPluginFactory@@QEAA@PEAVQObject@@@Z) referenced in function "public: void __cdecl QWebPluginFactory::`default constructor closure'(void)" (??_FQWebPluginFactory@@QEAAXXZ)   WebKitLegacy (WebKitLegacy\WebKitLegacy)    D:\Dev\Builds\qtwebkitcmake\Source\WebKitLegacy\FrameLoaderClientQt.obj 1   
Error   LNK2001 unresolved external symbol "public: __cdecl QWebPluginFactory::QWebPluginFactory(class QObject *)" (??0QWebPluginFactory@@QEAA@PEAVQObject@@@Z) WebKitLegacy (WebKitLegacy\WebKitLegacy)    D:\Dev\Builds\qtwebkitcmake\Source\WebKitLegacy\QWebPageAdapter.obj 1   
Error   LNK2019 unresolved external symbol "public: static struct QMetaObject const QWebPluginFactory::staticMetaObject" (?staticMetaObject@QWebPluginFactory@@2UQMetaObject@@B) referenced in function "public: static class QString __cdecl QWebPluginFactory::tr(char const *,char const *,int)" (?tr@QWebPluginFactory@@SA?AVQString@@PEBD0H@Z) WebKitLegacy (WebKitLegacy\WebKitLegacy)    D:\Dev\Builds\qtwebkitcmake\Source\WebKitLegacy\FrameLoaderClientQt.obj 1   
Error   LNK2001 unresolved external symbol "public: static struct QMetaObject const QWebPluginFactory::staticMetaObject" (?staticMetaObject@QWebPluginFactory@@2UQMetaObject@@B)    WebKitLegacy (WebKitLegacy\WebKitLegacy)    D:\Dev\Builds\qtwebkitcmake\Source\WebKitLegacy\QWebPageAdapter.obj 1   

Can the WebPlugins be disabled?

aquiles2k commented 5 months ago

Ok, i finally had time again to look into this. I fixed the linker errors by adding missing "qt/Api/qwebpluginfactory.cpp" to the sources in "Source/WebKitLegacy/PlatformQt.cmake" and it finished compiling.

Unfortunately the QtTestBrowser is only able to display basic webpages. When any javascript is involved it renders nothing. Thats strange because according to CMakeCache.txt it was built with jit enabled.

As this is the 22-09-07 tag i'm now trying the master branch as well as setting up qt6 and its branch to try and see if that makes a difference.

@mnutt Are you able to open complex pages like google maps with you qt6 build?