[SOLVED] How to determine the required CPU-family for the FPC cross- compiler? lazarus / 32-Linux ---------------------------------------------------------------------- Hartmut · 2023-04-29 08:57 I wrote a small "Hello world" program which runs on my linux computer with Intel CPU, but on a Linux server of a friend it shows this error message: root@HelmiNAS:/opt# ./test32 -ash: ./test32: cannot execute binary file: Exec format error root@HelmiNAS:/opt# ./test64 -ash: ./test64: cannot execute binary file: Exec format error (I compiled the program both as 32- and 64-bit because we are unsure which would be right). Can it be that we use the wrong CPU-family? The friend assumes that he has an ARM-CPU, but "uname -a" shows "aarch64": root@HelmiNAS:/opt# uname -a Linux HelmiNAS 4.4.180+ #42962 SMP Sat Apr 8 00:12:20 CST 2023 aarch64 GNU/Linux rtd1296 With which linux command can we find out, which is definitely the correct CPU-family to install the correct cross-compiler (arm or aarch64) and whether we need to compile as 64-bit or 32-bit? We are both beginners on Linux. Thanks in advance. ---------------------------------------------------------------------- wildfire · 2023-04-29 09:07 Quote from: Hartmut on April 29, 2023, 10:57:47 amCan it be that we use the wrong CPU-family? Yes QuoteThe friend assumes that he has an ARM-CPU, but "uname -a" shows "aarch64": aarch64 is ARM not Intel ---------------------------------------------------------------------- Hartmut · 2023-04-29 09:38 Thank you wildfire. But which cross-compiler do we have to install (arm or aarch64)? How can we determine this? ---------------------------------------------------------------------- wildfire · 2023-04-29 10:16 That's a tricky one, I myself am new to ARM & Linux It's likely to be AARCH64 but not definite. My Raspberry Pi is setup with a 64bit Kernel (AARCH64) but 32 bit userland, so it could be either or. What hardware and OS is your friend using? ---------------------------------------------------------------------- Hartmut · 2023-04-29 10:39 Quote from: wildfire on April 29, 2023, 12:16:05 pmWhat hardware and OS is your friend using? The friend does not know much about this for sure. With which linux commands can we find this out? ---------------------------------------------------------------------- MarkMLl · 2023-04-29 11:10 Quote from: Hartmut on April 29, 2023, 12:39:13 pmThe friend does not know much about this for sure. With which linux commands can we find this out? uname, and /proc/cpuinfo for the gory details. Also remember that you can inspect an executable file using the    file    command, but beyond that there is no good way of finding out the target processor of an arbitrary executable (i.e. the precise vector extensions it's been compiled for etc.). MarkMLl ---------------------------------------------------------------------- Hartmut · 2023-04-29 14:25 Quote from: wildfire on April 29, 2023, 12:16:05 pmWhat hardware and OS is your friend using? Quote from: MarkMLl on April 29, 2023, 01:10:23 pmQuote from: Hartmut on April 29, 2023, 12:39:13 pmThe friend does not know much about this for sure. With which linux commands can we find this out? uname, and /proc/cpuinfo for the gory details. Also remember that you can inspect an executable file using the    file    command... Thanks to wildfire and MarkMLl. Here come the results: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i root@HelmiNAS:/opt# uname -aLinux HelmiNAS 4.4.180+ #42962 SMP Sat Apr 8 00:12:20 CST 2023 aarch64 GNU/Linux rtd1296 Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i root@HelmiNAS:~# cat /proc/cpuinfoprocessor       : 0model name      : ARMv8 Processor rev 4 (v8l)BogoMIPS        : 54.00Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32CPU implementer : 0x41CPU architecture: 8CPU variant     : 0x0CPU part        : 0xd03CPU revision    : 4 processor       : 1model name      : ARMv8 Processor rev 4 (v8l)BogoMIPS        : 54.00Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32CPU implementer : 0x41CPU architecture: 8CPU variant     : 0x0CPU part        : 0xd03CPU revision    : 4 processor     : 2model name      : ARMv8 Processor rev 4 (v8l)BogoMIPS        : 54.00Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32CPU implementer : 0x41CPU architecture: 8CPU variant     : 0x0CPU part      : 0xd03CPU revision    : 4 processor       : 3model name      : ARMv8 Processor rev 4 (v8l)BogoMIPS        : 54.00Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32CPU implementer : 0x41CPU architecture: 8CPU variant     : 0x0CPU part        : 0xd03CPU revision    : 4 Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i root@HelmiNAS:~# file /var/packages/synocli- file/target/bin/mc/var/packages/synocli-file/target/bin/mc: 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, stripped root@HelmiNAS:~# file /usr/bin/ls/usr/bin/ls: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, strippedroot@HelmiNAS:~# Above 'mc' is a MidnightCommander which runs on this linux server. So again our question: which FPC cross-compiler do we have to install (arm or aarch64) to compile for this server? Above both is contained... (as said, we are beginners to that stuff) ---------------------------------------------------------------------- wildfire · 2023-04-29 16:13 Aarch64 Think of it as similar to x86 and amd64 You're using a 64bit Arm processor running in aarch64 mode. ---------------------------------------------------------------------- Hartmut · 2023-04-29 17:00 Quote from: wildfire on April 29, 2023, 06:13:48 pmYou're using a 64bit Arm processor running in aarch64 mode. Thank you very much wildfire for your answer.