<?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>16406</bug_id>
          
          <creation_ts>2007-12-11 19:16:46 -0800</creation_ts>
          <short_desc>[Gtk] JavaScriptCore needs -lpthread</short_desc>
          <delta_ts>2007-12-13 11:38:40 -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>All</rep_platform>
          <op_sys>All</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>
          
          <blocked>16411</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Seo Sanghyeon">sanxiyn</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>alp</cc>
    
    <cc>mh+webkit</cc>
    
    <cc>mrowe</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>63985</commentid>
    <comment_count>0</comment_count>
    <who name="Seo Sanghyeon">sanxiyn</who>
    <bug_when>2007-12-11 19:16:46 -0800</bug_when>
    <thetext>JavaScriptCore build is missing -lpthread. This results in a build failure like:

tmp/collector.o: In function `KJS::currentThreadStackBase()&apos;:
collector.cpp:(.text+0x203): undefined reference to `pthread_getattr_np&apos;
collector.cpp:(.text+0x21b): undefined reference to `pthread_attr_getstack&apos;
tmp/collector.o: In function `KJS::Collector::markCurrentThreadConservatively()&apos;:
collector.cpp:(.text+0x825): undefined reference to `pthread_getattr_np&apos;
collector.cpp:(.text+0x83d): undefined reference to `pthread_attr_getstack&apos;
collect2: ld returned 1 exit status

In Gtk port, JavaScriptCore is built using compiler flags from icu-config. Normally, icu-config output includes -lpthread, like:

-lpthread -lm -L/usr/lib -licui18n -licuuc -licudata -lpthread -lm

But one doesn&apos;t need to link against libpthread when one is using only ICU functions. So as a part of general campaign to reduce spurious library dependency, Debian&apos;s icu-config doesn&apos;t output -lpthread starting from 3.8-5. Then the output looks like:

-lm -L/usr/lib -licui18n -licuuc -licudata -lm</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63986</commentid>
    <comment_count>1</comment_count>
      <attachid>17858</attachid>
    <who name="Seo Sanghyeon">sanxiyn</who>
    <bug_when>2007-12-11 19:24:37 -0800</bug_when>
    <thetext>Created attachment 17858
Include -lpthread</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63988</commentid>
    <comment_count>2</comment_count>
      <attachid>17858</attachid>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-12-11 19:50:46 -0800</bug_when>
    <thetext>Comment on attachment 17858
Include -lpthread

You should set the review flag to ? if you&apos;d like your patch looked at for review.  You should also include a description of your change in the ChangeLog at JavaScriptCore/ChangeLog.  See http://webkit.org/coding/contributing.html for more info.

The change looks fine to me.  It&apos;s not great to always add -lpthread as some platforms may not use pthreads, but as JavaScriptCore makes the assumption that they do when building multi-threaded I think it&apos;s fine for the meantime.

Marking as r- for now pending a ChangeLog entry.  Thanks for the patch!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63991</commentid>
    <comment_count>3</comment_count>
      <attachid>17859</attachid>
    <who name="Alp Toker">alp</who>
    <bug_when>2007-12-11 20:20:17 -0800</bug_when>
    <thetext>Created attachment 17859
Remove kjs pthread dependency

Proposed fix (needs review from someone who knows the collector and what correct behaviour is when threading is disabled)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63992</commentid>
    <comment_count>4</comment_count>
      <attachid>17859</attachid>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-12-11 21:06:58 -0800</bug_when>
    <thetext>Comment on attachment 17859
Remove kjs pthread dependency

That will prevent the stack from being scanned at all, which is really bad.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63995</commentid>
    <comment_count>5</comment_count>
    <who name="Mike Hommey">mh+webkit</who>
    <bug_when>2007-12-11 22:25:33 -0800</bug_when>
    <thetext>Check out bug #15118, which is exactly the same issue, except that in the end, I couldn&apos;t reproduce with the icu not having -lpthread in its -config script.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63996</commentid>
    <comment_count>6</comment_count>
    <who name="Mike Hommey">mh+webkit</who>
    <bug_when>2007-12-11 22:27:49 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; Check out bug #15118, which is exactly the same issue, except that in the end,
&gt; I couldn&apos;t reproduce with the icu not having -lpthread in its -config script.

It could actually be reproduced by debian buildds...

