<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 - -mfpu=neon overrides +crypto part of -march=armv8-a+crypto"
   href="https://bugs.llvm.org/show_bug.cgi?id=38629">38629</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>-mfpu=neon overrides +crypto part of -march=armv8-a+crypto
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>7.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </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>lennox@cs.columbia.edu
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Passing -mfpu=neon on the clang command line for arm32 (specifically with the
target triple armv7-none-linux-androideabi) disables the __ARM_FEATURE_CRYPTO
feature which would normally be enabled by -march=armv8+crypto, even though the
armv8 part of the flag takes effect, even if the -march flag is specified
later.

This is particularly problematic because -mfpu=neon tends to get added
automatically by Android build procedures when vector support is needed.

E.g.:

$ clang -target armv7-none-linux-androideabi -mfloat-abi=softfp -E -dM -x c
/dev/null | egrep 'CRYPTO|ARM_ARCH '
#define __ARM_ARCH 7

$ clang -target armv7-none-linux-androideabi -mfloat-abi=softfp
-march=armv8+crypto -E -dM -x c /dev/null | egrep 'CRYPTO|ARM_ARCH '
#define __ARM_ARCH 8
#define __ARM_FEATURE_CRYPTO 1

$ clang -target armv7-none-linux-androideabi -mfloat-abi=softfp -mfpu=neon
-march=armv8+crypto -E -dM -x c /dev/null | egrep 'CRYPTO|ARM_ARCH '
#define __ARM_ARCH 8

$ clang -target armv7-none-linux-androideabi -v
Android (4751641 based on r328903) clang version 7.0.2
(<a href="https://android.googlesource.com/toolchain/clang">https://android.googlesource.com/toolchain/clang</a>
003100370607242ddd5815e4a043907ea9004281)
(<a href="https://android.googlesource.com/toolchain/llvm">https://android.googlesource.com/toolchain/llvm</a>
1d739ffb0366421d383e04ff80ec2ee591315116) (based on LLVM 7.0.2svn)
Target: armv7-none-linux-android
Thread model: posix
InstalledDir:
/Users/jonathan/Android/android-ndk-r18-beta1/toolchains/llvm/prebuilt/darwin-x86_64/bin</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>