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

arm64 non-NixOS support on amd64? #70

Open
ghagl opened this issue Feb 3, 2024 · 1 comment
Open

arm64 non-NixOS support on amd64? #70

ghagl opened this issue Feb 3, 2024 · 1 comment

Comments

@ghagl
Copy link

ghagl commented Feb 3, 2024

Hi!

I have binfmt working on my NixOS installation and it works for cross-compiled NixOS binaries, but not for non-NixOS aarch64 binaries. I think nix-ld should work for this purpose, but I am not sure how?

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

My try:
programs.nix-ld.libraries = with pkgs; [ pkgsCross.aarch64-multiplatform.glibc ];

@Mic92
Copy link
Member

Mic92 commented Feb 8, 2024

The NixOS module in its current form only installs the ld.so for the native architecture:

ls -la /lib64/ld-linux-x86-64.so.2
lrwxrwxrwx root root 68 B 5 days ago  /lib64/ld-linux-x86-64.so.2@ ⇒ /nix/store/9bj6838cs8cw4yi4vzgigkwgsv5h1zbd-nix-ld-rs/libexec/nix-ld

You would need to compile nix-ld for aarch64 and than extend the module to also take care of the system link. Cross-compiling nix-ld should be fairly easy. The existing binfmt_misc options could be used to figure out what architecture to compile for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants