elftrace icon indicating copy to clipboard operation
elftrace copied to clipboard

Deterministic cross-compilation with Guix

Open Sjors opened this issue 1 year ago • 1 comments

Different versions of GCC, as well as differences optimization settings and RISC-V target platform can result in different ELF files. See #16.

This seems like a great use case for Guix deterministic builds.

Some parts of Bitcoin Core's Guix build may be of use: https://github.com/bitcoin/bitcoin/tree/master/contrib/guix

Especially since Bitcoin Core already has some support for 32-bit RISC-V cross-compilation: https://github.com/bitcoin/bitcoin/tree/master/depends

Though the Guix build system only supports riscv64-linux-gnu, not 32 bit:

https://github.com/bitcoin/bitcoin/blob/master/contrib/guix/guix-build#L78-L80

But maybe it's not difficult to figure out how to make it work for a 32 bit unknown-elf target.

Sjors avatar Mar 28 '25 14:03 Sjors

I suppose this could be an entirely separate project.

Though on the other hand, if someone were to build a full stack system including all the challenge-response bitcoin scripts, you'd probably want the whole thing to be deterministic.

Sjors avatar Mar 28 '25 15:03 Sjors