3 ms·
Just a few hours ago there was a conversation in #gentoo-chat about the Thompson attack. I wondered how difficult it would be to write a C compiler that can com
by another-cuppa 8y ago
Just a few hours ago there was a conversation in #gentoo-chat about the Thompson attack. I wondered how difficult it would be to write a C compiler that can compile GCC. How far away is this?
- dleslie 8y agoIt just needs to compile enough C to compile a compiler that can compile GCC.
- em3rgent0rdr 8y agoYes. And should emphasize that the bootstrapping compiler doesn't need to be an optimizing compiler, and doesn't need to compile fast, since it is only to be used once for compiling the next stage of compiler.
- chubot 8y agoIsn't GCC written in C++ now? I think they are probably aiming for a very old version of GCC written in C (or that's all they can really hope for). The now-defunct Aboriginal Linux project was doing a similar sort of bootstrapping, and the build dependencies for GCC was a big issue: http://landley.net/aboriginal/ http://landley.net/aboriginal/ To work around this, it never used anything later than gcc-4.2.1 from 2007, while we're now on GCC 8.2. http://gcc.gnu.org/releases.html http://gcc.gnu.org/releases.html EDIT: Yes, it appears GCC uses C++: https://lwn.net/Articles/542457/ https://lwn.net/Articles/542457/
- earenndil 8y agoYes, but you can use gcc 4.2.1 to compile a newer version which does use c++.
- z29LiTp5qUC30n 8y agoWell, there is work to have MesCC bootstrapped off this: https://gitlab.com/janneke/mes https://gitlab.com/janneke/mes Which can build GCC. So literally once that step is done, we would have a full path...