Add x32-abi support
This is based on the patch attached to the original Manits bug: https://cmake.org/Bug/view.php?id=15994#c40584
I have cleaned up all the hard coded paths so hopefully it has now no effect on non-x32 systems.
It probably needs tests to be updated to support x32 where appropriate.
Fixes: #15994 (closed)