Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for target riscv64-linux-user #35

Closed
natrhythm opened this issue Jan 11, 2024 · 5 comments
Closed

Support for target riscv64-linux-user #35

natrhythm opened this issue Jan 11, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@natrhythm
Copy link

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.

@aurelf
Copy link
Member

aurelf commented Jan 11, 2024

Hi,
can you post more information? Complete log (including configure logs), all comands (configure, make etc), OS version and platform?

Thanks

@natrhythm
Copy link
Author

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!

@aurelf aurelf changed the title make riscv64-linux-user error Support for target riscv64-linux-user Jan 11, 2024
@aurelf aurelf added the enhancement New feature or request label Jan 11, 2024
@aurelf
Copy link
Member

aurelf commented Jan 11, 2024

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.

@aurelf
Copy link
Member

aurelf commented Jan 12, 2024

In the meantime, you can you test the PR #31 we will wait for the merge of QEMU8 to merge that one.

@aurelf
Copy link
Member

aurelf commented Mar 18, 2024

Closed by #42

@aurelf aurelf closed this as completed Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants