[sim] Fix mbuild build breaker in sim-cpu.c
authorTom de Vries <tdevries@suse.de>
Mon, 10 Aug 2020 15:26:09 +0000 (17:26 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 10 Aug 2020 15:26:09 +0000 (17:26 +0200)
commitb3f8962bdb903bf8bc37935c189b3b32ad667c0b
tree2969b6d041fc19efb2633210c0bf655e40452b68
parentf7cb161ea6ffee167de3126023b2ce0fffd84076
[sim] Fix mbuild build breaker in sim-cpu.c

When running gdb/gdb_mbuild.sh, I run into:
...
src/sim/aarch64/../common/sim-cpu.c: In function 'sim_cpu_free':
src/sim/aarch64/../common/sim-cpu.c:64:3: error: implicit declaration of \
  function 'free' [-Werror=implicit-function-declaration]
   free (cpu);
   ^~~~
src/sim/aarch64/../common/sim-cpu.c:64:3: error: incompatible implicit \
  declaration of built-in function 'free' [-Werror]
src/sim/aarch64/../common/sim-cpu.c:64:3: note: include '<stdlib.h>' or \
  provide a declaration of 'free'
...

Fix this by adding "#include <stdlib.h>".

Tested by gdb/gdb_mbuild.sh -e aarch64-elf.

sim/common/ChangeLog:

2020-08-10  Tom de Vries  <tdevries@suse.de>

* sim-cpu.c: Include stdlib.h for free.
sim/common/ChangeLog
sim/common/sim-cpu.c