gcc: fix inconsistency in isCross condition#389469
Merged
K900 merged 3 commits intoNixOS:masterfrom Mar 13, 2025
Merged
Conversation
In libgcc.nix, `targetPlatformSlash` is set by checking if hostPlatform == targetPlatform. In default.nix, `targetConfig` (which is also going to be part of the path) is also set by checking if hostPlatform == targetPlatform. However, in common.nix, the recently added `isCross` is set by checking if hostPlatform.config == targetPlatform.config. This means that for platforms like '-nolibc' the paths in common.nix are not set up correctly for libgcc.nix to find and move libgcc_s.so . Changing isCross to also check hostPlatform == targetPlatform fixes this issue.
539fbd0 to
54849e2
Compare
K900
reviewed
Mar 13, 2025
|
|
||
| let | ||
| forceLibgccToBuildCrtStuff = import ./libgcc-buildstuff.nix { inherit lib stdenv; }; | ||
| isCross = with stdenv; targetPlatform.config != hostPlatform.config; |
Contributor
There was a problem hiding this comment.
These really should be lib.systems.equals, all of them, now that I think about it.
Member
Author
There was a problem hiding this comment.
Just those three or everything in gcc? A quick git grep 'Platform *[!=]=' | wc -l inside pkgs/development/compilers/gcc gives me 40 hits.
Contributor
There was a problem hiding this comment.
Generally, all of them in nixpkgs, technically...
Member
Author
There was a problem hiding this comment.
Sure, but I don't want to let this single line change scope creep into doing a treewide update.
I've replaced things inside gcc, a simple rebuild of nix-build -A gcc was a no-op, but I'm not sure how to test this properly.
b705345 to
d8634f9
Compare
Member
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.
In libgcc.nix,
targetPlatformSlashis set by checking if hostPlatform == targetPlatform. In default.nix,targetConfig(which is also going to be part of the path) is also set by checking if hostPlatform == targetPlatform.However, in common.nix, the recently added
isCrossis set by checking if hostPlatform.config == targetPlatform.config. This means that for platforms like '-nolibc' the paths in common.nix are not set up correctly for libgcc.nix to find and move libgcc_s.so .Changing isCross to also check hostPlatform == targetPlatform fixes this issue.
Followup to #380325 .
Fixes #383914 (comment) .
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.