The Inferno



The Inferno :: It is a fallacy to state that something exists just because it can’t be proven that it doesn’t
Archive for the 'gentoo' Category
1/19/09
3:27 pm
Gentoo glibc troubles

I ran into some troubles with Gentoo and glibc over the weekend. Here’s what fixed it, in case it helps anyone out in the future.

Why it broke:

Someone upgraded glibc from 2.6 to 2.9_p20081201. It’s masked, and what’s worse, installing it moves the old glibc libraries from /usr/lib to /usr/local/lib, which is a most un-Gentoo location.

Additionally, the famous e2fsprogs circular bug occurred, which can be fixed by following these steps:

quickpkg com_err ss e2fsprogs &&
emerge -uDNf world &&
emerge -C com_err ss e2fsprogs &&
emerge e2fsprogs &&
emerge -uDN world &&
revdep-rebuild #(if necessary)

However, having a new glibc breaks the e2fsprogs emerge with the following message:

  1. /usr/local/lib/libdl.so.2: undefined reference to `_dl_tls_get_addr_soft@GLIBC_PRIVATE
  2. The ebuild environment file is located at ‘/var/tmp/portage/sys-fs/e2fsprogs-1.41.3/temp/environment‘.
  3. A complete build log is located at ‘/var/tmp/portage/sys-fs/e2fsprogs-1.41.3/temp/build.log‘.
  4. collect2: ld returned 1 exit status
  5. make[2]: *** [debugfs] Error 1
  6. make[2]: Leaving directory `/var/tmp/portage/sys-fs/e2fsprogs-1.41.3/work/e2fsprogs-1.41.3/debugfs’
  7. make[1]: *** [all-progs-recursive] Error 1
  8. make[1]: Leaving directory `/var/tmp/portage/sys-fs/e2fsprogs-1.41.3/work/e2fsprogs-1.41.3
  9. make: *** [all] Error 2
  10. ERROR: sys-fs/e2fsprogs-1.41.3 failed.
  11. Call stack:
  12. ebuild.sh, line   49:  Called src_compile
  13. environment, line 2449:  Called die
  14. The specific snippet of code:
  15. emake COMPILE_ET=compile_et MK_CMDS=mk_cmds || die;
  16. The die message:
  17. (no error message)
  18. If you need support, post the topmost build error, and the call stack if relevant.

So, I asked on #gentoo but got no answer. Not because they didn’t help, but because it stumped them as well. So here’s my fix.

Symbolically link /usr/local/lib/libdl.so.2 to /lib64/libdl.so.2. Then emerge e2fsprogs. This will fix the problem.

ln -snf /lib64/libdl.so.2 /usr/local/lib/libdl.so.2

emerge e2fsprogs

Note that, after this, /usr/local/lib/libdl.so.2 will point to /usr/local/lib/libdl.so as before. Portage fixes this every time it runs, so emerge everything except for e2fsprogs before this fix, then emerge e2fsprogs and you can boot again. So to summarize:

If you upgrade glibc and this breaks the e2fsprogs compilation, temporarily make libdl.so.2 point to the new libdl.so.2 and e2fsprogs will compile. This will restore the core utilites such as  fsck and mount, thereby letting you boot again.