sifive / freedom-tools

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

qemu depends on libpng12 #55

Closed ty-n-42 closed 1 year ago

ty-n-42 commented 4 years ago

This is part issue and part request. When I try to use Ubuntu 18.04 or 20.04 the version of Qemu that is part of freedom-tools fails because it depends on libpng12 and libpng12 is not available past 16.04. It would be great if Qemu support were updated to a recent version: v5.0.0 was recently released.

There seems to be quite a lot of fixes and new features for RISCV in more recent versions of Qemu so moving to a newer version will benefit in 3 ways:

  1. remove the dependency problem
  2. improve the simulation of RISCV
  3. lower the barrier of entry for programmers (most of my hardware doesn't work with 16.04)

I attempted to build Qemu myself to replace what is provided in freedom-tools but what I ended up with does not seem to be what is in freedom-tools. If there are some instructions on building for freedom-tools and testing I am happy to contribute some time to help make this happen.

jim-wilson commented 4 years ago

The v2019.08 release has qemu 4.1 binaries linked against libpng12, but the next release will have qemu 4.2 binaries with libpng16. The current source tree builds its own libpng from source and static links with it to avoid this problem.

v5 qemu breaks the riscv32-linux support in riscv-gnu-toolchaiin, as it apparently needs the new y2038 safe glibc patches we haven't merged in yet. But SiFive doesn't have a riscv32-linux product, so that doesn't necessarily prevent adding it to freedom-tools, unless there are also other problems.

It should be possible to build freedom-tools, though there are lots of packages required for the build to complete. Check the prerequisites list. Clone rthe git tree, check out the submodules (e.g. git submodule update --init --recurisve), and then try "make ubuntu64" if all you want is the 64-bit ubuntu binaries. "make all" will build both the ubuntu64 toolchain and the win64 toolchain which you may not need. Either way, this will use a lot of disk space and take a while to build. Use a nice -jX option with make to make the build for faster.