<?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>159083</bug_id>
          
          <creation_ts>2016-06-23 23:47:34 -0700</creation_ts>
          <short_desc>THUMB2 support not correctly detected on Fedora with GCC 6.1.</short_desc>
          <delta_ts>2016-07-13 03:27:16 -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>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=159707</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>
          <dependson>159408</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tomas Popela">tpopela</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>benjamin</cc>
    
    <cc>cdumez</cc>
    
    <cc>clopez</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>commit-queue</cc>
    
    <cc>ossy</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1205040</commentid>
    <comment_count>0</comment_count>
    <who name="Tomas Popela">tpopela</who>
    <bug_when>2016-06-23 23:47:34 -0700</bug_when>
    <thetext>After http://trac.webkit.org/changeset/202214 the build fails with:

    In file included from /home/fedora/tpopela/rpmbuild/BUILD/webkitgtk-2.13.2/Source/JavaScriptCore/assembler/MacroAssemblerARM.h:34:0,
                     from /home/fedora/tpopela/rpmbuild/BUILD/webkitgtk-2.13.2/Source/JavaScriptCore/assembler/MacroAssembler.h:40,
                     from /home/fedora/tpopela/rpmbuild/BUILD/webkitgtk-2.13.2/Source/JavaScriptCore/assembler/LinkBuffer.h:39,
                     from /home/fedora/tpopela/rpmbuild/BUILD/webkitgtk-2.13.2/Source/JavaScriptCore/assembler/LinkBuffer.cpp:27:
    /home/fedora/tpopela/rpmbuild/BUILD/webkitgtk-2.13.2/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h: In instantiation of ‘void JSC::AbstractMacroAssembler&lt;AssemblerType, MacroAssemblerType&gt;::emitNops(size_t) [with AssemblerType = JSC::ARMAssembler; MacroAssemblerType = JSC::MacroAssemblerARM; size_t = unsigned int]’:
    /home/fedora/tpopela/rpmbuild/BUILD/webkitgtk-2.13.2/Source/JavaScriptCore/assembler/LinkBuffer.cpp:232:50:   required from here
    /home/fedora/tpopela/rpmbuild/BUILD/webkitgtk-2.13.2/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h:1049:32: error: ‘fillNops’ is not a member of ‘JSC::ARMAssembler’
             AssemblerType::fillNops(static_cast&lt;char*&gt;(buffer.data()) + startCodeSize, memoryToFillWithNopsInBytes, isCopyingToExecutableMemory);


There is an implementation of fillNops missing in the ARMAssembler.h</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1205508</commentid>
    <comment_count>1</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2016-06-27 03:16:28 -0700</bug_when>
    <thetext>The GTK+ ARM bot (ARMv7) seems happy. https://build.webkit.org/builders/GTK%20Linux%20ARM%20Release?numbuilds=50

And it seems there is also an implementation of fillNops in ARMv7Assembler.h

Is this an issue that happens only with ARMv6 ?
In that case, does this still happens if the JIT is disabled (-DENABLE_JIT=OFF) ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1206007</commentid>
    <comment_count>2</comment_count>
    <who name="Tomas Popela">tpopela</who>
    <bug_when>2016-06-28 05:20:44 -0700</bug_when>
    <thetext>Ok, the problem here is the detection of THUMB2 support. Our code is based on __thumb2__ or __thumb__ defines. This does work on Debian:

$ gcc -dM -E - &lt; /dev/null | grep -i thumb
#define __thumb2__ 1
#define __THUMB_INTERWORK__ 1
#define __thumb__ 1
#define __ARM_ARCH_ISA_THUMB 2
#define __THUMBEL__ 1

but does not on Fedora 24 with GCC 6.1. :

$ gcc -dM -E - &lt; /dev/null | grep -i thumb
#define __THUMB_INTERWORK__ 1
#define __ARM_ARCH_ISA_THUMB 2

as the previously mentions defines are not presented there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1206009</commentid>
    <comment_count>3</comment_count>
      <attachid>282244</attachid>
    <who name="Tomas Popela">tpopela</who>
    <bug_when>2016-06-28 05:27:04 -0700</bug_when>
    <thetext>Created attachment 282244
Correct the THUMB2 detection on Fedora with gcc 6.1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1206016</commentid>
    <comment_count>4</comment_count>
      <attachid>282244</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-06-28 06:25:38 -0700</bug_when>
    <thetext>Comment on attachment 282244
Correct the THUMB2 detection on Fedora with gcc 6.1.

Clearing flags on attachment: 282244

Committed r202560: &lt;http://trac.webkit.org/changeset/202560&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1206017</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-06-28 06:25:42 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1207620</commentid>
    <comment_count>6</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2016-07-04 01:48:14 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Ok, the problem here is the detection of THUMB2 support. Our code is based
