Reapply "[asan] Fix misalignment of variables in fake stack frames" (#153139) (#153142)

This reverts commit 29ad073c6c325dbf92c1aa5a285ca48e55cb918b i.e.,
relands 927e19f5f3b357823f86f6c4f1378abedccadf27.

It was reverted because of buildbot breakages. This reland adds
"-pthread" and also moves the test to Posix-only.

Original commit message:

ASan's instrumentation pass uses
`ASanStackFrameLayout::ComputeASanStackFrameLayout()` to calculate the
offset of variables, taking into account alignment. However, the fake
stack frames returned by the runtime's `GetFrame()` are not guaranteed
to be sufficiently aligned (and in some cases, even guaranteed to be
misaligned), hence the offset addresses may sometimes be misaligned.

This change fixes the misalignment issue by padding the FakeStack. Every
fake stack frame is guaranteed to be aligned to the size of the frame.

The memory overhead is low: 64KB per FakeStack, compared to the
FakeStack size of ~700KB (min) to 11MB (max).

Updates the test case from
https://github.com/llvm/llvm-project/pull/152889.

GitOrigin-RevId: 457b14c327d814fd80316f977cf7b1eafc488632
5 files changed