Skip to content

Offloading breaks compilation on Aarch64 #113094

@pradt2

Description

@pradt2

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

#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.

Metadata

Metadata

Assignees

Labels

good first issuehttps://github.com/llvm/llvm-project/contributeoffloadworksformeResolved as "works for me"

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions