3 ms·
In theory you can strip out the majority of the kernel sources and I'm sure there's some automated way to do this with the kernel build process. Make already do
by MertsA 12y ago
In theory you can strip out the majority of the kernel sources and I'm sure there's some automated way to do this with the kernel build process. Make already doesn't even have to look at the source for drivers that aren't being built. I think there's a lot of macros that depend on the config but there should still be a way to basically run the preprocessor over everything being compiled to strip out all of the pointless #ifdef blocks.
- wtallis 12y agoThe preprocessor's got nothing to do with it. As you've noted, the raw size of the source code is easily dealt with. (At least for parsing. We still haven't identified where it's being stored in the first place.) The problem is that when targeting an embedded system, you really want to use compiler optimizations (especially size optimizations), and those heuristics require more RAM than routers have. Ideally, you would compile large parts of the OS with link-time optimization, which is one of the most memory-intensive options you can pass to a compiler.