Skip to content

Disabling CAPSTONE_RISCV_SUPPORT causes a crash during the build #2887

@slate5

Description

@slate5

Work environment

Questions Answers
System Capstone runs on OS/arch/bits Debian x86_64
Capstone module affected All, but RISC-V
Source of Capstone git clone
Version/git commit v6.0.0, 08e655c

Expected behavior

Disabling CAPSTONE_RISCV_SUPPORT from being built shouldn't cause an error.

Actual behavior

Excluding it results in an error due to getSysRegName() in cstool/cstool_riscv.c and suite/cstest/src/test_detail_riscv.c.

Steps to reproduce the behavior

cmake -B build -DCMAKE_BUILD_TYPE=Release -DCAPSTONE_ARCHITECTURE_DEFAULT=0 -DCAPSTONE_X86_SUPPORT=1
cmake --build build -j

Additional Logs, screenshots, source code, configuration dump, ...

CMake error:

/usr/bin/riscv64-linux-gnu-ld.bfd: CMakeFiles/cstool.dir/cstool/cstool_riscv.c.o: in function `print_insn_detail_riscv':
/root/capstone/cstool/cstool_riscv.c:47:(.text+0x170): undefined reference to `getSysRegName'
/usr/bin/riscv64-linux-gnu-ld.bfd: relocation R_RISCV_CALL_PLT against `getSysRegName' which may bind externally can not be used when making a shared object; recompile with -fPIC

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions