Bug 79877 - [GTK] zlib link error with --enable-webkit2
Summary: [GTK] zlib link error with --enable-webkit2
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-28 23:09 PST by Joone Hur
Modified: 2012-03-05 08:56 PST (History)
6 users (show)

See Also:


Attachments
Proposed Patch (2.10 KB, patch)
2012-03-04 07:08 PST, Joone Hur
pnormand: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Updated Patch2 (2.57 KB, patch)
2012-03-04 20:18 PST, Joone Hur
no flags Details | Formatted Diff | Diff
Proposed Patch3 (1.58 KB, patch)
2012-03-05 06:24 PST, Joone Hur
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joone Hur 2012-02-28 23:09:54 PST
I'm not sure if this is a common problem for all.

/bin/mkdir -p ./.deps/DerivedSources
  CXXLD  Programs/WebKitWebProcess
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateInit2_'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateEnd'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateReset'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflateInit2_'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflateEnd'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflate'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateBound'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflate'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'uncompress'
collect2: ld returned 1 exit status
make[1]: *** [Programs/WebKitWebProcess] Error 1
Comment 1 Joone Hur 2012-03-04 06:42:55 PST
When running make -j4,

  CXXLD  Programs/WebKit2APITests/TestPrinting
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateInit2_'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateEnd'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateReset'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflateInit2_'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflateEnd'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflate'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateBound'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflate'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'uncompress'
collect2: ld returned 1 exit status
make[1]: *** [Programs/WebKit2APITests/TestBackForwardList] Error 1
make[1]: *** Waiting for unfinished jobs....
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateInit2_'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateEnd'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateReset'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflateInit2_'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflateEnd'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflate'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateBound'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflate'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'uncompress'
collect2: ld returned 1 exit status
make[1]: *** [Programs/WebKit2APITests/TestDownloads] Error 1
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateInit2_'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateEnd'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateReset'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflateInit2_'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflateEnd'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflate'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateBound'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflate'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'uncompress'
collect2: ld returned 1 exit status
make[1]: *** [Programs/WebKit2APITests/TestLoaderClient] Error 1
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateInit2_'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateEnd'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateReset'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflateInit2_'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflateEnd'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'inflate'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflateBound'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'deflate'
./.libs/libwebkit2gtk-3.0.so: error: undefined reference to 'uncompress'
collect2: ld returned 1 exit status
make[1]: *** [Programs/WebKit2APITests/TestPrinting] Error 1
Comment 2 Joone Hur 2012-03-04 07:08:09 PST
Created attachment 130024 [details]
Proposed Patch

My linker version is GNU gold (GNU Binutils for Ubuntu 2.21.53.20110810) 1.11
Comment 3 WebKit Review Bot 2012-03-04 07:10:52 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 4 WebKit Review Bot 2012-03-04 08:06:16 PST
Comment on attachment 130024 [details]
Proposed Patch

Attachment 130024 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11807427

New failing tests:
editing/selection/select-line-break-with-opposite-directionality.html
Comment 5 WebKit Review Bot 2012-03-04 08:58:13 PST
Comment on attachment 130024 [details]
Proposed Patch

Attachment 130024 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11807440

New failing tests:
editing/selection/select-line-break-with-opposite-directionality.html
Comment 6 Martin Robinson 2012-03-04 09:15:15 PST
Comment on attachment 130024 [details]
Proposed Patch

Is it enough to add it to webkit2_tests_ldadd and not Programs_WebKitTestRunner_LDADD? It's weird that we need to keep adding these libraries to WebKitTestRunner since it doesn't use them directly.
Comment 7 Philippe Normand 2012-03-04 10:02:19 PST
(In reply to comment #6)
> (From update of attachment 130024 [details])
> Is it enough to add it to webkit2_tests_ldadd and not Programs_WebKitTestRunner_LDADD? It's weird that we need to keep adding these libraries to WebKitTestRunner since it doesn't use them directly.

Oh yes, right! For instance the gst libs are in webkit2_tests_ldadd but not in Programs_WebKitTestRunner_LDADD.

Joone, can you double-check the WebKitTestRunner/GNUmakefile.am is not needed please?
Comment 8 Joone Hur 2012-03-04 20:17:24 PST
(In reply to comment #7)
> (In reply to comment #6)
> > (From update of attachment 130024 [details] [details])
> > Is it enough to add it to webkit2_tests_ldadd and not Programs_WebKitTestRunner_LDADD? It's weird that we need to keep adding these libraries to WebKitTestRunner since it doesn't use them directly.
> 
> Oh yes, right! For instance the gst libs are in webkit2_tests_ldadd but not in Programs_WebKitTestRunner_LDADD.
> 
> Joone, can you double-check the WebKitTestRunner/GNUmakefile.am is not needed please?

I've found another link problem in Source/WebKit2/GNUmakefile.am as follows:
--- a/Source/WebKit2/GNUmakefile.am
+++ b/Source/WebKit2/GNUmakefile.am
@@ -1325,8 +1325,7 @@ libWebCoreGtk2_la_CPPFLAGS = \
    $(SQLITE3_CFLAGS) \
    $(UNICODE_CFLAGS) \
    $(XRENDER_CFLAGS) \
-   $(XT_CFLAGS) \
-   $(ZLIB_LIBS)
+   $(XT_CFLAGS)

ZLIB_LIBS is added improperly to here. So if we remove it, we should add it to Programs_WebKitTestRunner_LDADD
Comment 9 Joone Hur 2012-03-04 20:18:43 PST
Created attachment 130049 [details]
Updated Patch2
Comment 10 Martin Robinson 2012-03-04 20:23:19 PST
(In reply to comment #8)

> ZLIB_LIBS is added improperly to here. So if we remove it, we should add it to Programs_WebKitTestRunner_LDADD

I'm not sure I understand. If anything it seems like it should be linked to libWebCore, but not TestRunner, since TestRunner does not use it directly.
Comment 11 Joone Hur 2012-03-04 22:47:35 PST
(In reply to comment #10)
> (In reply to comment #8)
> 
> > ZLIB_LIBS is added improperly to here. So if we remove it, we should add it to Programs_WebKitTestRunner_LDADD
> 
> I'm not sure I understand. If anything it seems like it should be linked to libWebCore, but not TestRunner, since TestRunner does not use it directly.

zlib is not linked with libWebCore, so each executable needs to link with it. Otherwise, zlib should be linked with libWebCore.
Comment 12 Martin Robinson 2012-03-04 22:54:12 PST
(In reply to comment #11)

> zlib is not linked with libWebCore, so each executable needs to link with it. Otherwise, zlib should be linked with libWebCore.

It seems better to link libWebCore with zlib.
Comment 13 Joone Hur 2012-03-05 06:24:01 PST
Created attachment 130111 [details]
Proposed Patch3

I've updated the patch which is simpler than before.
Comment 14 WebKit Review Bot 2012-03-05 08:56:03 PST
Comment on attachment 130111 [details]
Proposed Patch3

Clearing flags on attachment: 130111

Committed r109754: <http://trac.webkit.org/changeset/109754>
Comment 15 WebKit Review Bot 2012-03-05 08:56:12 PST
All reviewed patches have been landed.  Closing bug.