This ports a patch that is already used in 5.11. Also one of the substituteInPlace call fails because a file doesn't exist.