Skip to content

bintools-wrapper: fix dynamic linker for powerpc64 big-endian#247682

Merged
Artturin merged 1 commit intoNixOS:masterfrom
minijackson:fix-ppc64be-linker
Sep 11, 2023
Merged

bintools-wrapper: fix dynamic linker for powerpc64 big-endian#247682
Artturin merged 1 commit intoNixOS:masterfrom
minijackson:fix-ppc64be-linker

Conversation

@minijackson
Copy link
Member

Description of changes

This fixes #245162.

I also tested this change in the same file:

    dynamicLinker =
-     /**/ if sharedLibraryLoader == null then ""
+     /**/ if sharedLibraryLoader == null then null
...
-     else "";
+     else null;

Which is a partial revert of 238a605, which worked, but I don't know the use behind that change (@Artturin) so I'm just proposing this quick fix.

Here's the test file I'm using:

let
  nixpkgs = ./.;

  pkgs = import nixpkgs {};
  inherit (pkgs) lib;

  crossSystem = lib.systems.examples.ppc64;

  pkgsCross = import nixpkgs {
    inherit crossSystem;
  };

  inherit (pkgsCross) hello;
  emulator = (lib.systems.elaborate crossSystem).emulator pkgs;
in
  pkgs.runCommand "test-cross" {} ''
    ${emulator} ${hello}/bin/hello | tee $out
  ''

Things done

  • Built on platform(s)
    • cross x86_64-linux -> ppc64
    • cross x86_64-linux -> powernv
    • 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/)
  • Fits CONTRIBUTING.md.

@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 Aug 7, 2023
@Artturin Artturin requested a review from a user August 29, 2023 20:41
Copy link
Contributor

@OPNA2608 OPNA2608 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested by cross-compiling hello for powerpc64-unknown-linux-gnuabielfv1 & powerpc64-unknown-linux-gnuabielfv2, copying the closures to my powerpc64-linux machine and executing both there: Works fine.

@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one person. label Sep 11, 2023
@Artturin Artturin merged commit bb446a1 into NixOS:master Sep 11, 2023
@github-actions
Copy link
Contributor

Successfully created backport PR for release-23.05:

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. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong ELF interpreter for cross-compiled PowerPC 64 big-endian

4 participants