Compile ArduCopter 3.2.1 with latest GCC version (v5.4) UBUNTU

Hello everyone,
I am trying to build branch ArduCopter 3.2.1 using MAKE, but apparently the code is not compatible with compiler (avr-gcc (GCC) 5.4.0; gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0) or I am missing something in MAKE configure.
build finishes with many error for example:



Does someone know how to make build to work in these conditions
Thanks in advance

Build succeeded!
Finally I got to compile and upload the “hex” to my APM2x. For those, who still working with APM2x but under recent Linux distro (probably with latest compilers), the solution is to run an old version of arduino IDE (I am using 1.6.0 which includes avr-gcc 4.8.1) to use the compiler included in the software. A few changes in the build system (Make) are necessary. Last, in order to upload the “hex” file to the board a newer version of “avrdude” is required (I am using one of the latest version from arduino 1.8.19) and that’s all…