<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>22811</bug_id>
          
          <creation_ts>2008-12-11 14:27:07 -0800</creation_ts>
          <short_desc>Underlinking in Programs_UnitTests (GTK+ build)</short_desc>
          <delta_ts>2009-02-19 13:43:18 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Adam Williamson">adamw</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>zecke</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>102279</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Williamson">adamw</who>
    <bug_when>2008-12-11 14:27:07 -0800</bug_when>
    <thetext>Since the unit tests were added to the webkit GTK+ build by zecke (in 39082), there&apos;s a linking problem. If you build with -Wl,--as-needed -Wl,--no-undefined (which strictly exposes underlinking issues), the build fails with the following:

gcc -fno-strict-aliasing -O2 -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type -Wformat -Wformat-security -Wno-format-y2k -Wundef -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-unused-parameter -Wno-parentheses -fno-exceptions -fvisibility=hidden -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -O2 -Wl,--as-needed -Wl,--no-undefined -o Programs/.libs/UnitTests WebKit/gtk/tests/Programs_UnitTests-main.o  ./.libs/libwebkit-1.0.so /usr/lib64/libgtk-x11-2.0.so /usr/lib64/libgdk-x11-2.0.so /usr/lib64/libatk-1.0.so /usr/lib64/libgio-2.0.so /usr/lib64/libpangoft2-1.0.so /usr/lib64/libgdk_pixbuf-2.0.so /usr/lib64/libpangocairo-1.0.so /usr/lib64/libcairo.so /usr/lib64/libpango-1.0.so /usr/lib64/libfreetype.so -lz /usr/lib64/libfontconfig.so /usr/lib64/libgobject-2.0.so /usr/lib64/libgmodule-2.0.so /usr/lib64/libglib-2.0.so 
WebKit/gtk/tests/Programs_UnitTests-main.o: In function `main&apos;:
/home/mandrake/rpm/BUILD/WebKit-r39090/WebKit/gtk/tests/main.c:27: undefined reference to `g_thread_init&apos;

The attached patch fixes this - I&apos;m not sure if it&apos;s a correct fix, it may be overbroad, but I couldn&apos;t find a LIBS variable which seemed more correct, so I just added GLOBALDEPS_LIBS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102280</commentid>
    <comment_count>1</comment_count>
      <attachid>25964</attachid>
    <who name="Adam Williamson">adamw</who>
    <bug_when>2008-12-11 14:29:13 -0800</bug_when>
    <thetext>Created attachment 25964
underlink fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110274</commentid>
    <comment_count>2</comment_count>
      <attachid>25964</attachid>
    <who name="Jan Alonzo">jmalonzo</who>
    <bug_when>2009-02-19 12:37:41 -0800</bug_when>
    <thetext>Comment on attachment 25964
underlink fix

&gt; --- WebKit-r39090/GNUmakefile.am	2008-12-07 19:56:15.000000000 -0800
&gt; +++ WebKit-r39090/GNUmakefile.am.new	2008-12-11 13:09:30.000000000 -0800
&gt; @@ -481,7 +481,9 @@
&gt;  
&gt;  Programs_UnitTests_LDADD = \
&gt;  	libwebkit-1.0.la \
&gt; -	$(GTK_LIBS)
&gt; +	$(GTK_LIBS)	\
&gt; +	$(GLOBALDEPS_LIBS)
&gt; +	

Hi! GLOBALDEPS_LIBS is too much. Please link against GLIB_LIBS instead.

Thanks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110276</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Williamson">adamw</who>
    <bug_when>2009-02-19 12:47:52 -0800</bug_when>
    <thetext>Ah, thanks. I figured there was a less huge variable I could use, but couldn&apos;t figure out what it was :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110294</commentid>
    <comment_count>4</comment_count>
    <who name="Christian Dywan">christian</who>
    <bug_when>2009-02-19 13:43:18 -0800</bug_when>
    <thetext>2009-02-19  Christian Dywan  &lt;christian@twotoasts.de&gt;

        Rubber-stamped by Holger Freyther.

        http://bugs.webkit.org/show_bug.cgi?id=22811
        Underlinking in Programs_UnitTests (GTK+ build)

        * GNUmakefile.am: Add GLIB_LIBS to unit test library flags.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>25964</attachid>
            <date>2008-12-11 14:29:13 -0800</date>
            <delta_ts>2008-12-11 14:29:13 -0800</delta_ts>
            <desc>underlink fix</desc>
            <filename>webkit-39090-underlink.patch</filename>
            <type>text/plain</type>
            <size>316</size>
            <attacher name="Adam Williamson">adamw</attacher>
            
              <data encoding="base64">LS0tIFdlYktpdC1yMzkwOTAvR05VbWFrZWZpbGUuYW0JMjAwOC0xMi0wNyAxOTo1NjoxNS4wMDAw
MDAwMDAgLTA4MDAKKysrIFdlYktpdC1yMzkwOTAvR05VbWFrZWZpbGUuYW0ubmV3CTIwMDgtMTIt
MTEgMTM6MDk6MzAuMDAwMDAwMDAwIC0wODAwCkBAIC00ODEsNyArNDgxLDkgQEAKIAogUHJvZ3Jh
bXNfVW5pdFRlc3RzX0xEQUREID0gXAogCWxpYndlYmtpdC0xLjAubGEgXAotCSQoR1RLX0xJQlMp
CisJJChHVEtfTElCUykJXAorCSQoR0xPQkFMREVQU19MSUJTKQorCQogCiAjIEF1dG9nZW5lcmF0
ZWQgc291cmNlcwogQlVJTFRfU09VUkNFUyA6PSBcCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>