Bug 93460 - [Qt] QtWebKit linking fails for QNX cross build
Summary: [Qt] QtWebKit linking fails for QNX cross build
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Milian Wolff
URL:
Keywords:
Depends on:
Blocks: 74040
  Show dependency treegraph
 
Reported: 2012-08-08 04:29 PDT by Milian Wolff
Modified: 2012-08-14 04:42 PDT (History)
3 users (show)

See Also:


Attachments
Patch (745 bytes, patch)
2012-08-08 05:47 PDT, Milian Wolff
no flags Details | Formatted Diff | Diff
Patch (1.60 KB, patch)
2012-08-14 03:48 PDT, Milian Wolff
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Milian Wolff 2012-08-08 04:29:49 PDT
Trying to build QtWebKit for QNX using the bbndk 2.0.1 which uses gcc 4.4.2, I ran across the following issue:

make[2]: Entering directory `/home/milian/projects/qt5/build-playbook/qtwebkit/Release/Source'
rm -f libQtWebKit.so.5.0.0 libQtWebKit.so libQtWebKit.so.5 libQtWebKit.so.5.0
qcc -Vgcc_ntoarmv7le -lang-c++ -Wl,-rpath-link,/home/milian/bbndk-2.0.1/target/qnx6/armle-v7/lib -Wl,-rpath-link,/home/milian/bbndk-2.0.1/target/qnx6/armle-v7/usr/lib -Wl,-O1 -Wl,-rpath,/home/milian/projects/qt5/install-playbook/lib -Wl,-rpath,/home/milian/projects/qt5/install-playbook/lib -shared -Wl,-Bsymbolic-functions -Wl,-soname,libQtWebKit.so.5 -o libQtWebKit.so.5.0.0   -L/home/milian/bbndk-2.0.1/target/qnx6/armle-v7/lib -L/home/milian/bbndk-2.0.1/target/qnx6/armle-v7/usr/lib -L/home/milian/projects/qt5/build-playbook/qtwebkit/Release/Source/WebKit/release -L/home/milian/projects/qt5/build-playbook/qtwebkit/Release/Source/WebKit2/release -L/home/milian/projects/qt5/build-playbook/qtwebkit/Release/Source/WebCore/release -L/home/milian/projects/qt5/build-playbook/qtwebkit/Release/Source/JavaScriptCore/release -L/home/milian/projects/qt5/build-playbook/qtwebkit/Release/Source/WTF/release -L/home/milian/projects/qt5/install-playbook/lib -Wl,-whole-archive -lWebKit1 -Wl,-no-whole-archive -Wl,-whole-archive -lWebKit2 -Wl,-no-whole-archive -Wl,-whole-archive -lWebCore -Wl,-no-whole-archive -lz -ljpeg -lpng -Wl,-whole-archive -lJavaScriptCore -Wl,-no-whole-archive -Wl,-whole-archive -lWTF -Wl,-no-whole-archive -licui18n -licuuc -licudata -lnbutil -lQtQuick -L/home/milian/projects/qt5/build-playbook/qtdeclarative/lib -lQtPrintSupport -lQtXmlPatterns -lQtQml -lQtV8 -lbacktrace -lQtWidgets -lQtSql -lQtNetwork -lsocket -lQtGui -lQtCore -lm -lbps -lGLESv2 -lEGL 
cc: no files to process

Here is an excerpt of a discussion with tronical in #qtwebkit on Freenode IRC:

[13:03] <milian> I'm trying to get it build for qnx which worked ~2months ago... trying to rebase my patches and getting them upstreamed now, I hit this strange error and am really lost
[13:03] <milian> is it a qmake bug?
[13:04] <tronical> milian: sort of a gcc bug :)
[13:04] <milian> is there something I can do to work around it?
[13:05] <tronical> milian: the way we build webkit is that we build webcore, javascriptcore, etc. as static libraries
[13:05] <tronical> milian: and then link them all together into libqtwebkit.so
[13:05] <tronical> milian: it's that last linking step that doesn't involve any .cpp files
[13:06] <tronical> milian: it's just gcc -o libqtwebkit.so libwebcore libwtf.a ...
[13:06] <tronical> milian: (just linking, no -c as parameter)
[13:06] <tronical> milian: gcc and mscv can handle it
[13:06] <tronical> milian: see for example -Wl,-whole-archive -lJavaScriptCore -Wl,-no-whole-archive in your paste
[13:07] <milian> ok, and this got fixed with a newer gcc?
[13:07] <tronical> milian: I haven't run into any gcc yet that doesn't support it, so I'm curious why this fails for you :)
[13:08] <tronical> milian: if you take that commandline and change the -Wl,-whole-archive -lJavaScriptCore -Wl,no-whole-archive to -Wl,-whole-archive ../path/to/libJavaScriptCore.a -Wl,-no-whole-archive , does it work then?
[13:15] <tronical> milian: alternatively easy workaround:
[13:15] <milian> yes, now it's linking
[13:15] <tronical> milian: add a dummy .cpp file, add  it to api.pri
[13:16] <tronical> milian: if that works then it sounds very much like a gcc bug or incorrect serach paths
[13:17] <milian> seems to be gcc 4.4.2 in qnx bbndk
[13:19] <milian> I'll try to add the dummy .cpp file there, would that be acceptable to be pushed upstream (just for qnx of course)?
[13:20] <tronical> milian: yeah, I think that's okay. it should probably be a generated file (i.e. using  QMAKE_EXTRA_TARGETS and GENERATED_SOURCES)

I'll now try to implement what tronical suggests and prepare a patch.
Comment 1 Milian Wolff 2012-08-08 05:47:53 PDT
Created attachment 157195 [details]
Patch
Comment 2 Simon Hausmann 2012-08-09 22:28:07 PDT
Comment on attachment 157195 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=157195&action=review

> Source/api.pri:150
> +    dummyfile.commands = touch $$dummyfile.target

I think you could also use echo > $$dummyfile.target and it would work on Windows, in case we need it there at some point.
Comment 3 Milian Wolff 2012-08-13 07:13:07 PDT
Shall I change that now or can it stay like that for now? Is anything else required from my side to get this patch upstream?
Comment 4 Simon Hausmann 2012-08-13 07:17:46 PDT
(In reply to comment #3)
> Shall I change that now or can it stay like that for now? Is anything else required from my side to get this patch upstream?

No, I think it's okay as is. Would you like to use the commit queue to land it? Then set cq? :)
Comment 5 Milian Wolff 2012-08-14 03:44:19 PDT
Comment on attachment 157195 [details]
Patch

patch is missing updates to the changelog and it probably won't apply against master anyways due to updates to api.pri, I'll update it now.
Comment 6 Milian Wolff 2012-08-14 03:48:43 PDT
Created attachment 158286 [details]
Patch
Comment 7 WebKit Review Bot 2012-08-14 04:42:19 PDT
Comment on attachment 158286 [details]
Patch

Clearing flags on attachment: 158286

Committed r125544: <http://trac.webkit.org/changeset/125544>
Comment 8 WebKit Review Bot 2012-08-14 04:42:23 PDT
All reviewed patches have been landed.  Closing bug.