[Buildroot] [PATCH] gdb: fix sim support for ARM

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Thu Aug 4 22:20:06 UTC 2016


Hello,

On Sun, 31 Jul 2016 13:27:51 +0200, Waldemar Brodkorb wrote:

> +-/* TODO: Probably should just delete SIM_CPU.  */
> ++/* GCC 4.4 and older should not define this.  */
> ++#define GCC_VERSION (__GNUC__ * 10000 \
> ++                               + __GNUC_MINOR__ * 100 \
> ++                               + __GNUC_PATCHLEVEL__)
> ++#if __GCC_VERSION > 40400
> + typedef struct _sim_cpu SIM_CPU;
> ++#endif
> + typedef struct _sim_cpu sim_cpu;

This is not the proper fix, and will potentially break again the build
for architectures other than Blackfin, when built with gcc 4.4.x.

The core of the problem is a commit from Mike Frysinger that refactors
the definition of the SIM_CPU type into a common header file. However,
due to include ordering issues, Mike had to keep a redefinition of
SIM_CPU in the Blackfin specific header file. This is fine with recent
compiler versions with which you can redefine multiple times the same
type, but causes a build failures with older compilers.

However, not all architectures have their own redefinition of SIM_CPU,
so if you remove it for gcc 4.4.x and older, you will break the build
of those architectures when gcc 4.4.x or older is used.

So, I've instead committed a patch that reverts Mike's commit for both
7.10 and 7.11. I've tested the build of the simulator on Blackfin and
ARM, with modern and ancient compilers and it seems to have fixed the
problem.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list