cksystemsteaching / selfie

An educational software system of a tiny self-compiling C compiler, a tiny self-executing RISC-V emulator, and a tiny self-hosting RISC-V hypervisor.
http://selfie.cs.uni-salzburg.at
BSD 2-Clause "Simplified" License
2.38k stars 312 forks source link

Multiplatform AMD64/ARM64 Support #290

Open ckirsch opened 3 years ago

ckirsch commented 3 years ago

Building a multiplatform docker image for linux/amd64 and linux/arm64 using:

docker build --platform linux/amd64,linux/arm64 .

currently fails in the linux/arm64 portion for at least two reasons:

  1. lib32gcc-9-dev seems to be unavailable
  2. openocd fails to recognize the system
  3. spike fails to build (which may be an issue we can't solve easily)

I am not sure how involved fixing all this is but I expect we need to support ARM64 sooner or later and therefore may not get around the issue.

fischer-martin commented 3 years ago

I think for OpenOCD it's probably the best choice to kick it out of the docker image since the GDB+QEMU combo works really well and since OpenOCD is only needed when one wants to debug the bare-metal setup on actual hardware. Regarding Spike it would be interesting to see the reason why it fails to build. Could you paste the relevant output here?

ckirsch commented 3 years ago

44 123.3 g++: fatal error: Killed signal terminated program cc1plus

44 123.3 compilation terminated.

44 123.3 make: *** [Makefile:349: disasm.o] Error 1

44 123.3 make: *** Waiting for unfinished jobs....


Dockerfile:68

67 | # build spike ISA simulator 68 | >>> RUN mkdir -p $RISCV \ 69 | >>> && mkdir -p riscv-isa-sim/build \ 70 | >>> && cd riscv-isa-sim/build \ 71 | >>> && ../configure --prefix=$RISCV \ 72 | >>> && make \ 73 | >>> && make install 74 |

error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c mkdir -p $RISCV && mkdir -p riscv-isa-sim/build && cd riscv-isa-sim/build && ../configure --prefix=$RISCV && make && make install]: exit code: 2