!xmLtiCaAJxfhURjrXl:matrix.org

NixOS RISC-V

238 Members
NixOS on RISC-V https://wiki.nixos.org/wiki/RISC-V https://pad.lassul.us/NixOS-riscv64-linux 70 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
21 Jan 2024
@alex:tunstall.xyzAlex
In reply to @fgaz:matrix.org
Merged 🎉 https://github.com/NixOS/nixpkgs/pull/282517
Nice, now I no longer need an ugly hack to build everything with RV64GC_Zba_Zbb (old bootstrap's GCC was too old).
19:40:47
23 Jan 2024
@rdg:matrix.orgrdghi, I'm building a RISC-V NixOS system for qemu without compressed instructions using this overlay http://sprunge.us/SzNRff that injects -march=rv64g via NIX_CFLAGS_COMPILE_riscv64_unknown_linux_gnu11:24:36
@rdg:matrix.orgrdgto ensure there are no compressed instructions I enabled a trap in QEMU that aborts if a compressed instruction is used11:25:04
@rdg:matrix.orgrdgit boots fine and reaches userspace, but there is a problem in libgcc_s.so, which causes a SIGILL11:25:32
@rdg:matrix.orgrdgI'm not sure if this method works for libgcc_s as it may end up being built by the new compiler, ignoring my -march hack11:27:04
@rdg:matrix.orgrdgany ideas?11:27:33
@alex:tunstall.xyzAlex
In reply to @rdg:matrix.org
any ideas?

Have you tried setting gcc.arch in the targetSystem option for nixpkgs?

I'd share some specific code, but I can't find it. I think it might only be on my RISC-V system.

13:07:12
@alex:tunstall.xyzAlex
In reply to @rdg:matrix.org
any ideas?

If you're compiling natively (YMMV for cross-compilation), the following should work, since it seems to be used by all gcc compilers, including when compiling gcc itself from the bootstrap gcc.

nixpkgs.config.gcc.arch = "rv64g";
13:20:24
@alex:tunstall.xyzAlex *

If you're compiling natively (YMMV for cross-compilation), the following should work, since it seems to be used by all gcc compilers, including when compiling gcc itself from the bootstrap gcc.

nixpkgs.localSystem.gcc.arch = "rv64g";
13:20:53
@rdg:matrix.orgrdg Alex: I'm cross compiling, so I tried adding it in the nixpkgs.crossSystem.gcc.arch but I don't see it with NIX_DEBUG=1 being added anywhere 13:27:30
@rdg:matrix.orgrdgfor native compilation we had successfully used nixpkgs.localSystem.gcc.arch in other tests13:28:13
@rdg:matrix.orgrdghttps://github.com/NixOS/nixpkgs/blob/15ff1758e7816331033baa14eebbea68626128f3/pkgs/build-support/cc-wrapper/default.nix#L60115:33:44

Show newer messages


Back to Room ListRoom Version: 10