Add -falignment-sanitization flag
authorBen Gamari <bgamari.foss@gmail.com>
Mon, 30 Oct 2017 00:46:45 +0000 (20:46 -0400)
committerBen Gamari <ben@smart-cactus.org>
Mon, 30 Oct 2017 00:47:05 +0000 (20:47 -0400)
commitcecd2f2d708d419878205ddd8b87bba18e6483d9
tree72837286086fb64d3b458d14cb95c13425cca8ea
parent3b784d440d4b01b4c549df7c9a3ed2058edfc780
Add -falignment-sanitization flag

Here we add a flag to instruct the native code generator to add
alignment checks in all info table dereferences. This is helpful in
catching pointer tagging issues.

Thanks to @jrtc27 for uncovering the tagging issues on Sparc which
inspired this flag.

Test Plan: Validate

Reviewers: simonmar, austin, erikd

Reviewed By: simonmar

Subscribers: rwbarton, trofi, thomie, jrtc27

Differential Revision: https://phabricator.haskell.org/D4101
compiler/cmm/CLabel.hs
compiler/cmm/CmmInfo.hs
compiler/cmm/CmmMachOp.hs
compiler/cmm/PprC.hs
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
compiler/main/DynFlags.hs
compiler/nativeGen/X86/CodeGen.hs
docs/users_guide/debugging.rst
rts/RtsMessages.c
rts/RtsSymbols.c
rts/StgStartup.cmm