!xmLtiCaAJxfhURjrXl:matrix.org

NixOS RISC-V

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

Load older messages


SenderMessageTime
8 Apr 2026
@jammie:matrix.orgJamieMagee set a profile picture.03:43:00
9 Apr 2026
@genericnerdyusername:matrix.orgGenericNerdyUsername Alyssa Ross i think i asked you about this a while ago, but is there some way to make a `riscv64-unknown-elf` toolchain? 14:43:10
@genericnerdyusername:matrix.orgGenericNerdyUsername riscv64-none-elf might be functionally the same, but the thing i want to use wants specifically unknown-elf, and i dont if setup-hook fuckery means i can just make a bunch of symlinks 14:44:14
@genericnerdyusername:matrix.orgGenericNerdyUsername * Alyssa Ross i think i asked you about this a while ago, but is there some way to make a riscv64-unknown-elf gcc toolchain? 14:45:38
@alex:tunstall.xyzAlex I've seen before x86_64-unknown-linux vs x86_64-pc-linux in Nixpkgs, though I don't know whether that has led to any tooling of the kind you seek. 14:49:03
@dramforever:matrix.orgdramforeveri know this isn't your fault but please for the love of fuck stop hard coding prefixes https://github.com/NixOS/nixpkgs/issues/145726#issuecomment-2799568568 https://github.com/rust-lang/pkg-config-rs/issues/53#issuecomment-302791537615:04:28
@dramforever:matrix.orgdramforever* i know this isn't your fault but please everyone for the love of fuck stop hard coding prefixes https://github.com/NixOS/nixpkgs/issues/145726#issuecomment-2799568568 https://github.com/rust-lang/pkg-config-rs/issues/53#issuecomment-302791537615:04:52
@dramforever:matrix.orgdramforever just let me pass CROSS_COMPILE=riscv64-unknown-linux-gnu- or whatever it is 15:05:04
@dramforever:matrix.orgdramforever * at least just let me pass CROSS_COMPILE=riscv64-unknown-linux-gnu- or whatever it is 15:05:09
@dramforever:matrix.orgdramforeveroh i knew i did this https://mastodon.social/@dramforever/11478749727197978915:06:42
@dramforever:matrix.orgdramforever having said that, i wonder if you can "just" add unknown as a kernel type 15:10:53
@dramforever:matrix.orgdramforever apparently yes, you can just patch nixpkgs like this https://fars.ee/gAvi and use (import <nixpkgs> { crossSystem.config = "riscv64-unknown-elf"; }).stdenvNoLibc.cc 15:15:13
@dramforever:matrix.orgdramforever stdenv.cc doesn't work because we "obviously" don't have a libc for the "unknown" operating system 15:16:23
@alex:tunstall.xyzAlex I wouldn't expect it to work for none OS either, though? 15:17:09
@dramforever:matrix.orgdramforeverso...15:24:42
@dramforever:matrix.orgdramforeveron the none os we use newlib15:24:46
@alex:tunstall.xyzAlex That doesn't sound ideal to me, unless there's perhaps a way of building a custom stdenv without newlib even entiring the build closure (maybe via replaceStdenv?) 15:26:41
@alex:tunstall.xyzAlexAnyway, that is purely theoretical, since nobody right now is asking about bare metal dev.15:27:14
@dramforever:matrix.orgdramforever riscv64-unknown-elf is without a doubt baremetal dev 15:28:17
@alex:tunstall.xyzAlex Arguably, the behaviour Nixpkgs does on none should perhaps instead be for OS newlib, but maybe there's already precedent for this in other package repositories? 15:31:19
@dramforever:matrix.orgdramforeveri think newlib is precedent but i don't know why15:32:57
@genericnerdyusername:matrix.orgGenericNerdyUsername the "official" riscv toolchain for baremetal is github:riscv-collab/riscv-gnu-toolchain so everything that touches baremetal (like riscv-arch-test, which is what im trying to run) expects you to have that one specifically and nothing else 20:37:41
@genericnerdyusername:matrix.orgGenericNerdyUsernamein general, yes i agree with you, but most of what this is used for is assembly so the problem isnt as big of an issue20:38:57
10 Apr 2026
@dramforever:matrix.orgdramforever either they don't support anything other than riscv-gnu-toolchain, which means woes for you trying to run this on nixpkgs cross toolchain, probably just patch it 00:36:00
@dramforever:matrix.orgdramforeveror they've hard coded the compiler name, i.e. doing it wrong00:36:16
@dramforever:matrix.orgdramforeverof course i haven't checked so maybe it actually is overridable solving the problem for everyone00:36:40
@qyliss:fairydust.spaceAlyssa RossI don't know off the top of my head. I remember support for bare metal platforms in general in Nixpkgs being pretty broken, but that was a few years ago, so maybe it got better.09:08:26
@cleverca22:matrix.orgcleverca22ive done a decent amount of baremetal with nixpkgs for risc-v, i was mostly building nommu linux and userland for arm, i was building custom kernels (32bit and 64bit), and also linux and userlands and ive also built custom kernels for the VPU, which first required adding a new target to nixpkgs12:16:23
@genericnerdyusername:matrix.orgGenericNerdyUsernameThat reminds me, what extensions do the normal riscv linux toolchains assume the processor has?12:32:37
@cleverca22:matrix.orgcleverca22 i dont know about userland side, but i have looked into the kernel side of things
linux basically assumes no extensions at boot time, and the CONFIG_ flags enable support for them, but dont enable actually using them
if the relevant flag is detected in the device-tree, it will patch its own code at runtime, to turn the feature on
12:36:15

Show newer messages


Back to Room ListRoom Version: 10