3

The August 2020 version of Raspberry Pi OS ships with arm-linux-gnueabihf-gcc-8. Checking arm-linux-gnueabihf-gcc-8 -v I see that it has this option set: --with-arch=armv6. However, the new Raspberry Pi 4 comes with an ARMv7 processor.

Why does the operating system come with a compiler that will build programs for an older ARM version? Is it because the OS itself is compiled for ARMv6?

David
  • 723
  • 5
  • 22

1 Answers1

2

Is it because the OS itself is compiled for ARMv6?

Yes.

Why...

The same reason the OS is compiled for ARMv6: Because it is intended for use on all models, including the ARMv6 Zeros, etc.

There is probably not much point in using an ARMv7 compiler on an ARMv6 system regardless of the underlying hardware. The system libraries and kernel are ARMv6.

Also worth noting that the version of ARMv6 used is (no expert, but pretty sure), not that much different from ARMv7. When the ARMv7 model came out, some people were eager to prove that using an ARMv7 kernel and OS was faster than using the ARMv6 one, but I do not think that panned out -- which is part of the reason adoption of the ARMv7 distros was lackluster, and more about people having different flavours as options, not performance (many distros already had ARMv7 repos but few have ARMv6; Raspbian was originally a repackaging of Debian ARMv6).

goldilocks
  • 60,325
  • 17
  • 117
  • 234