Use nix gnu toolchain format for baremetal apps #53

Merged
sb10q merged 1 commits from fsagbuya/nix-servo:zynq-baremetal into master 2024-03-25 16:12:20 +08:00
Collaborator

Description

Use the nix format for gnu toolchain for arm cross-compilation.

fsbl is dependent on newlib to compile, which is difficult to emulate using glibc from the linux gnu toolchain. Additionally, arm has separate toolchain for bare-metal and linux targets.

Proposing to use at most 2 gnu toolchain, one for bare-metal application (i.e. fsbl, using newlib) and one for linux development (using glibc).

Related issue: #1

Build log:

nix build .#packages.armv7l-linux.fast-servo-fsbl -L --show-trace && ls -lh
Ls ./result/
total 528K
528K -r-xr-xr-x 2 root root 525K Jan  1  1970 fsbl.elf
### Description Use the nix format for gnu toolchain for arm cross-compilation. `fsbl` is dependent on `newlib` to compile, which is [difficult to emulate using glibc](https://stackoverflow.com/questions/61132960/does-glibc-work-on-bare-metal-or-rtos-platforms) from the linux gnu toolchain. Additionally, arm has separate toolchain [for bare-metal and linux targets](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads). Proposing to use at most 2 gnu toolchain, one for bare-metal application (i.e. fsbl, using newlib) and one for linux development (using glibc). Related issue: #1 Build log: ``` nix build .#packages.armv7l-linux.fast-servo-fsbl -L --show-trace && ls -lh Ls ./result/ total 528K 528K -r-xr-xr-x 2 root root 525K Jan 1 1970 fsbl.elf ```
fsagbuya added 1 commit 2024-03-25 15:28:58 +08:00
Owner

Okay. Looks good - at least this code does. Can you send a similar PR in zynq-rs as well?

Okay. Looks good - at least this code does. Can you send a similar PR in zynq-rs as well?
sb10q merged commit 0d3f87c5bc into master 2024-03-25 16:12:20 +08:00
Author
Collaborator

Okay. Looks good - at least this code does. Can you send a similar PR in zynq-rs as well?

Will do.

> Okay. Looks good - at least this code does. Can you send a similar PR in zynq-rs as well? Will do.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nix-servo#53
No description provided.