You're right, it's not. The gcc build itself does a three-stage build: once against the current system gcc, a second time against the new version of gcc just built (but not yet installed), and a third time, to sanity-check that the resulting binaries are the same as in stage 2.lazarusrat wrote:It's the same reason fresh installs are bootstrapped, compiling the toolchain multiple times. Assuming you start with gcc 3.4.6 and follow the guide:literfizzer wrote: That post doesn't explain why it's necessary to emerge system, then world. On my system, at least, emerge -e world recompiles everything that was already recompiled in the previous emerge -e system step. This makes no sense to me. The recompile is because of a C++ ABI change. It has nothing to do with other dependent libs, kernel headers, or anything else, as some of the other replies have said. So recompiling more than once is a waste. It will generate exactly the same object code the second time.Code: Select all
$ emerge --pretend --emptytree system | grep '^\[ebuild' | sed 's/^.*] //' | sort >/tmp/system $ emerge --pretend --emptytree world | grep '^\[ebuild' | sed 's/^.*] //' | sort >/tmp/world $ diff -u /tmp/system /tmp/world | grep '^-'
emerge -u gcc gives you a gcc 4.1.1 compiled with gcc 3.4.6.
emerge -e system gives you a toolchain partially compiled with a gcc 4.1.1 that was compiled with gcc 3.4.6, and partially compiled with a gcc 4.1.1 that was compiled with gcc 4.1.1 (including gcc itself)
emerge -e world gives you everything compiled with a gcc 4.1.1 that was compiled with gcc 4.1.1
Not that I would call all that "necessary."
In any case, gcc has already been rebuilt this way even before doing `emerge -e system`. If you then do `emerge -e world`, gcc has been re-merged three times, for a total of nine complete builds! This seems crazy.
Where did this bit of tribal knowledge come from? Whoever first pronounced 'you must re-merge system, then world' must have had a reason.





