I have a project that requires a low version of the gcc compiler to be installed on the Raspberry PI, and I have tried two approaches, neither of which has worked.
I tried two approaches.
The first option is to install gcc directly with apt, but the 5.5.0 version is not supported, so it is abandoned.
Second, download gcc-5.5.0 source code to try to compile and install, the error is as follows, I can't solve it.
Additional information: Raspberry PI uses the latest official system, gcc version 12.2.

How do you build image for your device ?
If you build by yocto, you can build SDK with it and install into your device
Or install on your Host PC and compile source then scp output to your device