[PATCH] Fix RISC-V builds
Heinrich Schuchardt
heinrich.schuchardt at canonical.com
Mon May 30 16:11:03 CEST 2022
Building on RISC-V results in an error
cc: error: ‘-march=native’: ISA string must begin with rv32 or rv64
As GCC does not support -march=native on RISC-V avoid this argument.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
meson.build | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 507c146..bbf4650 100644
--- a/meson.build
+++ b/meson.build
@@ -17,7 +17,10 @@ pktgen_conf = configuration_data()
# set up some global vars for compiler, platform, configuration, etc.
cc = meson.get_compiler('c')
-add_project_arguments('-march=native', language: 'c')
+target = target_machine.cpu_family()
+if (target != 'riscv64')
+ add_project_arguments('-march=native', language: 'c')
+endif
if get_option('enable-avx') and cc.has_argument('-mavx')
add_project_arguments('-mavx', language: 'c')
--
2.36.1
More information about the dev
mailing list