Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Mar 19, 2022

Description of changes

This commit adds the linker flag "-melf64ltsmip" to statically-linked cross-builds of nix>=2.4 targeting mips64el. Without this linker flag, statically linked mips64el-linux-musl cross-builds of nix>=2.4 fail linking libutil:

     mips64el-unknown-linux-musl-ld: failed to merge target specific data of file src/libutil/xml-writer.o
     mips64el-unknown-linux-musl-ld: attempt to do relocatable link with elf64-tradlittlemips input and elf32-ntradlittlemips output
     mips64el-unknown-linux-musl-ld: src/libutil/affinity.o: file class ELFCLASS64 incompatible with ELFCLASS32
     mips64el-unknown-linux-musl-ld: final link failed: file in wrong format
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • 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/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

…s64el

This commit adds the linker flag "-melf64ltsmip" to statically-linked
cross-builds of nix>=2.4 targeting mips64el.  Without this linker flag,
statically linked mips64el-linux-musl cross-builds of nix>=2.4 fail
linking libutil:

 mips64el-unknown-linux-musl-ld: failed to merge target specific data of file src/libutil/xml-writer.o
 mips64el-unknown-linux-musl-ld: attempt to do relocatable link with elf64-tradlittlemips input and elf32-ntradlittlemips output
 mips64el-unknown-linux-musl-ld: src/libutil/affinity.o: file class ELFCLASS64 incompatible with ELFCLASS32
 mips64el-unknown-linux-musl-ld: final link failed: file in wrong format
@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 Mar 19, 2022
@ghost ghost mentioned this pull request Mar 21, 2022
13 tasks
@ghost ghost mentioned this pull request Apr 6, 2022
6 tasks
@ghost
Copy link
Author

ghost commented Apr 6, 2022

Closed in favor of #167489, which uses Debian's binutils patch, and which will resolve this issue if it comes up for any other packages.

@ghost ghost closed this Apr 6, 2022
@ghost ghost deleted the nix-mips64el-melf64ltsmip branch January 23, 2024 06:46
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