Installed binary distribution for Linux aarch64 - but cannot execute binaries

I’m running ubuntu-14.04 (yep, quite old). Architecture is aarch64:

$ uname -m
aarch64

I downloaded the binary installer script cmake-3.23.0-rc1-linux-aarch64.sh from the downloads page, and run that script. I can see that it’s installed binaries, but when I cd to the bin/ directory and try to run cmake, bash cannot find the executable:

$ cd cmake-3.22.2-linux-aarch64/bin
smc@smc-2:~/cmake-3.22.2-linux-aarch64/bin$ ls -l
total 81864
-rwx------ 1 smc smc 13337496 Jan 25 14:03 ccmake
-rwx--x--x 1 smc smc 13336832 Jan 25 14:03 cmake
-rwx------ 1 smc smc 28696776 Jan 25 14:03 cmake-gui
-rwx------ 1 smc smc 13729520 Jan 25 14:03 cpack
-rwx------ 1 smc smc 14714992 Jan 25 14:03 ctest
smc@smc-2:~/cmake-3.22.2-linux-aarch64/bin$ ./cmake --version
-bash: ./cmake: No such file or directory

Why would this be? I see the same error when trying to execute any of the binaries in the bin/ directory. Have I somehow installed the wrong architecture?
Thanks!

Your permissions look very odd. Can you try chmod 644 bin/* and chmod 755 bin/ (both from the top-level extracted directory)? I suspect other directories may need some help here.

1 Like

Thanks, just tried this, but get same error: -bash: bin/cmake: No such file or directory

$ chmod 644 bin/*
smc@smc-2:~/cmake-3.22.2-linux-aarch64$ ls -l bin
total 81864
-rw-r--r-- 1 smc smc 13337496 Jan 25 14:03 ccmake
-rw-r--r-- 1 smc smc 13336832 Jan 25 14:03 cmake
-rw-r--r-- 1 smc smc 28696776 Jan 25 14:03 cmake-gui
-rw-r--r-- 1 smc smc 13729520 Jan 25 14:03 cpack
-rw-r--r-- 1 smc smc 14714992 Jan 25 14:03 ctest
# bin/ files not executable
$ chmod 755 bin/*
smc@smc-2:~/cmake-3.22.2-linux-aarch64$ ls -l bin
total 81864
-rwxr-xr-x 1 smc smc 13337496 Jan 25 14:03 ccmake
-rwxr-xr-x 1 smc smc 13336832 Jan 25 14:03 cmake
-rwxr-xr-x 1 smc smc 28696776 Jan 25 14:03 cmake-gui
-rwxr-xr-x 1 smc smc 13729520 Jan 25 14:03 cpack
-rwxr-xr-x 1 smc smc 14714992 Jan 25 14:03 ctest
smc@smc-2:~/cmake-3.22.2-linux-aarch64$ bin/cmake
-bash: bin/cmake: No such file or directory
smc@smc-2:~/cmake-3.22.2-linux-aarch64$

Ah, sorry about the 644/755 thing. Hmm. I am starting to think that the “No such file or directory” is for the ELF interpreter. What is the output of readelf -l bin/cmake?

1 Like
$ readelf -l bin/cmake

Elf file type is EXEC (Executable file)
Entry point 0x438310
There are 10 program headers, starting at offset 64

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0x0000000000400040 0x0000000000400040
                 0x0000000000000230 0x0000000000000230  R E    8
  INTERP         0x0000000000000270 0x0000000000400270 0x0000000000400270
                 0x000000000000001b 0x000000000000001b  R      1
      [Requesting program interpreter: /lib/ld-linux-aarch64.so.1]
  LOAD           0x0000000000000000 0x0000000000400000 0x0000000000400000
                 0x0000000000c735c4 0x0000000000c735c4  R E    10000
  LOAD           0x0000000000c78940 0x0000000001088940 0x0000000001088940
                 0x000000000003eec8 0x000000000004cfd8  RW     10000
  DYNAMIC        0x0000000000cae218 0x00000000010be218 0x00000000010be218
                 0x0000000000000220 0x0000000000000220  RW     8
  NOTE           0x000000000000028c 0x000000000040028c 0x000000000040028c
                 0x0000000000000044 0x0000000000000044  R      4
  TLS            0x0000000000c78940 0x0000000001088940 0x0000000001088940
                 0x0000000000000000 0x0000000000000010  R      8
  GNU_EH_FRAME   0x0000000000ab68f4 0x0000000000eb68f4 0x0000000000eb68f4
                 0x000000000002b994 0x000000000002b994  R      4
  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  RW     10
  GNU_RELRO      0x0000000000c78940 0x0000000001088940 0x0000000001088940
                 0x00000000000376c0 0x00000000000376c0  R      1

 Section to Segment mapping:
  Segment Sections...
   00     
   01     .interp 
   02     .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn .rela.plt .init .plt .text .fini .rodata .eh_frame_hdr .eh_frame .gcc_except_table 
   03     .init_array .fini_array .data.rel.ro .dynamic .got .got.plt .data .bss 
   04     .dynamic 
   05     .note.ABI-tag .note.gnu.build-id 
   06     .tbss 
   07     .eh_frame_hdr 
   08     
   09     .init_array .fini_array .data.rel.ro .dynamic .got

Does /lib/ld-linux-aarch64.so.1 exist?

No it does not

It would seem that our binaries assume some newer environment than is available in Ubuntu 14.04. Out of curiosity, what interpreter is /usr/bin/ls using?

Sorry, I don’t understand the question about ‘interpreter’…

Running readelf -l /usr/bin/ls will have say something about which interpreter is being requested.

$

 readelf -l /bin/ls

Elf file type is EXEC (Executable file)
Entry point 0xba3d
There are 9 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  EXIDX          0x010b0c 0x00018b0c 0x00018b0c 0x00008 0x00008 R   0x4
  PHDR           0x000034 0x00008034 0x00008034 0x00120 0x00120 R E 0x4
  INTERP         0x000154 0x00008154 0x00008154 0x00019 0x00019 R   0x1
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
  LOAD           0x000000 0x00008000 0x00008000 0x10b18 0x10b18 R E 0x8000
  LOAD           0x010ef4 0x00020ef4 0x00020ef4 0x0041c 0x010ac RW  0x8000
  DYNAMIC        0x010f00 0x00020f00 0x00020f00 0x00100 0x00100 RW  0x4
  NOTE           0x000170 0x00008170 0x00008170 0x00044 0x00044 R   0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x10
  GNU_RELRO      0x010ef4 0x00020ef4 0x00020ef4 0x0010c 0x0010c R   0x1

 Section to Segment mapping:
  Segment Sections...
   00     .ARM.exidx 
   01     
   02     .interp 
   03     .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .ARM.exidx .eh_frame 
   04     .init_array .fini_array .jcr .dynamic .got .data .bss 
   05     .dynamic 
   06     .note.ABI-tag .note.gnu.build-id 
   07     
   08     .init_array .fini_array .jcr .dynamic

OK, so there’s a subtle difference between armhf and aarch64. This blog post covers the details (and more). It seems you have an aarch64 kernel with armhf userspace. This will not work, so you’ll need to get an aarch64 userspace somehow. It also looks like this predates Debian’s multiarch effort, so I don’t know if they are co-installable.

You can also just build CMake from source; this is probably the best option in this case.

1 Like