Skip to content

picolibc: init at 1.8.9#395318

Merged
2 commits merged intoNixOS:masterfrom
RossSmyth:initPicolibc
Apr 8, 2025
Merged

picolibc: init at 1.8.9#395318
2 commits merged intoNixOS:masterfrom
RossSmyth:initPicolibc

Conversation

@RossSmyth
Copy link
Contributor

@RossSmyth RossSmyth commented Apr 1, 2025

Things done

Added Picolibc with configuration options.

Closes #368022

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Also tested:

  • nix-build -A pkgsCross.arm-embedded.picolibc
  • nix-build -A pkgsLLVM.picolibc
    - nix-build -A pkgsCross.arm-embedded.pkgsLLVM.picolibc (unsure if this is the right incantation?)

TODO (future PRs):

  • Get tests running under emulated embedded arm (I have it building, but it overflows the "flash")
  • Get this hooked up so it can be used as a libc

Add a 👍 reaction to pull requests you find important.

@RossSmyth
Copy link
Contributor Author

I put the meson options because they are pretty important to be able to fiddle with for embedded devs, so this makes them easier to do so.

@RossSmyth RossSmyth force-pushed the initPicolibc branch 2 times, most recently from d713e8d to 8f5d341 Compare April 2, 2025 00:14
@github-actions github-actions bot added 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 2, 2025
@RossSmyth
Copy link
Contributor Author

  • nix-build -A pkgsCross.arm-embedded.pkgsLLVM.picolibc (unsure if this is the right incantation?)

Or at least it did...running it at home the stdenv fails to build :/

@RossSmyth
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 395318


x86_64-linux

✅ 2 packages built:
  • picolibc
  • picolibc.dev

@RossSmyth RossSmyth requested a review from a team April 3, 2025 14:30
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Something more in passthru.tests would be nice. Maybe build GNU hello against picolibc and show that it works. Otherwise looks fine to me.

@kuruczgy
Copy link
Contributor

kuruczgy commented Apr 6, 2025

I like the idea, would be cool if picolibc could be used just like any other libc in nixpkgs (with isNone platforms)

Get this hooked up so it can be used as a libc

FYI you will probably run into libc++ (or probably libstdc++ too, I only tried llvm) expecting features that picolibc cannot provide (e.g. a clock).

You might find it useful to look at my PR attempting to address this, and the discussions there: #352629

(Unfortunately I don't have the time to work on it right now, feel free to cannibalize parts of it if they are useful and you are working on a more comprehensive solution.)

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Apr 6, 2025
@RossSmyth
Copy link
Contributor Author

RossSmyth commented Apr 7, 2025

Is there an equivalent to hello for embedded environments? Because it doesn't build with pkgsCross.arm-embedded.hello. I tried to do it for just the x86 linux and haven't been able to figure out how to wire it up yet.

@ghost
Copy link

ghost commented Apr 8, 2025

If its useful then tests will happen.

@RossSmyth RossSmyth deleted the initPicolibc branch April 8, 2025 15:47
@Ericson2314
Copy link
Member

We can rig this up, but I can't help with that until after Nix 2.28 for Nixpkgs 25.05 is good to go.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package request: picolibc

4 participants