Support for target riscv64-linux-user
natrhythm opened this issue · 5 comments
I get the following error when compiling symqemu for --target-list=x86_64-linux-user
:
CC riscv64-linux-user/tcg/tcg.o
In file included from /usr/include/sched.h:29,
from /usr/include/pthread.h:22,
from /usr/include/glib-2.0/glib/deprecated/gthread.h:124,
from /usr/include/glib-2.0/glib.h:111,
from /symqemu/include/glib-compat.h:32,
from /symqemu/include/qemu/osdep.h:140,
from /symqemu/tcg/tcg.c:28:
/symqemu/tcg/tcg.c: In function 'tcg_context_init':
/symqemu/tcg/tcg.c:1000:9: error: 'ArchCPU' {aka 'RISCVCPU'} has no member named 'env_exprs'
1000 | offsetof(ArchCPU, env_exprs) - offsetof(ArchCPU, env), "env");
| ^~~~~~~~
make[1]: *** [/symqemu/rules.mak:69: tcg/tcg.o] Error 1
make: *** [Makefile:472: riscv64-linux-user/all] Error 2
Flex and Bison are installed, and all Qemu dependencies are installed with apt build-dep qemu
.
Hi,
can you post more information? Complete log (including configure logs), all comands (configure, make etc), OS version and platform?
Thanks
I am running this in a docker container:
FROM ubuntu:groovy
ENV DEBIAN_FRONTEND noninteractive
RUN sed -i "s/archive.ubuntu.com/old-releases.ubuntu.com/g" /etc/apt/sources.list; \
sed -i "s/security.ubuntu.com/old-releases.ubuntu.com/g" /etc/apt/sources.list;
RUN echo '\
deb-src http://old-releases.ubuntu.com/ubuntu/ groovy main universe restricted multiverse\n\
deb-src http://old-releases.ubuntu.com/ubuntu groovy-security main universe restricted multiverse\n\
deb-src http://old-releases.ubuntu.com/ubuntu/ groovy-updates main universe restricted multiverse\n\
deb-src http://old-releases.ubuntu.com/ubuntu groovy-backports main restricted universe multiverse\n\
' >> /etc/apt/sources.list;
RUN apt-get update -y; \
apt-get upgrade -y;
RUN apt-get install -y \
git cargo clang-10 cmake g++ git libz3-dev llvm-10-dev llvm-10-tools ninja-build python2 python3-pip zlib1g-dev pkg-config libglib2.0-dev libpixman-1-dev z3 bison flex;
RUN pip3 install lit;
RUN apt build-dep qemu -y;
#symqemu and symcc
RUN git clone https://github.com/eurecom-s3/symqemu.git; \
cd symqemu; \
git clone https://github.com/eurecom-s3/symcc.git; \
cd symcc; \
git submodule update --init; \
mkdir build; \
cd build; \
cmake -G Ninja -DQSYM_BACKEND=ON -DZ3_TRUST_SYSTEM_VERSION=on ..; \
ninja;
RUN bash
With the following config and make commands (from within /symqemu/symcc):
../configure \
--audio-drv-list= \
--disable-bluez \
--disable-sdl \
--disable-gtk \
--disable-vte \
--disable-opengl \
--disable-virglrenderer \
--disable-werror \
--target-list=riscv64-linux-user \
--enable-capstone=git \
--symcc-source=/symqemu/symcc \
--symcc-build=/symqemu/symcc/build
make
Thank you for looking into this!
Thanks, for now the target riscv64-linux-user isn't supported.
The changes are probably quite minimal (adding the symbolic state for riscV cpu structure) .
It would be nice if you provide a PR for this (if you don't there are chances we do soon anyway).
Note, that we will soon push a port os SymQEMU to QEMU8.
That change will be needed there too and porting it should be simple I think.