This should fix FTBFS on architectures where it isn't.
Apply the upstream patches that removed the use of cmpxchg64().