Bug 88763 - [Qt] Add configure test for zlib and set WTF_USE_ZLIB if found
Summary: [Qt] Add configure test for zlib and set WTF_USE_ZLIB if found
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: qi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-11 00:24 PDT by Simon Hausmann
Modified: 2012-06-13 07:41 PDT (History)
4 users (show)

See Also:


Attachments
patch (6.36 KB, patch)
2012-06-11 08:51 PDT, qi
no flags Details | Formatted Diff | Diff
patch2 (6.79 KB, patch)
2012-06-12 07:21 PDT, qi
hausmann: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Hausmann 2012-06-11 00:24:53 PDT
The websocket code can use zlib directory for compressiond/decompression. We should enable that and unskip the corresponding layout tests


LayoutTests/http/tests/websocket/tests/hybi/compressed-control-frame.html
LayoutTests/http/tests/websocket/tests/hybi/deflate-frame-invalid-parameter.html
LayoutTests/http/tests/websocket/tests/hybi/deflate-frame-parameter.html
LayoutTests/http/tests/websocket/tests/hybi/extensions.html
LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-extensions-header.html
Comment 1 qi 2012-06-11 08:51:47 PDT
Created attachment 146861 [details]
patch

zlib should be included in qt5, so by default websocket extension should work now in qt5. I don't know how about qt4.8, so I move the test cases into qt-4.8 skipped.
Comment 2 Simon Hausmann 2012-06-11 11:12:54 PDT
Comment on attachment 146861 [details]
patch

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

> Tools/qmake/config.tests/libzlib/libzlib.pro:2
> +OBJECTS_DIR = obj

Don't you also need a LIBS += -lz here?
Comment 3 qi 2012-06-11 11:23:35 PDT
Yes, I didn't include the lib by myself, it just work. Looks like qt5 already include it:

qt5/qtbase/src/3rdparty/zlib/
Comment 4 Simon Hausmann 2012-06-11 11:35:35 PDT
(In reply to comment #3)
> Yes, I didn't include the lib by myself, it just work. Looks like qt5 already include it:
> 
> qt5/qtbase/src/3rdparty/zlib/

Right, but that's not going to work anymore after

    https://codereview.qt-project.org/#change,28141

We should not be using the zlib symbols from QtCore, we should use the system one.
Comment 5 qi 2012-06-11 12:41:31 PDT
I updated my qt5, but I still didn't get that patch. And from the comments:

This commit does not in itself solve the issue of how to let Qt
libraries outside of qtbase use the same bundled zlib, but it is
a prerequisite for that.

Looks like we have to wait for a while to really get the fix.

Question: if I used LIBS += -lz, how do I know I use qt symbols or system symbols now?
Comment 6 Simon Hausmann 2012-06-11 12:46:50 PDT
(In reply to comment #5)
> I updated my qt5, but I still didn't get that patch. And from the comments:
> 
> This commit does not in itself solve the issue of how to let Qt
> libraries outside of qtbase use the same bundled zlib, but it is
> a prerequisite for that.
> 
> Looks like we have to wait for a while to really get the fix.
> 
> Question: if I used LIBS += -lz, how do I know I use qt symbols or system symbols now?

On Linux (or more specifically ELF) this is only determined at load time (or when prelinking). I think we should do the right thing and use -lz because we also _do_ use the system zlib _header_ files that come with it - we don't use the headers shipped inside Qt.

Anyway, in the common case Qt should also be using the system zlib anyway instead.
Comment 7 qi 2012-06-12 07:21:16 PDT
Created attachment 147078 [details]
patch2

I am just wondering if we use system symbols then we have new depend.
I have another stupid question: why -lz not -lzlib (I suppose is this one, but doesn't work)
Comment 8 Simon Hausmann 2012-06-12 08:02:14 PDT
(In reply to comment #7)
> Created an attachment (id=147078) [details]
> patch2
> 
> I am just wondering if we use system symbols then we have new depend.

Yes, we do, we should and will depend on the system z library.

> I have another stupid question: why -lz not -lzlib (I suppose is this one, but doesn't work)

Because the library is called libz.so, not libzlib.so :)
Comment 9 Simon Hausmann 2012-06-12 08:03:57 PDT
Comment on attachment 147078 [details]
patch2

r=me, but please set cq+ manually or land it manually and watch the bots closely.
Comment 10 qi 2012-06-13 05:55:19 PDT
Manually Committed r120193: <http://trac.webkit.org/changeset/120193>
Comment 11 Laszlo Gombos 2012-06-13 07:40:52 PDT
Comment on attachment 147078 [details]
patch2

Setting the patch obsolete as it is landed.