<?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>157364</bug_id>
          
          <creation_ts>2016-05-04 15:48:30 -0700</creation_ts>
          <short_desc>Enable Dwarf2 debug information in offline assembler for clang compiler</short_desc>
          <delta_ts>2016-05-09 07:56:24 -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>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Saboff">msaboff</reporter>
          <assigned_to name="Michael Saboff">msaboff</assigned_to>
          <cc>ap</cc>
    
    <cc>commit-queue</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>mitz</cc>
    
    <cc>ossy</cc>
    
    <cc>saam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1190248</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2016-05-04 15:48:30 -0700</bug_when>
    <thetext>Change set r196541 added the output of Dwarf2 debugging directives to the offline assembler, but disabled the feature until the appropriate support was added to the C++ compiler.  That support was added to Clang version 800.0.12 and later.

We should detect that we&apos;re compiling with the appropriate clang compiler version and enable the output of the Dwarf2 directives.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190249</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-05-04 15:50:11 -0700</bug_when>
    <thetext>&lt;rdar://problem/26100879&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190270</commentid>
    <comment_count>2</comment_count>
      <attachid>278143</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2016-05-04 16:39:30 -0700</bug_when>
    <thetext>Created attachment 278143
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190272</commentid>
    <comment_count>3</comment_count>
      <attachid>278143</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2016-05-04 16:42:11 -0700</bug_when>
    <thetext>Comment on attachment 278143
Patch

rs=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190298</commentid>
    <comment_count>4</comment_count>
      <attachid>278143</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-05-04 18:06:21 -0700</bug_when>
    <thetext>Comment on attachment 278143
Patch

Clearing flags on attachment: 278143

Committed r200447: &lt;http://trac.webkit.org/changeset/200447&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190299</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-05-04 18:06:25 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190313</commentid>
    <comment_count>6</comment_count>
      <attachid>278143</attachid>
    <who name="">mitz</who>
    <bug_when>2016-05-04 20:15:08 -0700</bug_when>
    <thetext>Comment on attachment 278143
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=278143&amp;action=review

&gt; Source/JavaScriptCore/offlineasm/config.rb:66
&gt; +        clangExecutable = ENV[&apos;TOOLCHAIN_DIR&apos;] + &apos;/usr/bin/clang&apos;
&gt; +        if File.executable?(clangExecutable)
&gt; +            clangVersionOut = %x`#{clangExecutable} --version`

The canonical way to find and invoke clang from a script running in Xcode would be simply `xcrun clang --version`</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190346</commentid>
    <comment_count>7</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2016-05-05 03:54:27 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; Comment on attachment 278143 [details]
&gt; Patch
&gt; 
&gt; Clearing flags on attachment: 278143
&gt; 
&gt; Committed r200447: &lt;http://trac.webkit.org/changeset/200447&gt;

It broke the Apple Mac Yosemite build:
(see build.webkit.org for details)

/Volumes/Data/slave/yosemite-release/build/Source/JavaScriptCore/offlineasm/config.rb:64:in `shouldEnableDebugAnnotations&apos;: undefined method `+&apos; for nil:NilClass (NoMethodError)
	from /Volumes/Data/slave/yosemite-release/build/Source/JavaScriptCore/offlineasm/config.rb:83:in `&lt;top (required)&gt;&apos;
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require&apos;
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require&apos;
	from /Volumes/Data/slave/yosemite-release/build/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb:28:in `&lt;main&gt;&apos;
Command /bin/sh failed with exit code 1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190347</commentid>
    <comment_count>8</comment_count>
      <attachid>278143</attachid>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2016-05-05 04:03:41 -0700</bug_when>
    <thetext>Comment on attachment 278143
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=278143&amp;action=review

&gt; Source/JavaScriptCore/offlineasm/config.rb:74
&gt; +                # clang version 800.0.12 or higher is required for debug annotations
&gt; +                versionMatch = /clang-(\d+).(\d+).(\d+)/.match(clangVersionOut)
&gt; +                if versionMatch.length &gt;= 4
&gt; +                    totalVersion = versionMatch[1].to_i * 1000000 + versionMatch[2].to_i * 1000 + versionMatch[3].to_i
&gt; +                    if totalVersion &gt;= 800000012
&gt; +                        return true
&gt; +                    end

It is not platform independent at all, it is a Mac only code.
There is no GCC_VERSION, no TOOLCHAIN_DIR on non Mac platforms, 
no similar clang versions like this.

Some Linux examples for clang --version.

$ clang --version
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix

$ clang --version
Ubuntu clang version 3.6.2-1 (tags/RELEASE_362/final) (based on LLVM 3.6.2)
Target: x86_64-pc-linux-gnu
Thread model: posix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190357</commentid>
    <comment_count>9</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2016-05-05 07:51:18 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #4)
&gt; &gt; Comment on attachment 278143 [details]
&gt; &gt; Patch
&gt; &gt; 
&gt; &gt; Clearing flags on attachment: 278143
&gt; &gt; 
&gt; &gt; Committed r200447: &lt;http://trac.webkit.org/changeset/200447&gt;
&gt; 
&gt; It broke the Apple Mac Yosemite build:
&gt; (see build.webkit.org for details)
&gt; 
&gt; /Volumes/Data/slave/yosemite-release/build/Source/JavaScriptCore/offlineasm/
&gt; config.rb:64:in `shouldEnableDebugAnnotations&apos;: undefined method `+&apos; for
&gt; nil:NilClass (NoMethodError)
&gt; 	from
&gt; /Volumes/Data/slave/yosemite-release/build/Source/JavaScriptCore/offlineasm/
&gt; config.rb:83:in `&lt;top (required)&gt;&apos;
&gt; 	from
&gt; /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/
&gt; rubygems/core_ext/kernel_require.rb:55:in `require&apos;
&gt; 	from
&gt; /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/
&gt; rubygems/core_ext/kernel_require.rb:55:in `require&apos;
&gt; 	from
&gt; /Volumes/Data/slave/yosemite-release/build/Source/JavaScriptCore/offlineasm/
&gt; generate_offset_extractor.rb:28:in `&lt;main&gt;&apos;
&gt; Command /bin/sh failed with exit code 1

