Bug 66365 - [EFL] fail to link with symbol uncompress
: [EFL] fail to link with symbol uncompress
Status: RESOLVED FIXED
: WebKit
WebKit EFL
: 528+ (Nightly build)
: Other Linux
: P2 Major
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2011-08-17 00:54 PST by
Modified: 2011-11-23 06:26 PST (History)


Attachments
add -lz (688 bytes, patch)
2011-08-17 01:30 PST, Halton Huo
no flags Review Patch | Details | Formatted Diff | Diff
Add ZLIB as required for libwebcore (716 bytes, patch)
2011-08-18 01:52 PST, Halton Huo
no flags Review Patch | Details | Formatted Diff | Diff
new patch to add zlib when freetype is used (2.00 KB, patch)
2011-08-18 22:59 PST, Halton Huo
no flags Review Patch | Details | Formatted Diff | Diff
patch to add zlib when freetype is used (2.38 KB, patch)
2011-08-18 23:36 PST, Halton Huo
no flags Review Patch | Details | Formatted Diff | Diff
Patch for landing (2.61 KB, patch)
2011-11-23 05:58 PST, Lucas De Marchi
no flags Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2011-08-17 00:54:09 PST
OS: Ubuntu 11.04
Code base: http://svn.webkit.org/repository/webkit/trunk@93032
error log:
$ make -j6 VERBOSE=1
[...]
Linking CXX executable Programs/EWebLauncher
/usr/bin/cmake -E cmake_link_script CMakeFiles/Programs/EWebLauncher.dir/link.txt --verbose=1
/usr/bin/c++   -O3 -DNDEBUG   -L/opt/e/lib -lecore_x -L/opt/e/lib -ledje -L/opt/e/lib -leina -levas -lecore -lecore_file -lecore_evas -ledje -L/opt/e/lib -levas -pthread -L/usr/lib/i386-linux-gnu -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 CMakeFiles/Programs/EWebLauncher.dir/home/halton/work/projects/enlightenment/e/WebKit/Tools/EWebLauncher/main.c.o  -o Programs/EWebLauncher -rdynamic JavaScriptCore/libjavascriptcore_efl.a WebCore/libwebcore_efl.a WebKit/libewebkit.so.0.1.0 -lcairo -lfreetype -lecore_x -ledje -leina -levas -lecore -lecore_file -lecore_evas -ledje -levas -lxml2 -lxslt -lsqlite3 -lglib-2.0 -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 WebCore/libwebcore_efl.a JavaScriptCore/libjavascriptcore_efl.a JavaScriptCore/wtf/libwtf_efl.a -lpthread -licui18n -lxslt -licuuc -lgstapp-0.10 -lgstreamer-0.10 -lgstbase-0.10 -lgstinterfaces-0.10 -lgstpbutils-0.10 -lgstvideo-0.10 -lgstreamer-0.10 -lgstbase-0.10 -lgstinterfaces-0.10 -lgstpbutils-0.10 -lgstvideo-0.10 -lcairo -lfreetype -lecore_x -leina -levas -lecore -lecore_file -ledje -lecore_evas -lxml2 -lsqlite3 -lfontconfig -lpng -ljpeg -ldl -lglib-2.0 -lgobject-2.0 -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -Wl,-rpath,/home/halton/work/projects/enlightenment/e/WebKit/build/WebKit 
/usr/bin/ld.gold.real: WebKit/libewebkit.so.0.1.0: error: undefined reference to 'uncompress'
collect2: ld returned 1 exit status
------- Comment #1 From 2011-08-17 01:30:51 PST -------
Created an attachment (id=104157) [details]
add -lz 

add -lz can fix this bug, please review.
------- Comment #2 From 2011-08-17 21:30:54 PST -------
WebKit-EFL succeeded to be built on r93032

You are able to see the build result below url,
http://build.webkit.org/builders/EFL%20Linux%20Release%20%28Build%29/builds/19775 

