<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - clang 3.4 and above integrated assembler does not respect the .arch directive in .s files for arm"
   href="http://llvm.org/bugs/show_bug.cgi?id=21319">21319</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang 3.4 and above integrated assembler does not respect the .arch directive in .s files for arm
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dave@cheney.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=13226" name="attach_13226" title="gcc_arm.s extracted from golang.org/src/runtime/cgo/gcc_arm.S">attachment 13226</a> <a href="attachment.cgi?id=13226&action=edit" title="gcc_arm.s extracted from golang.org/src/runtime/cgo/gcc_arm.S">[details]</a></span>
gcc_arm.s extracted from golang.org/src/runtime/cgo/gcc_arm.S

The integrated assembler does not appear to honour the .arch directive in .s
files.

For the sample code attached, on a platform where clang has been compiled for
the default arch of armv4t (debian sid in this case). The .s file specifies
.arch armv5t but this does not appear to be honoured. 

$ clang -c gcc_arm.s 
gcc_arm.s:25:2: error: instruction requires: armv5t
        blx r5 // setg(g) 
        ^
gcc_arm.s:26:2: error: instruction requires: armv5t
        blx r4 // fn() 
        ^
Interesting the contents of .arch are being validated.

$ clang -c gcc_arm.s 
gcc_arm.s:10:1: error: Unknown arch name
.arch armv42

^ setting .arch to something silly</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>