sifive / freedom-tools

Tools for SiFive's Freedom Platform
217 stars 52 forks source link

riscv-qemu fails to build -- cannot find hw/riscv/sifive_prci.h #34

Closed sctincman closed 4 years ago

sctincman commented 4 years ago

While trying to build master branch on Ubuntu 19.10, I ran into this issue:

freedom-tools/obj/x86_64-linux-ubuntu14/build/riscv-qemu/riscv-qemu/hw/riscv/sifive_u.c:43:10: fatal error: hw/riscv/sifive_prci.h: No such file or directory
   43 | #include "hw/riscv/sifive_prci.h"

Appears that sifive_prci.h was renamed to sifive_{u,e}_prci.h, but wasn't update in scripts/qemu-sifive-{u,e}.c

After editing those file and re-rerunning make I still hit compile time errors, as it appears the script files have become out of sync with upstream qemu (which appears to have sifive changes merged).

There are at least differences between them (wc used for brevity)

diff scripts/qemu-sifive-e.c src/riscv-qemu/hw/riscv/sifive_e.c | wc
     64     147    1965
cgsfv commented 4 years ago

Yeah, the QEMU build got broke and is now out of sync with the upstream qemu. I will look into fixing that - thanks for reminding me :-)

cgsfv commented 4 years ago

If you use the latest release it should work: https://github.com/sifive/freedom-tools/tree/v2019.08.0

sctincman commented 4 years ago

Excellent, and actually came after I removed the makefile steps that copy the scripts/qemu-sifive*.c files (but leave the sed file patching in place) to find that package and all the other packages build successfully as well :) I haven't tried to see if qemu itself runs correctly though.

MarcKarasek commented 4 years ago

Still broken on master ...

jim-wilson commented 4 years ago

This should be fixed, but meanwhile, it would also be a good idea to change the default branch of freedom-tools to point at the v2019.08 branch, because the master branch is for development work and isn't supported.

cgsfv commented 4 years ago

master is now updated, and qemu builds fine - please try it out

cgsfv commented 4 years ago

Closing, as I believe the issue is solved in master.