On 12/18/2014 02:03 PM, stephen Turner wrote: > If somebody, somewhere, can build a linux kernel with pcc (even a mostly > allnoconfig one with extensive patching applied, ala the old tccboot > iso), I'll take a second look at it. > > Last I checked it was down to one part-time developer who only cared > about bsd and not linux, but I'm told it's revived a bit since then... > > > Rob, back to this conversation. PCC is only a c compiler but that being > said i have compiled everything in the PCC-Musl env except m4 and the > kernel. I know qcc is a If and after toybox-1.0 this conversation is a > hypothetical more or less.
Not necessarily. There's little optimization in qcc so it's a good bootstrap compiler but not necessarily something you want to deploy everything with. And it's unlikely to be ready the day after toybox goes 1.0. My interest in qcc is in having a simple, straightward, fast, understandable compiler you can use to bootstrap new systems on new hardware easily, using a small amount of memory, which remains pure C even if gcc and llvm lose the plot, and which you can use for the "diverse double compiling" thing (ala trusting trust) and the -run option is nice and so on. It has its niche. That said, its optimization goes up to about dead code elimination and stops there. I'd like to get it to stop spilling the _same_ register to te stack and loading it back in, but much beyond that's probably out of scope. > From what i have been reading and running into thus far it appears the > kernel is written with the explicit assumption that it is and always > will be compiled with gcc. GCC specifically is called within scripts and > possibly code. That was true for most of its development, up until around 2004. That year both Fabrice Bellard made tcccboot work, and Intel implemented the relevant gcc extensions in its icc to build the kernel: http://www.bellard.org/tcc/tccboot.html https://software.intel.com/sites/default/files/article/146679/linuxkernelbuildwhitepaper.pdf Intel added the relevant extensions to pretend to be gcc, and tccboot both added stuff and only built a subset of a patched kernel. More recently, there's been an entire project to build the kernel with llvm. (As always, the Linux Foundation finds anything of interest to large corporations and does its best to consume it and take retroactive credit for it, but oh well...) https://www.youtube.com/watch?v=TiLPL-zMndM http://llvm.linuxfoundation.org > Back when you were working on or thinking about the QCC project did this > ever come up and if so how would it be handled theoretically? Would QCC > handle it or would kernel patches be proposed and pushed upstream? I hosted a BOF about all this at Ottawa Linux Symposium in 2008. It's long and rambling, but this is one of the many topics it wanders through: http://free-electrons.com/pub/video/2008/ols/ols2008-rob-landley-linux-compiler.ogg > thanks, > stephen Rob _______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
