nix-community / nix-ld

Run unpatched dynamic binaries on NixOS [maintainer=@Mic92]
MIT License
935 stars 14 forks source link

Dynamic linking for `boot.binfmt.emulatedSystems` #48

Open peterwaller-arm opened 1 year ago

peterwaller-arm commented 1 year ago

nix-ld is nice, thanks for putting it together!

I was wondering if it would be possible to make it work for emulated binaries. The current failure (running an aarch64-linux dynamically linked binary on an x86_64-linux box) is:

qemu-aarch64: Could not open '/lib/ld-linux-aarch64.so.1': No such file or directory

I'd need some way of pulling in the binaries for the libraries on the alternative system and support from nix-ld somewhere. Does it seem possible?

Mic92 commented 1 year ago

yes. I think the nixos module could be extended to also to take boot.binfmt.emulatedSystems into account.