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

Support 32 bits applications on 64 bits systems #28

Open
tobiasBora opened this issue Sep 5, 2022 · 5 comments
Open

Support 32 bits applications on 64 bits systems #28

tobiasBora opened this issue Sep 5, 2022 · 5 comments

Comments

@tobiasBora
Copy link

As far as I understand, in most cases 32 bits applications should work on 64 bits systems. However the nixos module creates a single folder /lib64 making it unable to run 32 bits applications.

The discussion was started here #27

@inflation
Copy link

Another thing is running x86_64 applications under Rosetta 2 in a VM. I could fetch an x86_64 version of nix-ld and manually symlink to /lib64/ld-linux-x86-64.so.2 and runs the application fine. It would be great to be configurable somehow.

@KoviRobi
Copy link

I have something working, see NixOS/nixpkgs#326948

Though nix-ld (as opposed to nix-ld-rs) has an issue with environment variables that are not possible to set:

cannot execute /lib/ld-linux.so.2: You are trying to run an unpatched binary on nixos, but you have not configured NIX_LD or NIX_LD_i686-linux. See https://github.com/Mic92/nix-ld for more details

because of the hyphen-minus (-) which should be an underscore (_), perhaps

https://github.com/Mic92/nix-ld/blob/bf5aa84a713c31d95b4307e442e966d6c7fd7ae7/nix-ld.nix#L22

should use

builtins.replaceStrings ["-"] ["_"] stdenv.system

See also nix-community/nix-ld-rs#67

@Mic92
Copy link
Member

Mic92 commented Jul 14, 2024

Would it help if we would merge nix-ld-rs into nix-ld and make it the new implementation? This was at least my plan.

@KoviRobi
Copy link

It would, I'm successfully using nix-ld-rs with 32-bit software, though I just tried and fixing the environment variables also makes this nix-ld work with the nixpkgs patch above. But I certainly understand not wanting to have to maintain both at the same time.

@Mic92
Copy link
Member

Mic92 commented Jul 14, 2024

I merged nix-ld-rs into nix-ld now.

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

4 participants