Regarding -combine, essentially what happens is that each source file is run through cpp separately, then the results are concatenated and fed to the compiler. This avoids preprocessor-level conflicts.
However, keep in mind that -combine alone, while it does provide some benefit, doesn't accomplish most of the desired result. -fwhole-program does that, because when there are multiple source modules, most of the functions will *not* be 'static', as they are cross-module references, and this can interfere with optimization and (especially) inlining. -fwhole-program overrides this, and forces everything to be 'static' scope except those items that are marked with the 'externally_visible' attribute. To gain the most benefits, you need to use both.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds