<?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>17923</bug_id>
          
          <creation_ts>2008-03-18 15:03:30 -0700</creation_ts>
          <short_desc>ARM platform endian defines inaccurate in JavaScriptCore</short_desc>
          <delta_ts>2008-03-20 07:34:13 -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>528+ (Nightly build)</version>
          <rep_platform>Other</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>
          <dependson>15416</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Krause">david.krause</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ddkilzer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>74326</commentid>
    <comment_count>0</comment_count>
    <who name="David Krause">david.krause</who>
    <bug_when>2008-03-18 15:03:30 -0700</bug_when>
    <thetext>As part of bug 15416 (http://bugs.webkit.org/show_bug.cgi?id=15416), a change was made to JavaScriptCore/wtf/Platform.h that affected when the WTF_PLATFORM_MIDDLE_ENDIAN define is set.  The specific changeset is http://trac.webkit.org/projects/webkit/changeset/31115.

Basically, some ARM platforms that define __ARMEL__ still need the MIDDLE_ENDIAN define.  Specifically, it affects those little-endian ARM platforms using FPA floating-point.  See comment on original bug for more details at http://bugs.webkit.org/show_bug.cgi?id=15416#c15.

The 31115 change causes JavaScript issues on those ARM platforms that no longer have the MIDDLE_ENDIAN define, but need it.  The issue seen is that the JavaScript dtoa function falls into an infinite loop.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74327</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-03-18 15:08:24 -0700</bug_when>
    <thetext>How can the other platforms that need MIDDLE_ENDIAN be detected?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74328</commentid>
    <comment_count>2</comment_count>
    <who name="David Krause">david.krause</who>
    <bug_when>2008-03-18 15:11:53 -0700</bug_when>
    <thetext>The only recommendation I have was in my previous comment.  I am not sure which defines are present for VFP floating-point, but for FPA the following works:

#elif !defined(__ARM_EABI__) &amp;&amp; !defined(__ARMEB__) &amp;&amp; defined(__ARMEL__) &amp;&amp;
defined(__SOFTFP__)

Right now, I only have access to my version of gcc, which sets __ARMEL__ and __SOFTFP__ for FPA.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74329</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-03-18 15:13:35 -0700</bug_when>
    <thetext>Is there not an __ARMEM__ macro for middle endian systems?

Or is this sufficient (per Bug 15416 Comment #15)?

#elif !defined(__ARM_EABI__) &amp;&amp; !defined(__ARMEB__) &amp;&amp; defined(__ARMEL__) &amp;&amp; defined(__SOFTFP__)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74331</commentid>
    <comment_count>4</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-03-18 15:17:25 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; The only recommendation I have was in my previous comment.  I am not sure which
&gt; defines are present for VFP floating-point, but for FPA the following works:
&gt; 
&gt; #elif !defined(__ARM_EABI__) &amp;&amp; !defined(__ARMEB__) &amp;&amp; defined(__ARMEL__) &amp;&amp;
&gt; defined(__SOFTFP__)
&gt; 
&gt; Right now, I only have access to my version of gcc, which sets __ARMEL__ and
&gt; __SOFTFP__ for FPA.

If this is sufficient, please post a patch with changelog to this bug.  Thanks!

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74332</commentid>
    <comment_count>5</comment_count>
    <who name="David Krause">david.krause</who>
    <bug_when>2008-03-18 15:27:22 -0700</bug_when>
    <thetext>No __ARMEM__ macro exists.  I&apos;ll post a patch as requested.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74431</commentid>
    <comment_count>6</comment_count>
      <attachid>19884</attachid>
    <who name="David Krause">david.krause</who>
    <bug_when>2008-03-19 06:44:22 -0700</bug_when>
    <thetext>Created attachment 19884
Proposed patch

Found a VFP toolchain, and it also defines __ARMEL__ and __SOFTFP__, so my earlier proposal would not have been appropriate.  __VFP_FP__ is the define that indicates VFP support, which should not use MIDDLE_ENDIAN.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74517</commentid>
    <comment_count>7</comment_count>
      <attachid>19884</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-03-20 06:52:34 -0700</bug_when>
    <thetext>Comment on attachment 19884
Proposed patch

Looks good!  r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74521</commentid>
    <comment_count>8</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-03-20 07:34:13 -0700</bug_when>
    <thetext>Committed revision 31176.

</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>19884</attachid>
            <date>2008-03-19 06:44:22 -0700</date>
            <delta_ts>2008-03-20 06:52:34 -0700</delta_ts>
            <desc>Proposed patch</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>1236</size>
            <attacher name="David Krause">david.krause</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYktpdC9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT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93dGYvUGxhdGZvcm0uaAkod29ya2luZyBjb3B5KQpAQCAtMTQ4LDcg
KzE0OCw3IEBACiAjZGVmaW5lIFdURl9QTEFURk9STV9BUk0gMQogI2lmIGRlZmluZWQoX19BUk1F
Ql9fKQogI2RlZmluZSBXVEZfUExBVEZPUk1fQklHX0VORElBTiAxCi0jZWxpZiAhZGVmaW5lZChf
X0FSTV9FQUJJX18pICYmICFkZWZpbmVkKF9fQVJNRUJfXykgJiYgIWRlZmluZWQoX19BUk1FTF9f
KQorI2VsaWYgIWRlZmluZWQoX19BUk1fRUFCSV9fKSAmJiAhZGVmaW5lZChfX0FSTUVCX18pICYm
ICFkZWZpbmVkKF9fVkZQX0ZQX18pCiAjZGVmaW5lIFdURl9QTEFURk9STV9NSURETEVfRU5ESUFO
IDEKICNlbmRpZgogI2lmICFkZWZpbmVkKF9fQVJNX0VBQklfXykK
</data>
<flag name="review"
          id="8700"
          type_id="1"
          status="+"
          setter="ddkilzer"
    />
          </attachment>
      

    </bug>

</bugzilla>