http://buildd.debian.org/fetch.cgi?pkg=webkit;ver=0%7Esvn27674-1;arch=sparc;stamp=1197008842</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64032</commentid>
    <comment_count>7</comment_count>
      <attachid>17864</attachid>
    <who name="Alp Toker">alp</who>
    <bug_when>2007-12-12 09:15:55 -0800</bug_when>
    <thetext>Created attachment 17864
Prospective build fix

This patch links to pthread only when not building on Windows, and does it in JavaScriptCore.pri rather than testkjs.pro as proposed previously.

Untested since I can&apos;t reproduce the build breakage. Can someone try this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64098</commentid>
    <comment_count>8</comment_count>
      <attachid>17864</attachid>
    <who name="Alp Toker">alp</who>
    <bug_when>2007-12-13 11:37:42 -0800</bug_when>
    <thetext>Comment on attachment 17864
Prospective build fix

Build fix; tested and works.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64099</commentid>
    <comment_count>9</comment_count>
    <who name="Alp Toker">alp</who>
    <bug_when>2007-12-13 11:38:40 -0800</bug_when>
    <thetext>Landed in r28692.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>17858</attachid>
            <date>2007-12-11 19:24:37 -0800</date>
            <delta_ts>2007-12-11 20:20:17 -0800</delta_ts>
            <desc>Include -lpthread</desc>
            <filename>lpthread.patch</filename>
            <type>text/plain</type>
            <size>480</size>
            <attacher name="Seo Sanghyeon">sanxiyn</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL2tqcy90ZXN0a2pzLnBybwo9PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBKYXZh
