Re: [gentoo-user] Re: Does -Wl,--hash-style=gnu need a full world rebuild?
On Mon, 13 Apr 2009 10:57:37 -0400 ABCD en.a...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jorge Morais wrote: I want these two flags (--as-needed and --hash-style=gnu) to be active before I adopt GCC 4.3 and recompile world. Just as an FYI, you do not need to rebuild the world when you upgrade GCC - the only time this was needed was around the GCC 3.3 to 3.4 transition, because of a one-time ABI breakage. By the way, binaries linked with --as-needed are compatible with binaries linked without it, yes? The --as-needed flag simply tells the linker to be more selective about which libraries to link against -- it does not change anything about the format, etc. of the library itself (to be precise, using --as-needed will cause only the NEEDED entries that are actually needed to be emitted to the final binary). So, to answer your question, yes, they are perfectly compatible with each other. From http://www.gentoo.org/proj/en/qa/asneeded.xml#doc_chap2 Note: While applying patches to libraries to fix --as-needed support, it is usually not the case to apply a revision bump: those who don't want to use the flag don't need to rebuild the library. For this reason, those who want to use --as-needed are invited to run an emerge -e world so that libraries are rebuilt. This suggests that, to be safe, I should activate --as-needed only *after* the next world compilation. -- Software is like sex: it is better when it is free. --Linus Torvalds
Re: [gentoo-user] Re: Does -Wl,--hash-style=gnu need a full world rebuild?
On Mon, 13 Apr 2009 13:22:39 +0300 Nikos Chantziaras rea...@arcor.de wrote: Jorge Morais wrote: Hi. According to discussion on gentoo-dev http://archives.gentoo.org/gentoo-dev/msg_50182554f851bedb82f8a349fbc90352.xml it seems the only reasons for -Wl,--hash-style=gnu not being default (yet) are these headaches for the developers: 1) Apparently it does not work on mips 2) Apparently it needs =glibc-2.5 and =binutils-2.17.50.0.2 My PC is x86 and my toolchain is obviously more recent than these old verions, so apparently the flag is completely safe. I've enabled it in /etc/make.conf and I like the slight reduction in binary size. My main question is: Can I just compile new packages with this flag, or do I need to recompile the whole world? In other words, is there any incompatibility between binaries linked with this flag and binaries linked with the default hash-style (which in Gentoo is --hash-style=both, AFAIK)? No, there's no need to rebuild everything since the older binaries have GNU-style hash too and there's no problem. Also, rebuilding anyway in order to gain something is not really recommendable; we're talking a few kilobytes here, *so* not worth the effort. OK, thank you very much. Hum, and to be pedantic, not all other binaries have GNU-style hash, since some are probably older than the introduction of --hash-style=both in Gentoo. And thinking about it, the fact that the devs silently introduced --hash-style=both by default offers some evidence that this kind of linker flag does not lead to incompatibilities. And next I am going to use --as-needed. From bug 129413, it seems to be very close to be ready for general use. And many people seem to be using it without any problems (and many begun many months or even years ago, when the packages were not as --as-needed ready as they are now.) So, for a guy prepared to look at bug 129413 and compare all the bugs with the software installed in his computer (should be quite easy to automate) it should be very safe. I want these two flags (--as-needed and --hash-style=gnu) to be active before I adopt GCC 4.3 and recompile world. By the way, binaries linked with --as-needed are compatible with binaries linked without it, yes? -- Software is like sex: it is better when it is free. --Linus Torvalds
Re: [gentoo-user] Re: Does -Wl,--hash-style=gnu need a full world rebuild?
On Mon, 13 Apr 2009 10:57:37 -0400 ABCD en.a...@gmail.com wrote: Jorge Morais wrote: I want these two flags (--as-needed and --hash-style=gnu) to be active before I adopt GCC 4.3 and recompile world. Just as an FYI, you do not need to rebuild the world when you upgrade GCC - the only time this was needed was around the GCC 3.3 to 3.4 transition, because of a one-time ABI breakage. I think I read in the Gentoo GCC upgrade guide that there is also ABI incompatibility between GCC 3.4 and GCC 4.1 Weirdly, the page http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html seems to indicate that at least the libstdc++.so library has been forward compatible since GCC 3.4. Anyway, thank you for your information (which I had already heard), but nevertheless I think it would be a good idea to recompile world after all these years of upgrading packages, changing USE flags, upgrading the toolchain ... I think recompiling world would lead to a more harmonious system. And it would benefit from the increased optimization abilities of GCC 4.3 (which I assume generates faster code than GCC 4.1; at least with my simple programs, it seems to generate better assembly code - I often check the generated assembly code of my programs through the flags -S -fverbose-asm) By the way, binaries linked with --as-needed are compatible with binaries linked without it, yes? The --as-needed flag simply tells the linker to be more selective about which libraries to link against -- it does not change anything about the format, etc. of the library itself (to be precise, using --as-needed will cause only the NEEDED entries that are actually needed to be emitted to the final binary). I already knew that (on a superficial way), but thank you for being helpful. So, to answer your question, yes, they are perfectly compatible with each other. Thank you. -- Software is like sex: it is better when it is free. --Linus Torvalds