January 9, 2022

Orange Pi 4 (Rockchip 3399) GCC notes

I do all of my ARM development on a linux desktop system. This system is a Fedora x86 machine (currently running Fedora 34).

I use the arm cross compilers that are provided as part of the Fedora package set.
The 64 bit compiler is provided by the following fedora packages:

gcc-aarch64-linux-gnu.x86_64
binutils-aarch64-linux-gnu.x86_64

The 32 bit compiler is provided by these packages:

gcc-arm-linux-gnu.x86_64
binutils-arm-linux-gnu.x86_64

The 32 bit arm and 64 bit arm use entirely different compilers. For 64 bit ARM, the compiler identifies itself (currently) as:

aarch64-linux-gnu-gcc (GCC) 11.2.1 20210728 (Red Hat Cross 11.2.1-1)
It (and its 32 bit brother) have always worked fine for me. Note that since I install these from the Fedora package system, they get updated automatically and unexpectedly. This is generally a good thing, but there have been surprises when code suddenly won't compile any longer.

Compiler surprises

The latest round of trouble was when the linker started complaining about multiply defined symbols. I had a symbol "cur_thread" that was referenced in many files. What gcc now wants is for it to be defined in just one file and every other reference needs to have an "extern" slapped onto the front of it.

What gcc says (as of GCC 10) is that -fno-common is now default behavior and requires this.


Have any comments? Questions? Drop me a line!

Tom's electronics pages / [email protected]