<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 ignores -march when targeting armv7-apple-darwin"
   href="https://bugs.llvm.org/show_bug.cgi?id=49293">49293</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang ignores -march when targeting armv7-apple-darwin
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

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

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Driver
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>orivej@gmx.fr
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This is a low priority bug since it affects only old hardware targets,
but since it exists in the codebase and I've stumbled upon it I'll
report it.

When running "clang --target=armv7-apple-darwin14 -march=armv8.2-a+dotprod"
MachO::TranslateArgs is called with BoundArch "armv7" and appends
"-march=armv7a" to the list of the command line args:
<a href="https://github.com/llvm/llvm-project/blob/llvmorg-13-init/clang/lib/Driver/ToolChains/Darwin.cpp#L2380">https://github.com/llvm/llvm-project/blob/llvmorg-13-init/clang/lib/Driver/ToolChains/Darwin.cpp#L2380</a>
Then clang -cc1 uses it, silently ignoring the custom -march.

The same issue was encountered in
<a href="https://github.com/tensorflow/tensorflow/issues/40026">https://github.com/tensorflow/tensorflow/issues/40026</a>
and worker around in <a href="https://github.com/google/XNNPACK/pull/692/files">https://github.com/google/XNNPACK/pull/692/files</a>
by adding -mcpu to the command line. (In my case the workaround would
be "-mcpu=cyclone+dotprod".)</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>