TBH, if I recall correctly, something similar happened already in the past just by pure coincidence. I'm pretty sure somebody somewhere already experiments with self-porting AI malware.
The only instance somewhat like this that I am aware of is that two malware samples sort of 'recombined' accidentally.
One was a worm that packaged itself up and sent itself around, the other did some sort of injection or binary patching and happened to piggyback onto the worm.
I realize you’re joking, but it’s possible. Learning compilation targets is an active area of compiler research with some promising results in the past year or two.