WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
91229
[Qt] MSVC: unresolved external symbol __DllMainCRTStartup@12
https://bugs.webkit.org/show_bug.cgi?id=91229
Summary
[Qt] MSVC: unresolved external symbol __DllMainCRTStartup@12
Jocelyn Turcotte
Reported
2012-07-13 06:08:57 PDT
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.
Attachments
Patch
(5.10 KB, patch)
2012-07-16 04:36 PDT
,
Simon Hausmann
no flags
Details
Formatted Diff
Diff
Patch
(5.09 KB, patch)
2012-07-16 07:26 PDT
,
Simon Hausmann
jturcotte
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Simon Hausmann
Comment 1
2012-07-13 07:09:31 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.
Simon Hausmann
Comment 2
2012-07-15 23:38:38 PDT
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.
Simon Hausmann
Comment 3
2012-07-16 04:36:53 PDT
Created
attachment 152509
[details]
Patch
Simon Hausmann
Comment 4
2012-07-16 04:40:52 PDT
Fixing bug dependencies, this isn't really a WK2 specific problem.
Zoltan Horvath
Comment 5
2012-07-16 05:05:50 PDT
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. :)
Peter Gal
Comment 6
2012-07-16 05:06:59 PDT
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.
Simon Hausmann
Comment 7
2012-07-16 06:04:24 PDT
Awesome, thanks guys for the suggestions :)
Simon Hausmann
Comment 8
2012-07-16 07:26:45 PDT
Created
attachment 152530
[details]
Patch
Simon Hausmann
Comment 9
2012-07-24 04:14:52 PDT
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
Simon Hausmann
Comment 10
2012-07-24 06:25:01 PDT
Committed
r123465
: <
http://trac.webkit.org/changeset/123465
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug