# Cross instructions ## Set up the toolchain ``` $ crossdev riscv64-unknown-linux-gnu ``` # Avoid dependency hell and populate the `ROOT` Emerge `sys-libs/glibc` (no, `@system` / `@world` won't make it realise it can/should do this, don't ask why, I don't know): ``` $ riscv64-unknown-linux-gnu-emerge -v1 sys-libs/glibc $ riscv64-unknown-linux-gnu-emerge -v1 @system ``` # Profile setup ## Choosing profile Run: `PORTAGE_CONFIGROOT=/usr/riscv64-unknown-linux-gnu eselect profile list` Pick a nice looking one, like `default/linux/riscv/20.0/rv64gc/lp64`. ``` $ PORTAGE_CONFIGROOT=/usr/riscv64-unknown-linux-gnu eselect profile set default/linux/riscv/20.0/rv64gc/lp64 ``` ## Remove -pam nonsense Edit `/usr/riscv64-unknown-linux-gnu/etc/portage/make.conf` to remove `USE=-pam` because it'll conflict with `sys-apps/util-linux` being the default `su` provider: ``` $ sed -i -e "s:-pam::" /usr/riscv64-unknown-linux-gnu/etc/portage/make.conf ``` ## Avoid circular deps ``` $ USE="-filecaps" riscv64-unknown-linux-gnu-emerge -v1 @system ```