3 ms·
Perhaps I missed this from the blog post since it's unfamiliar to me. Can you compile Linux with this? Like, could you really straight up use this is a drop-in
by chronogram 7y ago
Perhaps I missed this from the blog post since it's unfamiliar to me. Can you compile Linux with this? Like, could you really straight up use this is a drop-in replacement for a whole Gentoo system?
- loeg 7y agoHistorically the Linux kernel used GCC extensions that Clang did not support, and this is just a thin shim around the ordinary Clang frontend, so to the extent that's still a problem: no. Otherwise: yeah. It's just clang's main function with a different name slapped on. Linking semantics may differ slightly which could be problematic. But in theory, yes.
- yjftsjthsd-h 7y ago> so to the extent that's still a problem: no. Clang can apparently build a vanilla Linux kernel now, no gotchas, actively used by Google for its Linux things (Android, chromeos).
- ndesaulniers 7y agoYep, check out clangbuiltlinux.github.io for more info!
- loeg 7y agoGlad to hear it!
- AndyKelley 7y agoI'm guessing the build system of Linux depends on more than just a C compiler, and that's why the answer to the question is "no". If the build system of Linux only depends on a C compiler then my answer would be: That would be a nice stress test, which would undoubtedly lead to bugs discovered. After enough bugs fixed, the answer would be "yes". I'll try it!
- chronogram 7y agoExciting! This is almost what I was thinking would be lovely about one month ago when I was last hacking on C.