[SOLVED] AArch64 running x86-64 binaries using qemu-system

Ask questions about Arch Linux ARM. Please search before making a new topic.

[SOLVED] AArch64 running x86-64 binaries using qemu-system

Postby Luca91 » Mon Apr 17, 2023 9:44 pm

Hi all,
today I created an ArchLinuxArm VM using ArchBoot in my MacBook with M1 (Apple Silicon).
I need to run a couple of binaries built for x86-64 so I installed qemu-user and qemu-user-binfmt, but when I try to run any x86-64 executable I get:
$this->bbcode_second_pass_code('', 'qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory')

I'm a bit confused as this is the first time I'm trying to emulate something using qemu-user.
How should I install the required x86-64 libraries? Is there any package that provide them?

Thanks a lot,
Luca
Last edited by Luca91 on Thu Apr 20, 2023 9:30 am, edited 1 time in total.
Luca91
 
Posts: 6
Joined: Sun Feb 09, 2020 6:44 pm

Re: AArch64 running x86-64 binaries using qemu-system

Postby robg » Wed Apr 19, 2023 1:21 pm

Could you please post the exact steps (commands) you took to run the x86-64 binary?
robg
 
Posts: 194
Joined: Tue Jan 05, 2021 8:22 am

Re: AArch64 running x86-64 binaries using qemu-system

Postby Luca91 » Wed Apr 19, 2023 3:21 pm

Hi robg thank you for your reply.
Sure, here is what I did.

1) Install those two packages using pacman: $this->bbcode_second_pass_code('', 'sudo pacman -S qemu-user qemu-user-binfmt')
2) Download and unzip the x86-64 app that I need to run
3) Launch this app using: ./appname

Nothing special, really. I think that I have to install the corresponding x86-64 libs, so qemu can use them, but I can't find the right package tho.
Luca91
 
Posts: 6
Joined: Sun Feb 09, 2020 6:44 pm

Re: AArch64 running x86-64 binaries using qemu-system

Postby Luca91 » Thu Apr 20, 2023 9:29 am

SOLVED!

What I did was manually download glibc-2.37 package from official ArchLinux repo and extract that .so library in /lib64.

In the future, I'd like to see a better way to get x86-64 dependencies from ArchLinuxArm. I think it would help a lot in these situations. ;)
Luca91
 
Posts: 6
Joined: Sun Feb 09, 2020 6:44 pm

Re: [SOLVED] AArch64 running x86-64 binaries using qemu-syst

Postby robg » Thu Apr 20, 2023 10:20 am

Glad you got it working!

I am not sure we have gotten to the bottom of the actual issue though. Can you perhaps try if the executable runs properly when you install qemu-user-static and qemu-user-binfmt-static (instead of the non-static flavor)?

It is weird that the x86-linker is not provided by any QEMU package. For example, this is not the case for x86 (32bit) emulation where the linker is part of the qemu-system-x86 package.
robg
 
Posts: 194
Joined: Tue Jan 05, 2021 8:22 am

Re: [SOLVED] AArch64 running x86-64 binaries using qemu-syst

Postby Luca91 » Thu Apr 20, 2023 11:01 am

Hi robg,
qemu-user-static and qemu-user-binfmt-static are not available on the repository, that's why I installed the non-static version.
Luca91
 
Posts: 6
Joined: Sun Feb 09, 2020 6:44 pm

Re: [SOLVED] AArch64 running x86-64 binaries using qemu-syst

Postby robg » Thu Apr 20, 2023 5:54 pm

Alas, I now recall that the QEMU packages on ALARM got garbled last year due to some difficult-to-port changes upstream. Apparently this is still unresolved.

I seems then that your solution is for the moment the only viable one. Thanks again for sharing!
robg
 
Posts: 194
Joined: Tue Jan 05, 2021 8:22 am


Return to User Questions

Who is online

Users browsing this forum: No registered users and 41 guests