<?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>161900</bug_id>
          
          <creation_ts>2016-09-13 03:38:17 -0700</creation_ts>
          <short_desc>[GTK] [armel] multiple definition of `__sync_add_and_fetch_8&apos;</short_desc>
          <delta_ts>2020-04-13 02:58:31 -0700</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>Other</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=182622</see_also>
          <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>1</everconfirmed>
          <reporter name="Alberto Garcia">berto</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aperez</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>clopez</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1229119</commentid>
    <comment_count>0</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2016-09-13 03:38:17 -0700</bug_when>
    <thetext>2.13.4 fails to build in armel:

/usr/lib/gcc/arm-linux-gnueabi/5/libgcc.a(linux-atomic-64bit.o): In function `__sync_add_and_fetch_8&apos;:
(.text+0x2c0): multiple definition of `__sync_add_and_fetch_8&apos;
../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/Atomics.cpp.o:/«PKGBUILDDIR»/Source/WTF/wtf/Atomics.cpp:64: first defined here
/usr/lib/gcc/arm-linux-gnueabi/5/libgcc.a(linux-atomic-64bit.o): In function `__sync_sub_and_fetch_8&apos;:
(.text+0x32c): multiple definition of `__sync_sub_and_fetch_8&apos;
../../lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/Atomics.cpp.o:/«PKGBUILDDIR»/Source/WTF/wtf/Atomics.cpp:69: first defined here
collect2: error: ld returned 1 exit status

I haven&apos;t tested 2.13.91 yet but that file hasn&apos;t changed so I believe the problem is still there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1229989</commentid>
    <comment_count>1</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2016-09-15 06:13:02 -0700</bug_when>
    <thetext>2.13.92 is also affected.

I tried with a few versions of gcc and clang and __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 doesn&apos;t seem to be defined, however a simple test with clang fails because __sync_add_and_fetch_8 and __sync_sub_and_fetch_8 are builtin functions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1232042</commentid>
    <comment_count>2</comment_count>
      <attachid>289444</attachid>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2016-09-21 05:16:07 -0700</bug_when>
    <thetext>Created attachment 289444
Detect __sync_add_and_fetch_8() at compile time

Here&apos;s what I&apos;m doing in Debian to solve this, instead of checking for 
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1232053</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-09-21 06:43:04 -0700</bug_when>
    <thetext>How is it that it builds at all after removing this file?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1232056</commentid>
    <comment_count>4</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2016-09-21 06:47:28 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; How is it that it builds at all after removing this file?

Because libgcc already provides the same functions</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1287465</commentid>
    <comment_count>5</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2017-03-13 19:46:37 -0700</bug_when>
    <thetext>I noticed openembedded its also carrying this patch downstream with 2.14.5.

So I guess this is an still an issue.

I suggest to add a changelog to the patch and request for review?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1287480</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-03-13 20:28:01 -0700</bug_when>
    <thetext>Please add preprocessor guards inside the .cpp file instead of adding further complexity to the CMake file!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1287564</commentid>
    <comment_count>7</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2017-03-14 01:47:23 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; Please add preprocessor guards inside the .cpp file instead of adding
&gt; further complexity to the CMake file!

You have to find the right guards, though :) The ones that are there don&apos;t solve the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1287608</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-03-14 08:06:00 -0700</bug_when>
    <thetext>More accurately, whoever wants armel support has to find the right guards. :D</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1419915</commentid>
    <comment_count>9</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2018-05-02 16:09:41 -0700</bug_when>
    <thetext>I think that a proper solution for bug #182622 would also
solve this one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1640819</commentid>
    <comment_count>10</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2020-04-13 02:58:31 -0700</bug_when>
    <thetext>No longer a problem</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>289444</attachid>
            <date>2016-09-21 05:16:07 -0700</date>
            <delta_ts>2016-09-21 05:16:07 -0700</delta_ts>
            <desc>Detect __sync_add_and_fetch_8() at compile time</desc>
            <filename>webkit.diff</filename>
            <type>text/plain</type>
            <size>887</size>
            <attacher name="Alberto Garcia">berto</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XVEYvd3RmL0NNYWtlTGlzdHMudHh0IGIvU291cmNlL1dURi93
dGYvQ01ha2VMaXN0cy50eHQKaW5kZXggODY3OTk5ZS4uZWE2OTMyMiAxMDA2NDQKLS0tIGEvU291
cmNlL1dURi93dGYvQ01ha2VMaXN0cy50eHQKKysrIGIvU291cmNlL1dURi93dGYvQ01ha2VMaXN0
cy50eHQKQEAgLTE3MSw3ICsxNzEsNiBAQCBzZXQoV1RGX0hFQURFUlMKIAogc2V0KFdURl9TT1VS
Q0VTCiAgICAgQXNzZXJ0aW9ucy5jcHAKLSAgICBBdG9taWNzLmNwcAogICAgIEJpdFZlY3Rvci5j
cHAKICAgICBDb21waWxhdGlvblRocmVhZC5jcHAKICAgICBDcm9zc1RocmVhZENvcGllci5jcHAK
QEAgLTI3Niw2ICsyNzUsMTUgQEAgaWYgKE5PVCBVU0VfU1lTVEVNX01BTExPQykKICAgICBsaXN0
KEFQUEVORCBXVEZfTElCUkFSSUVTIGJtYWxsb2MpCiBlbmRpZiAoKQogCitmaWxlKFdSSVRFICR7
Q01BS0VfQklOQVJZX0RJUn0vdGVzdF9hdG9taWNzLmNwcAorICAgICAiaW50IG1haW4odm9pZClc
biIKKyAgICAgInsgbG9uZyBsb25nIHggPSAxOyByZXR1cm4gKGludCkgX19zeW5jX2FkZF9hbmRf
ZmV0Y2hfOCgmeCwgMSk7IH1cbiIpCit0cnlfY29tcGlsZShBVE9NSUNTX0JVSUxEX1NVQ0NFRURF
RCAke0NNQUtFX0JJTkFSWV9ESVJ9ICR7Q01BS0VfQklOQVJZX0RJUn0vdGVzdF9hdG9taWNzLmNw
cCkKK2lmIChOT1QgQVRPTUlDU19CVUlMRF9TVUNDRUVERUQpCisgICAgbGlzdChBUFBFTkQgV1RG
X1NPVVJDRVMgQXRvbWljcy5jcHApCitlbmRpZiAoKQorZmlsZShSRU1PVkUgJHtDTUFLRV9CSU5B
UllfRElSfS90ZXN0X2F0b21pY3MuY3BwKQorCiBsaXN0KEFQUEVORCBXVEZfU09VUkNFUwogICAg
IHVuaWNvZGUvaWN1L0NvbGxhdG9ySUNVLmNwcAogKQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>