nss: fix building for aarch32 on aarch64 #87748
Merged
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.
Motivation for this change
There are two ways to build a package for aarch32 on an aarch64 machine:
Previously, NSS failed to build with both methods: when using extraPlatforms, things failed because NSS includes an armv8-specific file (presumably based on the result of
uname
); when cross compiling, NSS's build system expects to receive an architecture name ofarm
(notarmv6l
or whatever), so was failing to include some arch-specific code and failed with a linker error. Although my examples used armv6l, these issues occur on armv7l as well.This PR fixes those things by a) always passing the arch, even when not cross-compiling, and b) special-cases aarch32 to always pass in an arch of
arm
.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)