<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/113094>113094</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Offloading breaks compilation on Aarch64
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          pradt2
      </td>
    </tr>
</table>

<pre>
    Hi, 

Offloading breaks compilation on Aarch64 when the compilation unit includes `<cmath>` or  `math.h`.  I can see this happen on Clang 18 and Clang 19.

Example:

main.cpp
```cpp
#include <cmath>
int main() { return 0; }
```

Compile with offloading enabled

```
/bin/clang++ -mcpu=neoverse-v2 -fopenmp=libomp --offload-arch=sm_90 -nocudalib ./main.cpp
```

Errors:

```
/usr/include/bits/math-vector.h:100:25: error: '__neon_vector_type__' attribute is not supported on targets missing 'neon', 'mve', 'sve' or 'sme'; specify an appropriate -march= or -mcpu=
 100 | typedef __attribute__ ((__neon_vector_type__ (4))) float __f32x4_t;
 |                         ^
/usr/include/bits/math-vector.h:101:25: error: '__neon_vector_type__' attribute is not supported on targets missing 'neon', 'mve', 'sve' or 'sme'; specify an appropriate -march= or -mcpu=
 101 | typedef __attribute__ ((__neon_vector_type__ (2))) double __f64x2_t;
      | ^
/usr/include/bits/math-vector.h:106:9: error: unknown type name '__SVFloat32_t'
  106 | typedef __SVFloat32_t __sv_f32_t;
      | ^
/usr/include/bits/math-vector.h:107:9: error: unknown type name '__SVFloat64_t'
  107 | typedef __SVFloat64_t __sv_f64_t;
      | ^
/usr/include/bits/math-vector.h:108:9: error: unknown type name '__SVBool_t'
  108 | typedef __SVBool_t __sv_bool_t;
      | ^
5 errors generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzclc2OozgQx5-mcimBjCEQDhzyMdHuaQ8r7RUZKIJ3wLZsk-5--5UhvUlnZlYzozlth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