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

binutils: apply debian's patch if isMips64n64 #167489

Merged
merged 1 commit into from Apr 11, 2022
Merged

binutils: apply debian's patch if isMips64n64 #167489

merged 1 commit into from Apr 11, 2022

Conversation

ghost
Copy link

@ghost ghost commented Apr 6, 2022

Description of changes

Upstream binutils is missing sensible defaults for a few flags (notably linker personality) when cross-compiling to mips64el-*-*abi64.

Most of the time this isn't an issue because packages that invoke the linker directly detect the flags from gcc's behavior (for example, libtool does this) and gcc has good code for detecting the right defaults. However some do not; notably nix, itself lacks this.

Presumably Debian is working on upstreaming this, and has more clout than we do. I propose we carry their patch in the meantime. The patch is conditioned on stdenv.targetPlatform.isMips64n64 in order to avoid mass-rebuilds.

This plus #161162 can build nix_2_4 natively and can cross-build pkgsCross.mips64el-linux-gnuabi64.pkgsStatic.nix_2_4 from x86_64.

Things done
  • Built on platform(s)
    • x86_64-linux
    • mips64el-linux-muslabi64 (cross from x86_64-linux)
    • mips64el-linux-gnuabi64 (cross from x86_64-linux)
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Upstream binutils is missing sensible defaults for a few flags
(notably linker personality) when cross-compiling to
mips64el-*-*abi64.

Most of the time this isn't an issue because packages that invoke the
linker directly detect the flags from gcc's behavior (for example,
libtool does this) and gcc has good code for detecting the right
defaults.  However some do not; notably nix, itself lacks this.

Presumably Debian is working on upstreaming this, and has more clout
than we do.  I propose we carry their patch in the meantime.  The
patch is conditioned on stdenv.targetPlatform.isMips64n64 in order to
avoid mass-rebuilds.

Closes #164835.
@ghost ghost marked this pull request as ready for review April 6, 2022 08:58
@SuperSandro2000 SuperSandro2000 merged commit d3684f7 into NixOS:master Apr 11, 2022
@ghost ghost deleted the binutils-apply-debian-patch branch April 12, 2022 01:31
@Mindavi Mindavi added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on 10.rebuild-darwin: 0 10.rebuild-linux: 0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants