Re: [PATCH 0/4] Compile kernel with -fwhole-program --combine

Jan Engelhardt
2006-08-25T06:01:52Z

>> Compiling files on their own (`make drivers/foo/bar.o`) seems to make
>> the optimization void. Sure, most people don't stop compiling in
>> between. Just a note
>
>Actually I'm not entirely sure what you write is true. It'll _build_
>fs/jffs2/read.o, for example, but it still won't then use it when I make
>the kernel -- it'll just use fs/jffs2/jffs2.o which is built from all
>the C files with --combine. So the optimisation isn't lost.

Umm then it spends double the time in compilation, doing:

read.o <- read.c
foo.o <- foo.c
bar.o <- bar.c
built-in.o <- read.c foo.c bar.c

(cf. default current:
built-in.o <- read.o foo.o bar.o)

>So to overcome this, we use GCC's __attribute__((externally_visible))
>which, as documented, just makes it global again -- undoing the effect
>of -fwhole-program just for this _one_ symbol.

Interesting. __attribute__((visibility("default"))) does the same?

Jan Engelhardt
--