U2NyaXB0Q29yZS9ranMvdGVzdGtqcy5wcm8JKHJldmlzaW9uIDI4NjM2KQorKysgSmF2YVNjcmlw
dENvcmUva2pzL3Rlc3RranMucHJvCSh3b3JraW5nIGNvcHkpCkBAIC0xMCw3ICsxMCw3IEBACiAj
cXQtcG9ydDpMSUJTICs9IC1MJCRPVVRQVVRfRElSL2xpYiAtbFF0V2ViS2l0CiBndGstcG9ydCB7
CiAgICAgUU1BS0VfQ1hYRkxBR1MgKz0gJCRzeXN0ZW0oaWN1LWNvbmZpZyAtLWNwcGZsYWdzKQot
ICAgIExJQlMgKz0gJCRzeXN0ZW0oaWN1LWNvbmZpZyAtLWxkZmxhZ3MpCisgICAgTElCUyArPSAk
JHN5c3RlbShpY3UtY29uZmlnIC0tbGRmbGFncykgLWxwdGhyZWFkCiB9CiBRTUFLRV9SUEFUSERJ
UiArPSAkJE9VVFBVVF9ESVIvbGliCiAK
</data>
<flag name="review"
          id="7709"
          type_id="1"
          status="-"
          setter="mrowe"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>17859</attachid>
            <date>2007-12-11 20:20:17 -0800</date>
            <delta_ts>2007-12-11 21:06:58 -0800</delta_ts>
            <desc>Remove kjs pthread dependency</desc>
            <filename>thread-dep.patch</filename>
            <type>text/plain</type>
            <size>1791</size>
            <attacher name="Alp Toker">alp</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBKYXZhU2NyaXB0
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDI4NjM3KQorKysgSmF2YVNjcmlwdENvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTggQEAKKzIwMDctMTItMTEgIEFscCBUb2tl
ciAgPGFscEBhdG9rZXIuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEp
LgorCisgICAgICAgIERlYmlhbiBHTlUvTGludXggJ3Vuc3RhYmxlJyBidWlsZCBmaXguCisKKyAg
ICAgICAgbWFya0N1cnJlbnRUaHJlYWRDb25zZXJ2YXRpdmVseSgpIHNob3VsZCBiZSBhIG5vLW9w
IHdoZW4gdGhyZWFkaW5nIGlzCisgICAgICAgIGRpc2FibGVkLgorCisgICAgICAgIExvb2tzIGxp
a2UgYW4gdW5pbnRlbnRpb25hbCBkZXBlbmRlbmN5IG9uIGxpYnB0aHJlYWQgd2FzIGludHJvZHVj
ZWQgYXQKKyAgICAgICAgc29tZSBwb2ludC4KKworICAgICAgICAqIGtqcy9jb2xsZWN0b3IuY3Bw
OgorICAgICAgICAoS0pTOjpDb2xsZWN0b3I6Om1hcmtDdXJyZW50VGhyZWFkQ29uc2VydmF0aXZl
bHkpOgorCiAyMDA3LTEyLTExICBHZW9mZnJleSBHYXJlbiAgPGdnYXJlbkBhcHBsZS5jb20+CiAK
ICAgICAgICAgUmV2aWV3ZWQgYnkgU2FtIFdlaW5pZy4KSW5kZXg6IEphdmFTY3JpcHRDb3JlL2tq
cy9jb2xsZWN0b3IuY3BwCj09PT09PT09PT09PT09PT09PT09PT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DYgKzU1Nyw3IEBA
IHZvaWQgQ29sbGVjdG9yOjptYXJrQ3VycmVudFRocmVhZENvbnNlcnYKICAgICB2b2lkKiBzdGFj
a0Jhc2UgPSBjdXJyZW50VGhyZWFkU3RhY2tCYXNlKCk7CiAKICAgICBtYXJrU3RhY2tPYmplY3Rz
Q29uc2VydmF0aXZlbHkoc3RhY2tQb2ludGVyLCBzdGFja0Jhc2UpOworI2VuZGlmCiB9CiAKICNp
ZiBVU0UoTVVMVElQTEVfVEhSRUFEUykK
</data>
<flag name="review"
          id="7710"
          type_id="1"
          status="-"
          setter="mrowe"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>17864</attachid>
            <date>2007-12-12 09:15:55 -0800</date>
            <delta_ts>2007-12-13 11:37:42 -0800</delta_ts>
            <desc>Prospective build fix</desc>
            <filename>pthread-link.patch</filename>
            <type>text/plain</type>
            <size>1158</size>
            <attacher name="Alp Toker">alp</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBKYXZhU2NyaXB0
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDI4NjUzKQorKysgSmF2YVNjcmlwdENvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTMgQEAKKzIwMDctMTItMTIgIEFscCBUb2tl
ciAgPGFscEBhdG9rZXIuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEp
LgorCisgICAgICAgIGh0dHA6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTE2NDA2
CisgICAgICAgIFtHdGtdIEphdmFTY3JpcHRDb3JlIG5lZWRzIC1scHRocmVhZAorCisgICAgICAg
IExpbmsgdG8gcHRocmVhZCBvbiBub24tV2luZG93cyBwbGF0Zm9ybXMgdW50aWwgdGhpcyBkZXBl
bmRlbmN5IGlzCisgICAgICAgIHJlbW92ZWQgZnJvbSBKU0MuCisKIDIwMDctMTItMTEgIEdlb2Zm
cmV5IEdhcmVuICA8Z2dhcmVuQGFwcGxlLmNvbT4KIAogICAgICAgICBSZXZpZXdlZCBieSBTYW0g
V2VpbmlnLgpJbmRleDogSmF2YVNjcmlwdENvcmUvSmF2YVNjcmlwdENvcmUucHJpCj09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT0KLS0tIEphdmFTY3JpcHRDb3JlL0phdmFTY3JpcHRDb3JlLnByaQkocmV2aXNpb24gMjg2NTMp
CisrKyBKYXZhU2NyaXB0Q29yZS9KYXZhU2NyaXB0Q29yZS5wcmkJKHdvcmtpbmcgY29weSkKQEAg
LTksNiArOSwxMCBAQCBxdC1wb3J0OklOQ0xVREVQQVRIICs9ICQkUFdEL2JpbmRpbmdzL3F0CiBx
dC1wb3J0OkRFRklORVMgKz0gQlVJTERJTkdfUVRfXwogZ3RrLXBvcnQ6REVGSU5FUyArPSBCVUlM
RElOR19HVEtfXwogCisjIGh0dHA6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTE2
NDA2CisjIFtHdGtdIEphdmFTY3JpcHRDb3JlIG5lZWRzIC1scHRocmVhZAorZ3RrLXBvcnQ6IXdp
bjMyLSo6TElCUyArPSAtbHB0aHJlYWQKKwogd2luMzItbXN2Yyo6IElOQ0xVREVQQVRIICs9ICQk
UFdEL29zLXdpbjMyCiAKIGlzRW1wdHkoR0VORVJBVEVEX1NPVVJDRVNfRElSKTpHRU5FUkFURURf
U09VUkNFU19ESVIgPSB0bXAK
</data>
<flag name="review"
          id="7718"
          type_id="1"
          status="+"
          setter="alp"
    />
          </attachment>
      

    </bug>

</bugzilla>