arch-arm: Only build ArmCapstoneDisassembler when ISA is arm (#553)

Currently, if the Capstone header file is found in the host system,
scons will try to build the ArmCapstoneDisassembler regardless of the
gem5 target ISA. This is causing problem when the host has Capstone, but
the gem5 target ISA is not arm. Compiling gem5 in this case will cause
errors, e.g., ArmISA and ArmSystem is not found.

This change aims to prevent building the ArmCapstoneDisassembler when
the gem5 target ISA is not arm.

Ref:
[1] The Arm Capstone PR https://github.com/gem5/gem5/pull/494

Change-Id: I1e714d34aec8fe2a2af8cd351536951053a4d8a5
This commit is contained in:
Hoa Nguyen
2023-12-03 13:22:11 -08:00
committed by GitHub
parent 88c57e22de
commit 7a5052b3a0
3 changed files with 14 additions and 6 deletions

View File

@@ -115,9 +115,11 @@ Source('simple_thread.cc')
Source('thread_context.cc')
Source('thread_state.cc')
Source('timing_expr.cc')
SourceLib('capstone', tags='capstone')
Source('capstone.cc', tags='capstone')
SimObject('Capstone.py', sim_objects=['CapstoneDisassembler'], tags='capstone')
if env['CONF']['USE_CAPSTONE']:
SourceLib('capstone')
Source('capstone.cc')
SimObject('Capstone.py', sim_objects=['CapstoneDisassembler'])
SimObject('DummyChecker.py', sim_objects=['DummyChecker'])
Source('checker/cpu.cc')