Zack's Kernel News
Avoiding Bloat in Test Kernels
Borislav Petkov updated KConfig's DEBUG_INFO
description to warn users that it would cause "huge bloat" and slow down the build. David Rientjes, however, pointed out that this was only a marginal improvement over the previous description, because it didn't give a clear explanation of what "huge bloat" actually meant. Specifically, David pointed out that the compile option did not result in a larger vmlinux binary. So, where was the bloat?
Linus Torvalds pointed out that the object files would be much larger with DEBUG_INFO
enabled. As an example, he said his fs/built-in.o
file went from 2.8MB without that option enabled, to 11.8MB with DEBUG_INFO
(and DEBUG_INFO_REDUCED
) enabled. He said, "The object files being much bigger really does screw you especially on laptops that often have less memory and less capable IO subsystems. The final links in particular tend to be much bigger and use much more memory."
Linus added, "I suspect a lot of people are in denial about just how *horrible* the overhead of debug builds are. And yeah, if you have oodles of memory to cache things, it's not too bad. But you really want to have *lots* of memory, because otherwise you won't be caching all those object files in RAM, and your build easily becomes IO bound at link time. A factor of four size difference will not be helping your poor slow laptop disk."
[...]
Buy this article as PDF
(incl. VAT)