Previously I talked about my excitement for RISC-V, with one of my goals to see if I can get a decentralised stack running on top of it. My first project was to get IPFS running on RISC-V.

Checking source for incompatibilities

IPFS is written in Go. The Golang team have done a lot of hard work getting the compilers and runtime working on different architectures, with RISC-V being one of them. I encountered one bug in a deep dependency of Go on RISC-V, involving procfs and an undefined: parseCPUInfo compile error.

go build  "-asmflags=all='-trimpath='" "-gcflags=all='-trimpath='" -ldflags="-X "".CurrentCommit=79a55305e" -o "cmd/ipfs/ipfs" ""
../../go/pkg/mod/[email protected]/cpuinfo.go:71:9: undefined: parseCPUInfo
make: *** [cmd/ipfs/ cmd/ipfs/ipfs] Error 2

It involved some digging to get to the root cause and find a way to resolve, but luckily there is a PR available to fix it

After applying the patch, I was able to successfully build IPFS on my emulated IPFS environment, as well as pin & host my blog on the IPFS network.

Tracking RISC-V support: I have submitted a new issue on the go-ipfs repo to track the support of RISC-V


Build process

These steps assume you have running version of Debian on RISC-V.
See my previous post Emulating RISC-V Debian on WSL2.

Then it is a matter of mostly following the standard IPFS build instructions

# Install build tools
apt update
apt install golang git make

# Clone IPFS repo
git clone
cd go-ipfs

# Apply temporary patch to fix a broken dependency
# Maybe try building first before applying the patch in case this has been resolved.
go mod edit

# Build!
# Will output to ./cmd/ipfs/ipfs
make build

# Can optionally install
make install

From here you’ll be able to use the standard IPFS commands

IPFS running on RISC-V