Skip to content

nix: Add a FHS shell with the toolchain to build linux for mocha#596

Open
engdoreis wants to merge 1 commit into
lowRISC:mainfrom
engdoreis:busybox
Open

nix: Add a FHS shell with the toolchain to build linux for mocha#596
engdoreis wants to merge 1 commit into
lowRISC:mainfrom
engdoreis:busybox

Conversation

@engdoreis

@engdoreis engdoreis commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

This PR creates a nix stdenv with the the cheri toolchain for building cheri busybox and cheriLinux.
It also adds an additional FHS shell that must be used on nixOs to build busybox.
To activate the FHS:

nix develop .#linux

FIX: #581

@engdoreis engdoreis force-pushed the busybox branch 2 times, most recently from 5f5376f to 89a1a50 Compare June 4, 2026 13:43
@engdoreis engdoreis force-pushed the busybox branch 2 times, most recently from 4e7a62f to f605720 Compare June 4, 2026 15:11
@engdoreis engdoreis force-pushed the busybox branch 7 times, most recently from 9806a24 to 6abae1c Compare June 16, 2026 16:29
Signed-off-by: Douglas Reis <doreis@lowrisc.org>
@engdoreis engdoreis marked this pull request as ready for review June 17, 2026 09:05
CACHE FILEPATH "linker")

set(CHERI_COMMON_FLAGS
"-target riscv64-linux-musl -B@llvmCheri@/bin -march=rv64imafdczcherihybrid_zcherilevels -mabi=l64pc128d -mno-relax -Xclang -target-feature -Xclang +cheri-bounded-vararg -Xclang -target-feature -Xclang +cheri-bounded-memarg-caller -Xclang -target-feature -Xclang +cheri-bounded-memarg-callee -isystem @linuxHeadersPurecap@/usr/include -ggdb -gz -Wno-error=unused-command-line-argument -ffreestanding -Werror=implicit-function-declaration -Werror=format -Werror=incompatible-pointer-types -Werror=cheri-capability-misuse -Werror=cheri-bitwise-operations -Werror=pass-failed -Werror=cheri-prototypes -Werror=undefined-internal"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you split these up like here?

CACHE FILEPATH "linker")

set(CHERI_COMMON_FLAGS
"-target riscv64-linux-musl -B@llvmCheri@/bin -march=rv64imafdczcherihybrid_zcherilevels -mabi=l64pc128d -mno-relax -Xclang -target-feature -Xclang +cheri-bounded-vararg -Xclang -target-feature -Xclang +cheri-bounded-memarg-caller -Xclang -target-feature -Xclang +cheri-bounded-memarg-callee -isystem @linuxHeadersPurecap@/usr/include -ggdb -gz -Wno-error=unused-command-line-argument -ffreestanding -Werror=implicit-function-declaration -Werror=format -Werror=incompatible-pointer-types -Werror=cheri-capability-misuse -Werror=cheri-bitwise-operations -Werror=pass-failed -Werror=cheri-prototypes -Werror=undefined-internal"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

march should not have fd and mabi should be l64pc128 - Mocha doesn't currently have floating-point enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toolchain/Linux - Build a Linux sysroot (Linux headers + libc)

2 participants