5

I'm trying to run an ARM64 binary on my RP4 with arm_64bit enabled in /boot/config.txt. I get an error: No such file or directory.

Running file cloudflared-linux-arm64 I get:

cloudflared-linux-arm64: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0 [truncated]

So the architecture is aarch64. Then I make sure this matches my system:

Linux <hostname> 5.10.17-v8+ #1403 SMP PREEMPT Mon Feb 22 11:37:54 GMT 2021 aarch64 GNU/Linux

So, it looks like they match. Then I run ldd:

$ ldd cloudflared-linux-arm64 
    not a dynamic executable

I think the problem is that the output of file says it wants to use the /lib/ld-linux-aarch64.so.1 interpreter, but that doesn't exist on my RP4. This is what I have:

ls /lib/ld-*
/lib/ld-linux-armhf.so.3  /lib/ld-linux.so.3

Does anyone know how to run binaries targeted for ARM64? This particular binary was compiled from Go, if that's helpful.

bertday
  • 161
  • 1
  • 6

2 Answers2

8

You are most likely using Raspbian with a 64-bit kernel and 32-bit userland.

You need to use a distribution with 64-bit kernel and 64-bit userland. The latest beta of Raspbian seems to work. See also: https://www.raspberrypi.org/forums/viewtopic.php?t=277116

Michael
  • 196
  • 2
4

The 64-bit Pi OS is available here and here (for the "lite" version). You must be using one of these if you intend to run 64-bit applications.

The kernel architecture has no direct impact on userland. A quick check for your current userland architecture can be done with:

dpkg-architecture --list
Dmitry Grigoryev
  • 28,277
  • 6
  • 54
  • 147