In addition, WebKit EFL is built on latest WebKit trunk successfully.

Did you build WebKit-EFL according to instruction below ?
http://trac.webkit.org/wiki/EFLWebKit
------- Comment #3 From 2011-08-17 21:53:00 PST -------
(In reply to comment #2)
> WebKit-EFL succeeded to be built on r93032
> 
> You are able to see the build result below url,
> http://build.webkit.org/builders/EFL%20Linux%20Release%20%28Build%29/builds/19775 
> 
> In addition, WebKit EFL is built on latest WebKit trunk successfully.
> 
> Did you build WebKit-EFL according to instruction below ?
> http://trac.webkit.org/wiki/EFLWebKit

Yes. And it is Ubnutu 11.04 , I've tried on several boxes, all has this problem.
------- Comment #4 From 2011-08-17 22:02:11 PST -------
(In reply to comment #3)
> (In reply to comment #2)
> > WebKit-EFL succeeded to be built on r93032
> > 
> > You are able to see the build result below url,
> > http://build.webkit.org/builders/EFL%20Linux%20Release%20%28Build%29/builds/19775 
> > 
> > In addition, WebKit EFL is built on latest WebKit trunk successfully.
> > 
> > Did you build WebKit-EFL according to instruction below ?
> > http://trac.webkit.org/wiki/EFLWebKit
> 
> Yes. And it is Ubnutu 11.04 , I've tried on several boxes, all has this problem.

It looks reasonable for me.
WOFFFileFormat.cpp use uncompress() of libz(for WOFF support)

In case of build bot, some packages in build bot may include it.
(On my pc, cairo.pc(1.8.10), libpng.pc(1.2.42) include it)
------- Comment #5 From 2011-08-17 22:53:12 PST -------
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > WebKit-EFL succeeded to be built on r93032
> > > 
> > > You are able to see the build result below url,
> > > http://build.webkit.org/builders/EFL%20Linux%20Release%20%28Build%29/builds/19775 
> > > 
> > > In addition, WebKit EFL is built on latest WebKit trunk successfully.
> > > 
> > > Did you build WebKit-EFL according to instruction below ?
> > > http://trac.webkit.org/wiki/EFLWebKit
> > 
> > Yes. And it is Ubnutu 11.04 , I've tried on several boxes, all has this problem.
> 
> It looks reasonable for me.
> WOFFFileFormat.cpp use uncompress() of libz(for WOFF support)
> 
> In case of build bot, some packages in build bot may include it.
> (On my pc, cairo.pc(1.8.10), libpng.pc(1.2.42) include it)


I also using Ubuntu 11.04. There is no build break. It looks some packages include it as Ryuan said. If so, it seems to me it is better to add libz to linking library explicitly.

To add new package is not simple in WebKit EFL. First, you have to make FindXXX.cmake file for new library. Then, you have to add a code to find the library to Source/cmake/OptionEfl.cmake file as below,

FIND_PACKAGE(Cairo 1.6 REQUIRED)
FIND_PACKAGE(EFL REQUIRED)

And then, you're able to use XXX_LIBRARIES macro in CMakeListEfl.txt like other libraries.

BTW, I'm still wondering why your development environment make this linking error. We don't have this error so far. You built WebKit-EFL according to build instruction I mention, right ?
------- Comment #6 From 2011-08-17 23:05:00 PST -------
I find zlib usage in CMakeListEfl.txt. ZLIB_LIBRARIES is used by curl network backend. However, we're using libsoup for network backend. If you want to add zlib, I think it is better to use ZLIB_LIBRARIES.
------- Comment #7 From 2011-08-18 01:28:34 PST -------
(In reply to comment #6)
> I find zlib usage in CMakeListEfl.txt. ZLIB_LIBRARIES is used by curl network backend. However, we're using libsoup for network backend. If you want to add zlib, I think it is better to use ZLIB_LIBRARIES.

Kim, I think I'm using libsoup rather than curl.
$ ldd WebKit/libewebkit.so.0.1.0 |grep soup
    libsoup-2.4.so.1 => /usr/lib/libsoup-2.4.so.1 (0xb5e4d000)

And seems libsoup does not depend on libz
$ pkg-config --libs libsoup-2.4
-pthread -L/usr/lib/i386-linux-gnu -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0

Actually I go through all dependencies of libewebkit.so, no one will contain -lz if we use "pkg-config --libs". While "pkg-config --libs --static" will give -lz.

So seems zlib need to be added for the libsoup backend also. Is that correct?
If so, I can new patch with your suggestion as comment #5.
------- Comment #8 From 2011-08-18 01:52:50 PST -------
Created an attachment (id=104314) [details]
Add ZLIB as required for libwebcore

new patch, please review.

Since zlib is needed whatever for libsoup or libcurl backend, so add it globally.
------- Comment #9 From 2011-08-18 01:55:28 PST -------
uncompress() function is used by WOFFFileFormat.cpp, which is used by freetype. So, if we need to add zlib dependency, I think we add it when freetype only is enabled.

For example,

= Source/cmake/OptionEfl.cmake =

  IF (FONT_BACKEND STREQUAL "freetype")
    FIND_PACKAGE(Freetype 9.0 REQUIRED)
    FIND_PACKAGE(ZLIB REQUIRED)
    SET(WTF_USE_FREETYPE 1)
    ADD_DEFINITIONS(-DWTF_USE_FREETYPE=1)
  ELSE ()

= Source/WebCore/CMakeListEfl.txt =

  IF (WTF_USE_FREETYPE)
    LIST(APPEND WebCore_INCLUDE_DIRECTORIES
      "${WEBCORE_DIR}/platform/graphics/freetype"
    )
    LIST(APPEND WebCore_SOURCES
      platform/graphics/WOFFFileFormat.cpp
      platform/graphics/freetype/FontCacheFreeType.cpp
      platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp
      platform/graphics/freetype/FontPlatformDataFreeType.cpp
      platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp
      platform/graphics/freetype/SimpleFontDataFreeType.cpp
    )

   LIST(APPEND WebCore_LIBRARIES
      ${ZLIB_LIBRARIES}
    )
  ENDIF ()
------- Comment #10 From 2011-08-18 01:57:22 PST -------
(From update of attachment 104314 [details])
Informal r-. Missing ChangeLog. You should read http://www.webkit.org/coding/contributing.html first before making a patch.
------- Comment #11 From 2011-08-18 22:59:29 PST -------
Created an attachment (id=104464) [details]
new patch to add zlib when freetype is used

rework patch with comment #9 and #10.
------- Comment #12 From 2011-08-18 23:02:58 PST -------
(From update of attachment 104464 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=104464&action=review

> ChangeLog:7
> +

Please add description about this patch

> Source/WebCore/ChangeLog:7
> +

ditto.
------- Comment #13 From 2011-08-18 23:36:12 PST -------
Created an attachment (id=104467) [details]
patch to add zlib when freetype is used

rework patch as comment #11.
------- Comment #14 From 2011-08-18 23:38:37 PST -------
(From update of attachment 104467 [details])
LGTM.
------- Comment #15 From 2011-09-21 12:52:00 PST -------
Looks good. Thanks.


CC'ing reviewers
------- Comment #16 From 2011-11-03 18:07:12 PST -------
*** Bug 71482 has been marked as a duplicate of this bug. ***
------- Comment #17 From 2011-11-23 05:58:05 PST -------
Created an attachment (id=116346) [details]
Patch for landing
------- Comment #18 From 2011-11-23 06:26:00 PST -------
(From update of attachment 116346 [details])
Clearing flags on attachment: 116346

Committed r101079: <http://trac.webkit.org/changeset/101079>
------- Comment #19 From 2011-11-23 06:26:06 PST -------
All reviewed patches have been landed.  Closing bug.