On 28/03/14 08:35, Lauri Kasanen wrote: > On Thu, 27 Mar 2014 21:00:39 +0000 > Emil Velikov <emil.l.veli...@gmail.com> wrote: > >> By doing GC the linker removes all the symbols that are not referenced >> and/or used by the final library. This results in a saving of ~100K >> up-to ~600K per (stripped) binary (classic vs gallium drivers). >> >> If interested one can ask the compiler to print the sections that are >> removed using -Wl,--print-gc-sections. > > I didn't see where you add the corresponding flags to CFLAGS/CXXFLAGS. > What do you have in mind with "the corresponding flags" ?
> Without -ffunction-sections -fdata-sections in compile flags the garbage > collection is handicapped - add those by default too, and see much > greater gains. > "Handicapped" or not it produces very nice results at this point. AFAICS both options that you've mentioned have some interesting side effects, from which I would rather opt out at this stage. Speaking of "much greather gains" do you have any numbers in mind (wrt mesa) ? > I should also add that this is a GNUism, so it should be detected for Ouch good point. > in configure in case people use other compilers/linkers. It's also > redundant if LTO is used. As mentioned by Marc, LTO is somewhat broken + adds a substantial delay to the build process. Thus I'd rather not enforce it on people. > > In one of my projects I detect as such: > > if -flto supported, use it (needs to be added to all three CFLAGS > CXXFLAGS LDFLAGS) > else if sections supported, use it > else print a message they're missing out > Thanks -Emil > - Lauri > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev