Since the recent build changes in QtWebKit I get this error while linking QtWebKit. From my investigations, this seems to happen since there is no more obj files linked into the DLL, only static libraries. The way the linker usually links to MSVCRT.dll is by looking at linking directives in obj files, which depends if they were compiled with /MD, /MT, etc. I didn't try out yet to fix it but I'm leaving on vacation and this is the result of my investigation. I guess that forcing the correct libs to the linker or adding an empty .cpp file in api.pri just to carry those options to the linker should do the trick. This is using the --no-webkit2 switch.
win32's default_post.prf is supposed to generate the forwarding export .cpp files using generate-win32-export-forwards. The generated sources are added to SOURCES and the resulting obj file should have those linker directives. However I also see the same issue and I do notice that the corresponding build rules for those are not always generated. So the lack of those rules is one issue and we could probably work around this particular linking issue with a dummy main.cpp file.
I think I found the reason. From win32/default_post.prf: ---- # When creating the target DLL, extract exporting linker directives from # all static libraries we're linking into the DLL and make sure they are # also exported from the DLL. shared:contains(TEMPLATE, lib) { for(target, POST_TARGETDEPS) { libdep = $$find(target, .*\\.lib) exists($$libdep): LIBSWITHEXPORTS += $$libdep } } !isEmpty(LIBSWITHEXPORTS) { exportgen.input = LIBSWITHEXPORTS [...] } ---- When the makefiles are generated the first time, the POST_TARGETDEPS are set correctly, but the exists() check prevents the population of LIBSWITHEXPORTS. Therefore the extra compiler is not set up and SOURCES remains empty.
Created attachment 152509 [details] Patch
Fixing bug dependencies, this isn't really a WK2 specific problem.
Comment on attachment 152509 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152509&action=review > Tools/Scripts/generate-win32-export-forwards:31 > + dumpBin = subprocess.Popen("dumpbin /directives " + library, stdout=subprocess.PIPE, universal_newlines=True); Semicolon isn't needed. > Tools/Scripts/generate-win32-export-forwards:33 > + output, errors = dumpBin.communicate(); Since you don't do anything with 'errors' then output = dumpBin.communicate()[0] is enough. > Tools/Scripts/generate-win32-export-forwards:39 > +exportedSymbolRegexp = re.compile("\s*(?P<symbol>/EXPORT:.+)"); Semicolon isn't needed. I didn't test it, but otherwise looks Iwouldr+it. :)
View in context: https://bugs.webkit.org/attachment.cgi?id=152509&action=review Some python comments: > Tools/Scripts/generate-win32-export-forwards:31 > + dumpBin = subprocess.Popen("dumpbin /directives " + library, stdout=subprocess.PIPE, universal_newlines=True); no need for the semicolon at the end. > Tools/Scripts/generate-win32-export-forwards:33 > + output, errors = dumpBin.communicate(); ditto > Tools/Scripts/generate-win32-export-forwards:36 > +libraries = sys.argv[1 : len(sys.argv) - 1] you can use negative indexing to get the last argument's index. so this'll be: sys.argv[1:-1] > Tools/Scripts/generate-win32-export-forwards:37 > +outputFileName = sys.argv[len(sys.argv) - 1] ditto: sys.argv[-1] > Tools/Scripts/generate-win32-export-forwards:39 > +exportedSymbolRegexp = re.compile("\s*(?P<symbol>/EXPORT:.+)"); semicolon is not needed > Tools/Scripts/generate-win32-export-forwards:45 > + if match != None: this can simply be: if match: because None is logically false.
Awesome, thanks guys for the suggestions :)
Created attachment 152530 [details] Patch
Comment on attachment 152530 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152530&action=review > Tools/Scripts/generate-win32-export-forwards:37 > +libraries = sys.argv[1 : len(sys.argv) - 1] > +outputFileName = sys.argv[len(sys.argv) - 1] I still need the -1 syntax trick here. > Tools/Scripts/generate-win32-export-forwards:45 > + if match != None: if match: > Tools/qmake/mkspecs/features/win32/default_post.prf:36 > + mac: suffix = _debug I'll remove the mac stuff and win32 scope before landing, since this is in win32/default_post.prf
Committed r123465: <http://trac.webkit.org/changeset/123465>