&gt; on __thumb2__ or __thumb__ defines. This does work on Debian:
&gt; 
&gt; $ gcc -dM -E - &lt; /dev/null | grep -i thumb
&gt; #define __thumb2__ 1
&gt; #define __THUMB_INTERWORK__ 1
&gt; #define __thumb__ 1
&gt; #define __ARM_ARCH_ISA_THUMB 2
&gt; #define __THUMBEL__ 1
&gt; 
&gt; but does not on Fedora 24 with GCC 6.1. :
&gt; 
&gt; $ gcc -dM -E - &lt; /dev/null | grep -i thumb
&gt; #define __THUMB_INTERWORK__ 1
&gt; #define __ARM_ARCH_ISA_THUMB 2
&gt; 
&gt; as the previously mentions defines are not presented there.


(In reply to comment #4)
&gt; Comment on attachment 282244 [details]
&gt; Correct the THUMB2 detection on Fedora with gcc 6.1.
&gt; 
&gt; Clearing flags on attachment: 282244
&gt; 
&gt; Committed r202560: &lt;http://trac.webkit.org/changeset/202560&gt;

This change is incorrect, because it enables thumb2 instruction set 
on ARMv7 by default and doesn&apos;t work with toolchain uses -marm option:
https://build.webkit.org/builders/JSCOnly%20Linux%20ARMv7%20Traditional%20Release/builds/1514

You are right, r202214 broke the build with ARM instruction set -
ARM traditional in WebKit terminology - because of missing fillNops
implementation in ARMAssembler.h. ARMv7Assembler.h is responsible
for ARMv7 with Thumb2 instruction set. note: ARMv6 doesn&apos;t build
with enabled JIT long long time ago, at least 2.5 years ago,
see bug125581 and bug141288 for details.

The thumb2 detection in Platform.h was correct, but it seem your
toolchain was changed for some reason. The old one was built to use -mthumb,
but the new one was built to use -marm as default instruction set.

You can check your toolchain default settings with this command:
gcc -Q --help=target | grep -i &quot;\(marm\|mthumb\)&quot;

result if you have thumb2 toolchain:
  -marm                                 [disabled]
  -mthumb                               [enabled]
  -mthumb-interwork                     [enabled]

result if you have ARM toolchain:
  -marm                                 [enabled]
  -mthumb                               [disabled]
  -mthumb-interwork                     [enabled]

I&apos;m going to fix the ARM traditional build soon in a separated bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1209054</commentid>
    <comment_count>7</comment_count>
    <who name="Tomas Popela">tpopela</who>
    <bug_when>2016-07-08 04:19:45 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; You can check your toolchain default settings with this command:
&gt; gcc -Q --help=target | grep -i &quot;\(marm\|mthumb\)&quot;
&gt;
&gt; result if you have thumb2 toolchain:
&gt;   -marm                                 [disabled]
&gt;   -mthumb                               [enabled]
&gt;   -mthumb-interwork                     [enabled]
&gt; 
&gt; result if you have ARM toolchain:
&gt;   -marm                                 [enabled]
&gt;   -mthumb                               [disabled]
&gt;   -mthumb-interwork                     [enabled]
&gt; 
&gt; I&apos;m going to fix the ARM traditional build soon in a separated bug.

Sorry Ossy about the breakage and thank you for working on the fix! It is as you said the thumb2 toolchain is indeed disabled and the ARM one enabled.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>282244</attachid>
            <date>2016-06-28 05:27:04 -0700</date>
            <delta_ts>2016-06-28 06:25:38 -0700</delta_ts>
            <desc>Correct the THUMB2 detection on Fedora with gcc 6.1.</desc>
            <filename>bug-159083-20160628142647.patch</filename>
            <type>text/plain</type>
            <size>1475</size>
            <attacher name="Tomas Popela">tpopela</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjAyNTU5CmRpZmYgLS1naXQgYS9Tb3VyY2UvV1RGL0NoYW5n
ZUxvZyBiL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCmluZGV4IDAxMDExZTAxNWI1MTNmMzM5MjZmMTM2
OWQ1YjE1NDVjODRmNmYzMTEuLjAzMGZlNDA4NTFlYzYwNDhkNzgxYjQ2MGRiYjMzNTNlMmVlZGFk
MTMgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9XVEYvQ2hh
bmdlTG9nCkBAIC0xLDMgKzEsMTcgQEAKKzIwMTYtMDYtMjggIFRvbWFzIFBvcGVsYSAgPHRwb3Bl
bGFAcmVkaGF0LmNvbT4KKworICAgICAgICBUSFVNQjIgc3VwcG9ydCBub3QgY29ycmVjdGx5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