lib.systems: Add arm-embedded-nano#392204
Merged
mkg20001 merged 1 commit intoNixOS:masterfrom Apr 5, 2025
Merged
Conversation
Newlib-nano variant of the arm-embedded stdenv.
Member
RossComputerGuy
left a comment
There was a problem hiding this comment.
pkgsCross.arm-embedded-nano.stdenv builds fine on aarch64-linux. However, pkgsCross.arm-embedded-nano.hello fails:
hello> checking whether the C compiler works... no
hello> configure: error: in `/build/hello-2.12.1':
hello> configure: error: C compiler cannot create executables
hello> See `config.log' for more details
In config.log:
/nix/store/3v0cyab13cj668v1ywh2ywf9sxh82fzc-arm-none-eabi-binutils-2.43.1/bin/arm-none-eabi-ld: warning: -z relro ignored
/nix/store/3v0cyab13cj668v1ywh2ywf9sxh82fzc-arm-none-eabi-binutils-2.43.1/bin/arm-none-eabi-ld: /nix/store/hrxwq72pyk4pnyprgi4n9a94syh69wqw-newlib-arm-none-eabi-4.5.0.20241231
/arm-none-eabi/lib/libc.a(libc_a-exit.o): in function `exit':
/build/newlib-4.5.0.20241231/arm-none-eabi/newlib/../.././newlib/libc/stdlib/exit.c:65:(.text+0x3c): undefined reference to `_exit'
/nix/store/3v0cyab13cj668v1ywh2ywf9sxh82fzc-arm-none-eabi-binutils-2.43.1/bin/arm-none-eabi-ld: /nix/store/hrxwq72pyk4pnyprgi4n9a94syh69wqw-newlib-arm-none-eabi-4.5.0.20241231
/arm-none-eabi/lib/libc.a(libc_a-closer.o): in function `_close_r':
/build/newlib-4.5.0.20241231/arm-none-eabi/newlib/../.././newlib/libc/reent/closer.c:47:(.text+0x24): undefined reference to `_close'
/nix/store/3v0cyab13cj668v1ywh2ywf9sxh82fzc-arm-none-eabi-binutils-2.43.1/bin/arm-none-eabi-ld: /nix/store/hrxwq72pyk4pnyprgi4n9a94syh69wqw-newlib-arm-none-eabi-4.5.0.20241231
/arm-none-eabi/lib/libc.a(libc_a-lseekr.o): in function `_lseek_r':
/build/newlib-4.5.0.20241231/arm-none-eabi/newlib/../.././newlib/libc/reent/lseekr.c:49:(.text+0x30): undefined reference to `_lseek'
/nix/store/3v0cyab13cj668v1ywh2ywf9sxh82fzc-arm-none-eabi-binutils-2.43.1/bin/arm-none-eabi-ld: /nix/store/hrxwq72pyk4pnyprgi4n9a94syh69wqw-newlib-arm-none-eabi-4.5.0.20241231
/arm-none-eabi/lib/libc.a(libc_a-readr.o): in function `_read_r':
/build/newlib-4.5.0.20241231/arm-none-eabi/newlib/../.././newlib/libc/reent/readr.c:49:(.text+0x30): undefined reference to `_read'
/nix/store/3v0cyab13cj668v1ywh2ywf9sxh82fzc-arm-none-eabi-binutils-2.43.1/bin/arm-none-eabi-ld: /nix/store/hrxwq72pyk4pnyprgi4n9a94syh69wqw-newlib-arm-none-eabi-4.5.0.20241231
/arm-none-eabi/lib/libc.a(libc_a-writer.o): in function `_write_r':
/build/newlib-4.5.0.20241231/arm-none-eabi/newlib/../.././newlib/libc/reent/writer.c:49:(.text+0x30): undefined reference to `_write'
/nix/store/3v0cyab13cj668v1ywh2ywf9sxh82fzc-arm-none-eabi-binutils-2.43.1/bin/arm-none-eabi-ld: /nix/store/hrxwq72pyk4pnyprgi4n9a94syh69wqw-newlib-arm-none-eabi-4.5.0.20241231
/arm-none-eabi/lib/libc.a(libc_a-sbrkr.o): in function `_sbrk_r':
/build/newlib-4.5.0.20241231/arm-none-eabi/newlib/../.././newlib/libc/reent/sbrkr.c:51:(.text+0x24): undefined reference to `_sbrk'
collect2: error: ld returned 1 exit status
Contributor
Author
|
When using newlib-nano those symbols are not defined, and are meant to be user-defined (or not defined at all). The use case is generally something like defining them to output to a serial port when building a program for a microcontroller. So that is expected. |
RossComputerGuy
approved these changes
Mar 26, 2025
Contributor
Author
|
I double checked just to make sure, I tested it before with crossPkgs = import nixpkgs {
localSystem = pkgs.stdenv.buildPlatform;
crossSystem = {
config = "arm-none-eabi";
libc = "newlib-nano";
};
};and |
Contributor
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Newlib-nano variant of the arm-embedded stdenv.
Reasoning:
#385908 was denied because of pkgsCross. But the problem is that the
arm-embeddedpkgsCross toolchain does not use newlib nano. It would be nice to fill the gap and have a toolchain that is cached that has newlib-nano for embedded developers (like me).I would prefer that it is a multilib, but it seems the multilib cross toolchains are broken, and an assert was added recently to ensure they aren't added in #380325.
#51907
#111321
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.