Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glibc: fix cross compilation build failure #76972

Merged
merged 2 commits into from Jan 11, 2020

Conversation

@thefloweringash
Copy link
Member

@thefloweringash thefloweringash commented Jan 5, 2020

Motivation for this change

Fix cross compiled glibc which fails due to warnings. I don't know why these warnings only show up in cross compilation, but it lets us avoid a mass rebuild of glibc.

Tested on an x86_64 builder

  • pkgsCross.riscv64.hello
  • pkgsCross.aarch64-multiplatform.hello
  • pkgsCross.armv7l-hf-multiplatform.hello
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@thefloweringash thefloweringash force-pushed the thefloweringash:cross-glibc-warnings branch from 4240112 to 3aee042 Jan 5, 2020
@thefloweringash thefloweringash changed the title glibc: fix warnings during cross complation glibc: fix cross compilation build failure Jan 5, 2020
@thefloweringash
Copy link
Member Author

@thefloweringash thefloweringash commented Jan 5, 2020

This change fixes the symptoms, but I'm really not sure of the cause. Why is the gcc 8 warning only showing up now? There's also some overlap with the gdCflags.

@FRidh FRidh mentioned this pull request Jan 5, 2020
0 of 10 tasks complete
@thefloweringash thefloweringash force-pushed the thefloweringash:cross-glibc-warnings branch from 3aee042 to 8af88dd Jan 6, 2020
Copy link
Contributor

@lopsided98 lopsided98 left a comment

Fixes the build for me.

@Ma27
Copy link
Member

@Ma27 Ma27 commented Jan 11, 2020

This change fixes the symptoms, but I'm really not sure of the cause

I assume that this is due to the fact that we still have glibc 2.27 which was released >2 years ago (current version is 2.30) and it's just not "compatible" with newer compilers (the glibc 2.30 update is currently worked on in #66528).

Why is the gcc 8 warning only showing up now?

Just a wild guess, but perhaps nobody noticed? (it seems to occur only when cross-compiling and we had gcc7 by default for a long time).

@Ma27
Ma27 approved these changes Jan 11, 2020
Copy link
Member

@Ma27 Ma27 left a comment

As I didn't see that one before, I basically tried the same after getting notified in #77504 and this seems fine. But before merging, I'd prefer to wait for some more reviews :)

Copy link
Contributor

@flokli flokli left a comment

LGTM - however, it might be wiser to apply it for non-cross too - either here (and then target staging), or as a follow-up PR to staging once this PR is merged.

@Mindavi
Copy link
Contributor

@Mindavi Mindavi commented Jan 11, 2020

Wouldn't it be better to apply the patch for the OOB access? It seems like a fix that's easy to apply.

@flokli
Copy link
Contributor

@flokli flokli commented Jan 11, 2020

@Mindavi indeed - so this should fetchpatch https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=patch;h=9c79cec8cd2a6996a73aa83d79b360ffd4bebde6;hp=969c3355069215f1c1cad800a822d0b303fdc1fa unconditionally.

This was preventing a mass-rebuild by returning null. As of
5f2d96b it always returns a string.
@thefloweringash thefloweringash force-pushed the thefloweringash:cross-glibc-warnings branch 2 times, most recently from ae4eeb9 to 53a5b0c Jan 11, 2020
@thefloweringash thefloweringash changed the base branch from master to staging Jan 11, 2020
@thefloweringash
Copy link
Member Author

@thefloweringash thefloweringash commented Jan 11, 2020

Updating but patch doesn't apply. Hold on a moment while I sort this out.

@flokli
flokli approved these changes Jan 11, 2020
@flokli flokli merged commit 5e51524 into NixOS:staging Jan 11, 2020
15 checks passed
15 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
glibc on aarch64-linux Success
Details
glibc on x86_64-linux Success
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@thefloweringash
Copy link
Member Author

@thefloweringash thefloweringash commented Jan 11, 2020

@flokli sorry I got the backport wrong. Please revert this or see fixup PR.

thefloweringash added a commit to thefloweringash/nixpkgs that referenced this pull request Jan 11, 2020
@flokli
Copy link
Contributor

@flokli flokli commented Jan 11, 2020

Reverted 5101476 in cd827f2.

@thefloweringash thefloweringash deleted the thefloweringash:cross-glibc-warnings branch Jan 19, 2020
@nixos-discourse
Copy link

@nixos-discourse nixos-discourse commented Feb 5, 2020

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/january-2020-in-nixos/5771/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.