After checking the Yosemite build logs, it seems 
there is no TOOLCHAIN_DIR env, only DT_TOOLCHAIN_DIR.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190360</commentid>
    <comment_count>10</comment_count>
    <who name="">mitz</who>
    <bug_when>2016-05-05 08:21:35 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; (In reply to comment #7)
&gt; &gt; (In reply to comment #4)
&gt; &gt; &gt; Comment on attachment 278143 [details]
&gt; &gt; &gt; Patch
&gt; &gt; &gt; 
&gt; &gt; &gt; Clearing flags on attachment: 278143
&gt; &gt; &gt; 
&gt; &gt; &gt; Committed r200447: &lt;http://trac.webkit.org/changeset/200447&gt;
&gt; &gt; 
&gt; &gt; It broke the Apple Mac Yosemite build:
&gt; &gt; (see build.webkit.org for details)
&gt; &gt; 
&gt; &gt; /Volumes/Data/slave/yosemite-release/build/Source/JavaScriptCore/offlineasm/
&gt; &gt; config.rb:64:in `shouldEnableDebugAnnotations&apos;: undefined method `+&apos; for
&gt; &gt; nil:NilClass (NoMethodError)
&gt; &gt; 	from
&gt; &gt; /Volumes/Data/slave/yosemite-release/build/Source/JavaScriptCore/offlineasm/
&gt; &gt; config.rb:83:in `&lt;top (required)&gt;&apos;
&gt; &gt; 	from
&gt; &gt; /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/
&gt; &gt; rubygems/core_ext/kernel_require.rb:55:in `require&apos;
&gt; &gt; 	from
&gt; &gt; /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/
&gt; &gt; rubygems/core_ext/kernel_require.rb:55:in `require&apos;
&gt; &gt; 	from
&gt; &gt; /Volumes/Data/slave/yosemite-release/build/Source/JavaScriptCore/offlineasm/
&gt; &gt; generate_offset_extractor.rb:28:in `&lt;main&gt;&apos;
&gt; &gt; Command /bin/sh failed with exit code 1
&gt; 
&gt; After checking the Yosemite build logs, it seems 
&gt; there is no TOOLCHAIN_DIR env, only DT_TOOLCHAIN_DIR.

Relying on either variable, or on the path to clang relative to it, isn’t the right thing to do. As I’ve mentioned above, xcrun is the right way to invoke clang. If this script is shared with non-Xcode build systems, then it’s probably best for the script itself to use the CC environment variable, and for the Xcode script build phase that invokes it to set that variable (if not already set) to the output of &quot;xcrun -find clang&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190365</commentid>
    <comment_count>11</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2016-05-05 09:35:59 -0700</bug_when>
    <thetext>Looking at the build breakage now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190376</commentid>
    <comment_count>12</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2016-05-05 10:15:15 -0700</bug_when>
    <thetext>Landed build fix in change set r200458: &lt;http://trac.webkit.org/changeset/200458&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190377</commentid>
    <comment_count>13</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2016-05-05 10:16:33 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; Comment on attachment 278143 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=278143&amp;action=review
&gt; 
&gt; &gt; Source/JavaScriptCore/offlineasm/config.rb:74
&gt; &gt; +                # clang version 800.0.12 or higher is required for debug annotations
&gt; &gt; +                versionMatch = /clang-(\d+).(\d+).(\d+)/.match(clangVersionOut)
&gt; &gt; +                if versionMatch.length &gt;= 4
&gt; &gt; +                    totalVersion = versionMatch[1].to_i * 1000000 + versionMatch[2].to_i * 1000 + versionMatch[3].to_i
&gt; &gt; +                    if totalVersion &gt;= 800000012
&gt; &gt; +                        return true
&gt; &gt; +                    end
&gt; 
&gt; It is not platform independent at all, it is a Mac only code.
&gt; There is no GCC_VERSION, no TOOLCHAIN_DIR on non Mac platforms, 
&gt; no similar clang versions like this.
&gt; 
&gt; Some Linux examples for clang --version.
&gt; 
&gt; $ clang --version
&gt; Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
&gt; Target: x86_64-pc-linux-gnu
&gt; Thread model: posix
&gt; 
&gt; $ clang --version
&gt; Ubuntu clang version 3.6.2-1 (tags/RELEASE_362/final) (based on LLVM 3.6.2)
&gt; Target: x86_64-pc-linux-gnu
&gt; Thread model: posix

I intended the change to be Mac only.  I have no way of determining what Linux clang versions have the multiple .file directives fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190378</commentid>
    <comment_count>14</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2016-05-05 10:27:07 -0700</bug_when>
    <thetext>(In reply to comment #13)

&gt; I intended the change to be Mac only.  I have no way of determining what
&gt; Linux clang versions have the multiple .file directives fix.

Please add Linux clang specific check.  You&apos;ll need to figure out the first clang version that has the fix given at http://reviews.llvm.org/D16101.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1191056</commentid>
    <comment_count>15</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2016-05-08 09:29:05 -0700</bug_when>
    <thetext>Can this be detected by a feature check, instead of a version check?

It&apos;s not clear from the bug what the failure mode was.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1191178</commentid>
    <comment_count>16</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2016-05-09 07:56:24 -0700</bug_when>
    <thetext>(In reply to comment #15)
&gt; Can this be detected by a feature check, instead of a version check?
&gt; 
&gt; It&apos;s not clear from the bug what the failure mode was.

Without the clang fix, clang will crash with the directives this change produces.  There isn&apos;t a feature check in clang for the change.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>278143</attachid>
            <date>2016-05-04 16:39:30 -0700</date>
            <delta_ts>2016-05-04 18:06:21 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>157364.patch</filename>
            <type>text/plain</type>
            <size>2228</size>
            <attacher name="Michael Saboff">msaboff</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMjAwNDM3KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE2IEBA
CisyMDE2LTA1LTA0ICBNaWNoYWVsIFNhYm9mZiAgPG1zYWJvZmZAYXBwbGUuY29tPgorCisgICAg
ICAgIEVuYWJsZSBEd2FyZjIgZGVidWcgaW5mb3JtYXRpb24gaW4gb2ZmbGluZSBhc3NlbWJsZXIg
Zm9yIGNsYW5nIGNvbXBpbGVyCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3df
YnVnLmNnaT9pZD0xNTczNjQuCisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISku
CisKKyAgICAgICAgQWRkZWQgYSBuZXcgZnVuY3Rpb24gc2hvdWxkRW5hYmxlRGVidWdBbm5vdGF0
aW9ucygpIHRoYXQgZGV0ZXJtaW5lcyBpZgorICAgICAgICB3ZSBhcmUgdXNpbmcgY2xhbmcgYW5k
IGEgbmV3IGVub3VnaCB2ZXJzaW9uIHRvIHN1cHBvcnQgdGhlIGRlYnVnIGFubm90YXRpb25zLgor
CisgICAgICAgICogb2ZmbGluZWFzbS9jb25maWcucmI6CisgICAgICAgIChzaG91bGRFbmFibGVE
ZWJ1Z0Fubm90YXRpb25zKTogQWRkZWQuCisKIDIwMTYtM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uZXhlY3V0YWJsZT8o
Y2xhbmdFeGVjdXRhYmxlKQorICAgICAgICAgICAgY2xhbmdWZXJzaW9uT3V0ID0gJXhgI3tjbGFu
Z0V4ZWN1dGFibGV9IC0tdmVyc2lvbmAKKyAgICAgICAgICAgIGlmICgkPyA9PSAwKQorICAgICAg
ICAgICAgICAgICMgY2xhbmcgdmVyc2lvbiA4MDAuMC4xMiBvciBoaWdoZXIgaXMgcmVxdWlyZWQg
Zm9yIGRlYnVnIGFubm90YXRpb25zCisgICAgICAgICAgICAgICAgdmVyc2lvbk1hdGNoID0gL2Ns
YW5nLShcZCspLihcZCspLihcZCspLy5tYXRjaChjbGFuZ1ZlcnNpb25PdXQpCisgICAgICAgICAg
ICAgICAgaWYgdmVyc2lvbk1hdGNoLmxlbmd0aCA+PSA0CisgICAgICAgICAgICAgICAgICAgIHRv
dGFsVmVyc2lvbiA9IHZlcnNpb25NYXRjaFsxXS50b19pICogMTAwMDAwMCArIHZlcnNpb25NYXRj
aFsyXS50b19pICogMTAwMCArIHZlcnNpb25NYXRjaFszXS50b19pCisgICAgICAgICAgICAgICAg
ICAgIGlmIHRvdGFsVmVyc2lvbiA+PSA4MDAwMDAwMTIKKyAgICAgICAgICAgICAgICAgICAgICAg
IHJldHVybiB0cnVlCisgICAgICAgICAgICAgICAgICAgIGVuZAorICAgICAgICAgICAgICAgIGVu
ZAorICAgICAgICAgICAgZW5kCisgICAgICAgIGVuZAorICAgIGVuZAorCisgICAgZmFsc2UKK2Vu
ZAorCiskZW5hYmxlRGVidWdBbm5vdGF0aW9ucyA9IHNob3VsZEVuYWJsZURlYnVnQW5ub3RhdGlv
bnMoKQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>