Cross compiling compiler
Posted Apr 9, 2004 12:13 UTC (Fri) by
libra (guest, #2515)
In reply to:
Cross compiling compiler by pynm0001
Parent article:
Green Hills Software on free software in the military
That's why I added the term iteration in my post. The idea is :
Compile GCC with compiler C_A on platform P_A for platform P
Compile GCC with compiler C_B on platform P_B for platform P
(with C_A != C_B and P_A != P_B but not necessary C_x != GCC or P_x != P)
Then on platform P you have GCC_A and GCC_B, they are certainly note binary equivalent, but functionally shall be. As the code has been audited, and two platforms/compiler were involved, we may assume that one of the two is not tainted. So now we do :
Compile GCC with GCC_A on P
Compile GCC with GCC_B on P
If both GCC_A and GCC_B are really functionally equivalent then the results shall now be binary identical (at that iteration, or maybe at the next one due to some cross compilation problems that may occur). If you can never reach an iteration where both results are stable and identical, then you have a problem, otherwise you nearly have the proof you want (unless all compiler of the world are tainted the same way, highly unlikely).
Note that for better results it shall be done with 3 or 4 different compiler. Also note that if you find a small binary difference at some point you may very well gain the key of the backdoor (in GCC or in C_x) by analyzing that difference, unless it is just a bug you would have to point out for the improvement of GCC.
Sorry not to have been clear the first time. Hope it is OK now.
(
Log in to post comments)