is my linux ARM 32 or 64 bit?
under an intel I know I can look at the outcome of
uname -mto know if my OS is 32 or 64 bit, but under ARM this gives:
I deduced from
that I'm on a 32-bit OS, but how can I know this in an easier way?
arm 7 is 32 bit. `ARMv8-A architecture, announced in October 2011, adds support for a 64-bit address space and 64-bit arithmetic.` — wikipedia
I don't have access to an ARM machine but what is the output of `uname -a` and `gcc -v`? Those might be helpful.
`Announced October 2011, ARMv8-A (often called ARMv8 although not all variants are 64-bit such as ARMv8-R) represents a fundamental change to the ARM architecture. It adds a 64-bit architecture, named "AArch64", and a new "A64" instruction set. AArch64 provides user-space compatibility with ARMv7-A ISA, the 32-bit architecture, therein referred to as "AArch32" and the old 32-bit instruction set, now named "A32" ARM announced their Cortex-A53 and Cortex-A57 cores on 30 October 2012.` — http://en.wikipedia.org/wiki/ARM_architecture#64.2F32-bit_architecture
Arm was the last of the 32bit cpu to go 64bit (excluding those that died). Most went 64bit and then died, because of poor marketing — assuming that being better is enough. The Intel x86 was the second to last, though it was AMD that added 64 bit.
Also, 'getconf LONG_BIT' will spit out the # bits of the _OS_ (not necessarily the processor)
There are several gradations, since you can run a 32-bit or mixed operating system on a 64-bit-capable CPU. See 64-bit kernel, but all 32-bit ELF executable running processes, how is this? for a detailed discussion (written for x86, but most of it applies to arm as well).
You can find the processor model in
/proc/cpuinfo. For example:
$ cat /proc/cpuinfo Processor : ARMv7 Processor rev 10 (v7l)
ARMv7 (and below) is 32-bit. ARMv8 introduces the 64-bit instruction set.
If you want to see whether your system supports 64-bit binaries, check the kernel architecture:
$ uname -m armv7l
On a 64-bit processor, you'd see a string starting with
armv8(or above) if the
unameprocess itself is a 32-bit process, or
aarch64if it's a 64-bit process. (See also https://stackoverflow.com/questions/45125516/possible-values-for-uname-m)
I don't contest your answer, but unfortunately android IS A LINUX, so, there suppose to be some command, SOMEWHERE that show it locally and not to read a documentation on some page
@THESorcerer Android uses a Linux kernel but it is not a Linux system. It does not have Linux user land tools (only a very small subset). On Android, I think 64-bit support is consistent in the base OS, so `cat /proc/$$/maps` will let you know whether the system is 64-bit or 32-bit from an adb command line.
I believe Raspberry Pi 3, which is ARMv8 (CRC, no optional Crypto) will report `armv7l` even though its ARMv8. So I'm pretty sure the wrong CPU will be reported.
@jww If it reports `armv7l`, it means you're running a 32-bit kernel. You can run a 32-bit kernel on a 64-bit CPU. If you want information about the CPU, read `/proc/cpuinfo`.
uname -m just returns "aarch64". /proc/cpuinfo doesn't always contain a name for a processor either.