Summary: | [Qt] MSVC: unresolved external symbol __DllMainCRTStartup@12 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Jocelyn Turcotte <jturcotte> | ||||||
Component: | Tools / Tests | Assignee: | Simon Hausmann <hausmann> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | galpeter, hausmann, joel.dillon, ossy, vestbo, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 88300 | ||||||||
Attachments: |
|
Description
Jocelyn Turcotte
2012-07-13 06:08:57 PDT
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> |