Silent UB alignment issues in acpica under kUBSan

Pass -DACPI_MISALIGNMENT_NOT_SUPPORTED under kUBSan enabled. This option
is dedicated for alignment sensitive CPUs in acpica. It was originally
designed for Itanium CPUs, but nowadays it's wanted for aarch64 as well.

Define it in acpica code under kUBSan in order to pacify Undefined Behavior
reports on all ports (in particular x86). The number of reports is now
halved with this patch applied. The remaining alignment alarms in acpica
will be addressed in future.

Patch contributed by <Akul Pillai>
This commit is contained in:
kamil 2019-02-13 18:04:35 +00:00
parent 075cfd7e0e
commit e807f4b65a

View File

@ -1,4 +1,4 @@
# $NetBSD: files.kern,v 1.31 2019/01/27 02:08:43 pgoyette Exp $
# $NetBSD: files.kern,v 1.32 2019/02/13 18:04:35 kamil Exp $
#
# kernel sources
@ -228,3 +228,4 @@ prefix ../common/lib/libc/misc
file ubsan.c kubsan
prefix
makeoptions kubsan CFLAGS+="-fsanitize=undefined"
makeoptions kubsan CPPFLAGS+="-DACPI_MISALIGNMENT_NOT_SUPPORTED"