@@ -62,11 +62,13 @@ endforeach
62
62
63
63
# ASM option
64
64
is_asm_enabled = (get_option (' enable_asm' ) == true and
65
- (host_machine .cpu_family() == ' x86' or
66
- (host_machine .cpu_family() == ' x86_64' and cc.get_define(' __ILP32__' ).strip() == '' ) or
67
- host_machine .cpu_family() == ' aarch64' or
65
+ (host_machine .cpu_family() == ' aarch64' or
68
66
host_machine .cpu_family().startswith(' arm' ) or
69
- host_machine .cpu() == ' ppc64le' ))
67
+ host_machine .cpu() == ' ppc64le' or
68
+ host_machine .cpu_family().startswith(' riscv' ) or
69
+ host_machine .cpu_family().startswith(' loongarch' ) or
70
+ host_machine .cpu_family() == ' x86' or
71
+ (host_machine .cpu_family() == ' x86_64' and cc.get_define(' __ILP32__' ).strip() == '' )))
70
72
cdata.set10(' HAVE_ASM' , is_asm_enabled)
71
73
72
74
if is_asm_enabled and get_option (' b_sanitize' ) == ' memory'
@@ -232,7 +234,9 @@ endif
232
234
233
235
if (host_machine .cpu_family() == ' aarch64' or
234
236
host_machine .cpu_family().startswith(' arm' ) or
235
- host_machine .cpu() == ' ppc64le' )
237
+ host_machine .cpu_family().startswith(' loongarch' ) or
238
+ host_machine .cpu() == ' ppc64le' or
239
+ host_machine .cpu_family().startswith(' riscv' ))
236
240
if cc.has_function(' getauxval' , prefix : ' #include <sys/auxv.h>' , args : test_args)
237
241
cdata.set(' HAVE_GETAUXVAL' , 1 )
238
242
endif
@@ -379,6 +383,14 @@ endif
379
383
380
384
cdata.set10(' ARCH_PPC64LE' , host_machine .cpu() == ' ppc64le' )
381
385
386
+ cdata.set10(' ARCH_RISCV' , host_machine .cpu_family().startswith(' riscv' ))
387
+ cdata.set10(' ARCH_RV32' , host_machine .cpu_family() == ' riscv32' )
388
+ cdata.set10(' ARCH_RV64' , host_machine .cpu_family() == ' riscv64' )
389
+
390
+ cdata.set10(' ARCH_LOONGARCH' , host_machine .cpu_family().startswith(' loongarch' ))
391
+ cdata.set10(' ARCH_LOONGARCH32' , host_machine .cpu_family() == ' loongarch32' )
392
+ cdata.set10(' ARCH_LOONGARCH64' , host_machine .cpu_family() == ' loongarch64' )
393
+
382
394
# meson's cc.symbols_have_underscore_prefix() is unfortunately unrelieably
383
395
# when additional flags like '-fprofile-instr-generate' are passed via CFLAGS
384
396
# see following meson issue https://github.com/mesonbuild/meson/issues/5482
0 commit comments