CONFIGURE: Enable SCUMM_NEED_ALIGNMENT when using --enable-ubsan

-fsanitize=undefined implies -fsanitize=alignment, so we need to define
SCUMM_NEED_ALIGNMENT for UBSan builds, otherwise many false positives
will be reported, such as for engines/scumm/smush/codec47.cpp.

That's also a good way of having more tests for the SCUMM_NEED_ALIGNMENT
code paths during development :)
This commit is contained in:
Donovan Watteau 2022-08-18 17:47:35 +02:00 committed by Filippos Karapetis
parent 908a13998c
commit 8a73f5d496

4
configure vendored
View File

@ -2490,6 +2490,10 @@ case $_host_cpu in
_need_memalign=yes
;;
esac
if test "$_enable_ubsan" = yes ; then
# UBSan implies -fsanitize=alignment, so avoid false positives.
_need_memalign=yes
fi
echo "$_need_memalign"
define_in_config_h_if_yes $_need_memalign 'SCUMM_NEED_ALIGNMENT'