From 9b1ff519aa72b9064ef7ef0f7109e3925eec6365 Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Mon, 5 Jul 2021 23:29:10 -0700 Subject: [PATCH] scons: Not compiling with systemc when host is RISCV Compiling gem5 with systemc enabled results in the errors described in https://gem5.atlassian.net/browse/GEM5-1027. This change tells scons not to compile gem5 with systemc when the host ISA is RISC-V. JIRA: https://gem5.atlassian.net/browse/GEM5-1027 Change-Id: I04e1bc722c9d702472152c9116d89938e8408047 Signed-off-by: Hoa Nguyen Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47660 Reviewed-by: Jason Lowe-Power Reviewed-by: Gabe Black Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/systemc/SConsopts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/systemc/SConsopts b/src/systemc/SConsopts index 4f2ae5c6d8..891431cf76 100644 --- a/src/systemc/SConsopts +++ b/src/systemc/SConsopts @@ -28,6 +28,14 @@ Import('*') from gem5_scons import warning def use_systemc_check(env, warn=False): + import platform + host_isa = platform.machine() + # Disallow compiling systemc if the host ISA is RISC-V. + # The error is described here: https://gem5.atlassian.net/browse/GEM5-1027 + if host_isa.startswith("riscv"): + if warn: + warning('Warning: Systemc may not work on RISC-V.') + return False if env['PLATFORM'] == 'darwin': if warn: warning('Warning: Systemc may not work on Mac OS.')