libacpi: fix compilation when cross building the tools
authorJulien Grall <julien.grall@arm.com>
Tue, 29 Nov 2016 15:00:48 +0000 (16:00 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 29 Nov 2016 15:00:48 +0000 (16:00 +0100)
commitd066b5b9ba8ca60b39127b3c9b1cd62a52307174
tree141f7b3f14d4c0377fa3bd0a6eb75235894487ba
parent6aaff7b407ca76dcfc4fe81f2afe9d1594cb0d6b
libacpi: fix compilation when cross building the tools

The tools (such as mk_dsdt) can be cross-built when it may not be
desirable to build them on the target.

The commit c4ac1077 "libxl/arm: Generate static ACPI DSDT table"
introduced support of ARM64 in mk_dsdt but also break cross-building
tools because the ACPI tables are not correct.

While mk_dsdt should generate ACPI table for the target architecture, it
currently generates the one for the host. This is because the source
code contains reference to the host architecture (__aarch64__,
__x86_64__, __i386__) when it should be the target architecture.

Replace all __aarch64__, __x86_64__, __i386__ by the corresponding
CONFIG_*.

Also expose the CONFIG_* to the source code as the currently only
exposed to the Makefile.

Reported-by: Andrii Anisov <andrii.anisov@gmail.com>
Suggested-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libacpi/Makefile
tools/libacpi/mk_dsdt.c