Skip to content

gcc: if hostPlatform.isPower64, configure with "--with-long-double-64"#170402

Closed
ghost wants to merge 2 commits intomasterfrom
unknown repository
Closed

gcc: if hostPlatform.isPower64, configure with "--with-long-double-64"#170402
ghost wants to merge 2 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Apr 26, 2022

Update 2022-Apr-28: I think we have a working combination here, and pkgsStatic now interacts correctly with the rest of nixpkgs, the way it does on arm64 and x86, with no weird link failures. Still marked as draft while I finish rebuilding the world and use this for a while on my workstation.

This PR builds on #169378 (first five commits) and #170400 (second-to-last commit). Only the final commit is unique to this PR.

Description of changes

This commit causes powerpc*-*-gnu to be configured with 64-bit long double (the same as ordinary double) rather than the nonstandard, non-IEEE "IBM double" format from AIX.

This hopefully resolves a large number of package test failures caused by weird nonstandard floating-point semantics.

There is a rather long comment included in gcc/common/platform-flags.nix explaining the situation and the reasoning.

Things done
  • Built on platform(s)
    • powerpc64le-linux
    • x86_64-linux (in progress)
    • aarch64-linux (in progress)
    • mips64le-linux (in progress)
    • x86_64-darwin
    • aarch64-darwin
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

A bug in libgcc which manifests when building static binaries using
musl-libc was fixed in gcc 11.1.0, but the fix has not been backported
to gcc 10.  This commit cherry-picks the commit from upstream and
applies it in the case (isPower64 && isMusl) where it matters:

  https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=cda41ce0e8414aec59e6b9fbe645d96e6e8193e2
@ghost
Copy link
Author

ghost commented Apr 26, 2022

Alright, ::crosses fingers::

@ofborg build pkgsCross.powernv.pkgsStatic.nix_2_4

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Apr 26, 2022
This commit causes powerpc*-*-gnu to be configured with 64-bit `long
double` (the same as ordinary `double`) rather than the nonstandard,
non-IEEE "IBM double" format from AIX.  Support for using only IEEE
128-bit doubles in glibc is not yet ready.

This resolves a large number of package test failures caused by weird
nonstandard floating-point semantics.

There is a long comment included in gcc/common/platform-flags.nix
explaining the situation and the reasoning.
@ghost
Copy link
Author

ghost commented Apr 27, 2022

Getting gcc, mpfr, and glibc to play nice together with anything other than the nonstandard IBM doubles is a major struggle. I'm shelving this for now and will simply mark packages with doCheck=false where the tests fail due to nonstandard floating point weirdness.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants