-
-
Notifications
You must be signed in to change notification settings - Fork 17.5k
Description
Nixpkgs version
- Unstable (25.05)
Describe the bug
When building a cross-stdenv for armv6-m, it is generally expected that the wrapped cc provided targets armv6-m. The wrapped cc provided through the stdenv does not though, and in fact targets armv6kz. Armv6kz is an extension of armv6, an arch that supports ARM and some extensions, while armv6-m is the thumb-only embedded architecture. This means that the armv6-m config generates ARM instructions, which cannot be executed on an armv6-m processor.
Steps to reproduce
- Use the following pkgs definition:
crossPkgs = import nixpkgs {
inherit currentSystem;
crossSystem.config = "armv6m-none-eabi";
};- Expose
crossPkgs.stdenv.cc - Run
$ NIX_DEBUG=1 armv6m-none-eabi-gcc
You can optionally objdump a trivial program and notice that the instructions are all 32-bit ARM instructions. If you force thumb decoding (arm-none-eabi-objdump -Mforce-thumb), they are invalid.
Expected behaviour
The extra flags before would be -march=armv6-m
Screenshots
objdump without force-thumb. The movne instruction does not exist in thumbv1, there are not enough bits to encode the "ne". And also notice the second column is 32-bits wide.

Relevant log output
Additional context
No response
System metadata
- system:
"x86_64-linux" - host os:
Linux 5.15.167.4-microsoft-standard-WSL2, NixOS, 25.05 (Warbler), 25.05.20250421.c11863f - multi-user?:
yes - sandbox:
yes - version:
nix-env (Nix) 2.28.1 - nixpkgs:
/nix/store/kcmmd6alr3lx56vkf72503h3pxgf6iv4-source
Notify maintainers
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)
I assert that this issue is relevant for Nixpkgs
- I assert that this is a bug and not a support request.
- I assert that this is not a duplicate of an existing issue.
- I assert that I have read the NixOS Code of Conduct and agree to abide by it.
Is this issue important to you?
Add a 👍 reaction to issues you find important.

