4 ms·
Why does this matter though? Why does order of compilation result in a different binary?
by edgyquant 3y ago
Why does this matter though? Why does order of compilation result in a different binary?
- speed_spread 3y agoBecause order of completion of the parallel tasks is not guaranteed, if all tasks write to the same file you might get a different result each time.
- kaba0 3y agoJust some random, made up example: say you want to compile an OOP PL that has interfaces and implementations of that. You discover reachable implementations through static analysis, which is multi-threaded. You might discover implementations A,B,C in any order — but they will get their methods placed in the jump table based on this order. This will trivially result in semantically equivalent, but not binary-equivalent executables. Of course there would have been better designs for this toy example, but binary reproducibility is/was usually not of the highest priority historically in most compiler infrastructures, and in some cases it might be a relatively big performance regression to fix, or simply just a too big refactor.