There's various research projects out there to, at compiler level, create different output binaries out of same source code to accomplish this task. I'm not really following it I just remember a professor at my undergrad was recruiting people for his lab on it, and I'm pretty sure his project was not only one.
https://ssllab.org/trac/wiki/MultiCompilerPublicedit: see compiler/compile-time randomization? see some other similar projects under these key terms.