[compiler-rt][xray] Fix alignment of XRayFileHeader
authorLeandro Lupori <leandro.lupori@linaro.org>
Tue, 11 Jul 2023 20:08:13 +0000 (20:08 +0000)
committerLeandro Lupori <leandro.lupori@linaro.org>
Mon, 17 Jul 2023 13:51:27 +0000 (10:51 -0300)
commit33acdc1e2fbf9775f73d12a0964f1866ae828052
tree06329b4ac296c14d2ca1601c9b2e15a6fe49b908
parent63d6659a045d2e014d53ae890eec8b3cd96e5805
[compiler-rt][xray] Fix alignment of XRayFileHeader

XRayFileHeader storage was obtained from std::aligned_storage
using its default alignment and not the struct's alignment
requirement. This was causing a bus error on AArch32, on armv8
machines, where vld1.64/vst1.64 instructions with 128-bit
alignment requirement were being used to copy XRayFileHeader.

There is still another issue with fdr-single-thread.cpp test on
armv7. Now it runs until completion and produces a valid log file,
but for some reason the function name appears as _end in it,
instead of the expected mangled fn name.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D155013
compiler-rt/lib/xray/xray_fdr_logging.cpp