Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 482612 - sys-devel/gcc - broken gcc after removing old libgmp.so
Summary: sys-devel/gcc - broken gcc after removing old libgmp.so
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-26 23:37 UTC by Jorge Manuel B. S. Vicetto
Modified: 2013-12-23 19:16 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Failed gcc build log (gcc-4.6.3.tar.bz2,103.38 KB, application/octet-stream)
2013-08-26 23:37 UTC, Jorge Manuel B. S. Vicetto (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2013-08-26 23:37:11 UTC
Created attachment 357130 [details]
Failed gcc build log

Yesterday, while updating skimmer, I got a broken gcc as it was linking to /usr/lib/libgmp.so.3 and it was dropped from the system.
I've this these issue a few issues before when updating old systems as gcc would become broken for linking to old gmp / mpfr libs and they were removed from the system before gcc got updated. Yesterday, I decided to poke Zac to see if it was related to Portage and preserve_libs logic.
After some debugging, I was able to replicate the error and got a hint that made me suspect toolchain eclass as this happened first while building binutils and next when building gcc (more than 2 times):


checking for the correct version of gmp.h... yes
checking for the correct version of the gmp/mpfr/mpc libraries... yes
  cc1-checksum.o main.o  libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcpp/libcpp.a   ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a  -lmpc -lmpfr -lgmp  -rdynamic -ldl  -lz
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/bin/ld: warning: libgmp.so.3, needed by /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libmpc.so, may conflict with libgmp.so.10
  cc1-checksum.o main.o  libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcpp/libcpp.a   ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a  -lmpc -lmpfr -lgmp  -rdynamic -ldl  -lz
      cp/cp-lang.o c-family/stub-objc.o cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o cp/class.o cp/decl2.o cp/error.o cp/lex.o cp/parser.o cp/ptree.o cp/rtti.o cp/typeck.o cp/cvt.o cp/except.o cp/friend.o cp/init.o cp/method.o cp/search.o cp/semantics.o cp/tree.o cp/repo.o cp/dump.o cp/optimize.o cp/mangle.o cp/cp-objcp-common.o cp/name-lookup.o cp/cxx-pretty-print.o cp/cp-gimplify.o tree-mudflap.o attribs.o incpath.o prefix.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o i386-c.o cc1plus-checksum.o main.o  libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcpp/libcpp.a   ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a  -lmpc -lmpfr -lgmp  -rdynamic -ldl  -lz
/usr/x86_64-pc-linux-gnu/bin/ld: warning: libgmp.so.3, needed by /usr/lib/../lib64/libmpc.so, may conflict with libgmp.so.10
/usr/x86_64-pc-linux-gnu/bin/ld: warning: libgmp.so.3, needed by /usr/lib/../lib64/libmpc.so, may conflict with libgmp.so.10
/var/tmp/portage/sys-devel/gcc-4.6.3/work/build/./prev-gcc/cc1: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory


Here's a short summary of one of the failures:


jmbsvicetto@skimmer ~ $ ls -la /usr/lib/libgmp*
-rw-r--r-- 1 root root 1065336 Jun  2  2011 /usr/lib/libgmp.a
-rw-r--r-- 1 root root     781 Jun  2  2011 /usr/lib/libgmp.la
lrwxrwxrwx 1 root root      15 Aug 26 03:24 /usr/lib/libgmp.so -> libgmp.so.3.5.2
lrwxrwxrwx 1 root root      15 Aug 26 03:24 /usr/lib/libgmp.so.3 -> libgmp.so.3.5.2
-rwxr-xr-x 1 root root  388592 Jun  2  2011 /usr/lib/libgmp.so.3.5.2
-rw-r--r-- 1 root root   41474 Jun  2  2011 /usr/lib/libgmpxx.a
-rw-r--r-- 1 root root     814 Jun  2  2011 /usr/lib/libgmpxx.la
lrwxrwxrwx 1 root root      17 Aug 26 03:24 /usr/lib/libgmpxx.so -> libgmpxx.so.4.1.2
lrwxrwxrwx 1 root root      17 Aug 26 03:24 /usr/lib/libgmpxx.so.4 -> libgmpxx.so.4.1.2
-rwxr-xr-x 1 root root   18384 Jun  2  2011 /usr/lib/libgmpxx.so.4.1.2
jmbsvicetto@skimmer ~ $ ls -la /usr/lib/libmpfr*
-rw-r--r-- 1 root root 917168 Feb  9  2012 /usr/lib/libmpfr.a
-rw-r--r-- 1 root root    951 Feb  9  2012 /usr/lib/libmpfr.la
lrwxrwxrwx 1 root root     16 Aug 26 03:24 /usr/lib/libmpfr.so -> libmpfr.so.4.0.1
lrwxrwxrwx 1 root root     16 Aug 26 03:24 /usr/lib/libmpfr.so.4 -> libmpfr.so.4.0.1
-rwxr-xr-x 1 root root 370816 Feb  9  2012 /usr/lib/libmpfr.so.4.0.1
jmbsvicetto@skimmer ~ $ 

jmbsvicetto@skimmer ~ $ sudo emerge -av1 gmp mpfr --quiet=y
[ebuild     U ] dev-libs/gmp-5.0.2_p1 [4.3.2] USE="cxx%* -doc% -static-libs% (-nocxx%)" 
[ebuild     U ] dev-libs/mpfr-3.1.1 [3.0.1_p4] USE="-static-libs%" 

Would you like to merge these packages? [Yes/No] 
>>> Verifying ebuild manifests
>>> Emerging (1 of 2) dev-libs/gmp-5.0.2_p1
>>> Installing (1 of 2) dev-libs/gmp-5.0.2_p1
>>> Emerging (2 of 2) dev-libs/mpfr-3.1.1
>>> Installing (2 of 2) dev-libs/mpfr-3.1.1
>>> Jobs: 2 of 2 complete                           Load avg: 1.63, 0.58, 0.28

!!! existing preserved libs found
jmbsvicetto@skimmer ~ $ 

jmbsvicetto@skimmer ~ $ ls -la /usr/lib/libmpfr*
lrwxrwxrwx 1 root root     16 Aug 26 13:21 /usr/lib/libmpfr.so -> libmpfr.so.4.1.1
lrwxrwxrwx 1 root root     16 Aug 26 13:21 /usr/lib/libmpfr.so.4 -> libmpfr.so.4.1.1
-rwxr-xr-x 1 root root 399360 Aug 26 13:21 /usr/lib/libmpfr.so.4.1.1
jmbsvicetto@skimmer ~ $ ls -la /usr/lib/libgmp*
lrwxrwxrwx 1 root root     16 Aug 26 13:21 /usr/lib/libgmp.so -> libgmp.so.10.0.2
lrwxrwxrwx 1 root root     16 Aug 26 13:21 /usr/lib/libgmp.so.10 -> libgmp.so.10.0.2
-rwxr-xr-x 1 root root 474752 Aug 26 13:21 /usr/lib/libgmp.so.10.0.2
lrwxrwxrwx 1 root root     15 Aug 26 03:24 /usr/lib/libgmp.so.3 -> libgmp.so.3.5.2
-rwxr-xr-x 1 root root 388592 Jun  2  2011 /usr/lib/libgmp.so.3.5.2
lrwxrwxrwx 1 root root     17 Aug 26 13:21 /usr/lib/libgmpxx.so -> libgmpxx.so.4.2.2
lrwxrwxrwx 1 root root     17 Aug 26 13:21 /usr/lib/libgmpxx.so.4 -> libgmpxx.so.4.2.2
-rwxr-xr-x 1 root root  18464 Aug 26 13:21 /usr/lib/libgmpxx.so.4.2.2
jmbsvicetto@skimmer ~ $ 

jmbsvicetto@skimmer ~ $ sudo emerge -av1 --quiet=y gcc
[ebuild   R   ] sys-devel/gcc-4.6.3  USE="cxx hardened mudflap (multilib) nptl openmp (-altivec) -doc (-fixed-point) -fortran -gcj -graphite -g

Would you like to merge these packages? [Yes/No] 

>>> Verifying ebuild manifests
>>> Emerging (1 of 1) sys-devel/gcc-4.6.3

<failed build>

/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/gcc/../move-if-change cc1plus-checksum.c.tmp cc1plus-checksum.c
/var/tmp/portage/sys-devel/gcc-4.6.3/work/build/./prev-gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.6.3/work/build/./prev-gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include    -c -DEFAULT_RELRO -DEFAULT_BIND_NOW -DEFAULT_PIE_SSP   -fno-PIE  -DIN_GCC_FRONTEND -m64 -O2 -pipe -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat   -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/gcc -I/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/gcc/. -I/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/gcc/../include -I/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/gcc/../libcpp/include  -I/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/gcc/../libdecnumber -I/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/gcc/../libdecnumber/bid -I../libdecnumber    cc1plus-checksum.c -o cc1plus-checksum.o
/var/tmp/portage/sys-devel/gcc-4.6.3/work/build/./prev-gcc/cc1: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory
make[3]: *** [cc1plus-checksum.o] Error 1

lrwxrwxrwx 1 root root     16 Aug 26 15:15 /usr/lib/libgmp.so -> libgmp.so.10.0.2
lrwxrwxrwx 1 root root     16 Aug 26 15:15 /usr/lib/libgmp.so.10 -> libgmp.so.10.0.2
-rwxr-xr-x 1 root root 474752 Aug 26 15:15 /usr/lib/libgmp.so.10.0.2
lrwxrwxrwx 1 root root     17 Aug 26 15:15 /usr/lib/libgmpxx.so -> libgmpxx.so.4.2.2
lrwxrwxrwx 1 root root     17 Aug 26 15:15 /usr/lib/libgmpxx.so.4 -> libgmpxx.so.4.2.2
-rwxr-xr-x 1 root root  18464 Aug 26 15:15 /usr/lib/libgmpxx.so.4.2.2


As you can see, during gcc merge, libgmp.so.3 was removed from the system. I'm going to attach the complete build log for this failure to this bug.
It's worth noting, that while trying to replicate this again for posting logs, gcc was able to build sucessfully, which was a bit "frustrating". When I thought it was all lost and contemplated not opening this bug, emerge failed to merge gmp, for the exact same error. This time however, cc1 was linked to the new lib, but ldd showed some indirect dep is still using the old lib:

jmbsvicetto@skimmer ~ $ scanelf -n /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1 
 TYPE   NEEDED FILE 
ET_EXEC libmpc.so.2,libmpfr.so.4,libgmp.so.10,libdl.so.2,libz.so.1,libc.so.6 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1 
jmbsvicetto@skimmer ~ $ ldd /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1 
        linux-vdso.so.1 (0x000003ff685fe000)
        libmpc.so.2 => /usr/lib64/libmpc.so.2 (0x000003780c99f000)
        libmpfr.so.4 => /usr/lib64/libmpfr.so.4 (0x000003780c73d000)
        libgmp.so.10 => /usr/lib64/libgmp.so.10 (0x000003780c4c9000)
        libdl.so.2 => /lib64/libdl.so.2 (0x000003780c2c5000)
        libz.so.1 => /lib64/libz.so.1 (0x000003780c0ae000)
        libc.so.6 => /lib64/libc.so.6 (0x000003780bd05000)
        /lib64/ld-linux-x86-64.so.2 (0x000003780cbb4000)
        libgmp.so.3 => not found
jmbsvicetto@skimmer ~ $
Comment 1 SpanKY gentoo-dev 2013-08-27 05:04:21 UTC
i don't see what is expected of the toolchain team here.  the preserved libs logic is handled by portage.
Comment 2 Zac Medico gentoo-dev 2013-08-27 05:14:02 UTC
My understanding is that preserve-libs works as intended, but then something else goes wrong that makes gcc stop working.
Comment 3 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2013-09-16 11:59:10 UTC
I've confirmed that preserved-libs did its job - preserve the libs for the old package. This are the libs on the system after merging the new mpfr/gmp and while building gcc:

jmbsvicetto@skimmer ~ $ ls -la /usr/lib/libgmp*
lrwxrwxrwx 1 root root     16 Sep 16 00:50 /usr/lib/libgmp.so -> libgmp.so.10.0.2
lrwxrwxrwx 1 root root     16 Sep 16 00:50 /usr/lib/libgmp.so.10 -> libgmp.so.10.0.2
-rwxr-xr-x 1 root root 474752 Sep 16 00:50 /usr/lib/libgmp.so.10.0.2
lrwxrwxrwx 1 root root     15 Sep 16 00:48 /usr/lib/libgmp.so.3 -> libgmp.so.3.5.2
-rwxr-xr-x 1 root root 388592 Jun  2  2011 /usr/lib/libgmp.so.3.5.2
lrwxrwxrwx 1 root root     17 Sep 16 00:50 /usr/lib/libgmpxx.so -> libgmpxx.so.4.2.2
lrwxrwxrwx 1 root root     17 Sep 16 00:50 /usr/lib/libgmpxx.so.4 -> libgmpxx.so.4.2.2
-rwxr-xr-x 1 root root  18464 Sep 16 00:50 /usr/lib/libgmpxx.so.4.2.2
jmbsvicetto@skimmer ~ $ ls -la /usr/lib/libmpfr*
lrwxrwxrwx 1 root root     16 Sep 16 00:51 /usr/lib/libmpfr.so -> libmpfr.so.4.1.1
lrwxrwxrwx 1 root root     16 Sep 16 00:51 /usr/lib/libmpfr.so.4 -> libmpfr.so.4.1.1
-rwxr-xr-x 1 root root 399360 Sep 16 00:51 /usr/lib/libmpfr.so.4.1.1
jmbsvicetto@skimmer ~ $ 


So portage did preserve the old libs for gmp.
Can anyone make "heads or tails" of the following?

jmbsvicetto@skimmer ~ $ scanelf -n /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1
 TYPE   NEEDED FILE 
ET_EXEC libmpc.so.2,libmpfr.so.4,libgmp.so.10,libdl.so.2,libz.so.1,libc.so.6 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1 
jmbsvicetto@skimmer ~ $ ldd -v /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1
        linux-vdso.so.1 (0x000003ff219fe000)
        libmpc.so.2 => /usr/lib64/libmpc.so.2 (0x0000035c9dba1000)
        libmpfr.so.4 => /usr/lib64/libmpfr.so.4 (0x0000035c9d93f000)
        libgmp.so.10 => /usr/lib64/libgmp.so.10 (0x0000035c9d6cb000)
        libdl.so.2 => /lib64/libdl.so.2 (0x0000035c9d4c7000)
        libz.so.1 => /lib64/libz.so.1 (0x0000035c9d2b0000)
        libc.so.6 => /lib64/libc.so.6 (0x0000035c9cf07000)
        /lib64/ld-linux-x86-64.so.2 (0x0000035c9ddb6000)
        libgmp.so.3 => not found

        Version information:
        /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1:
                libdl.so.2 (GLIBC_2.2.5) => /lib64/libdl.so.2
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.8) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /usr/lib64/libmpc.so.2:
                libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /usr/lib64/libmpfr.so.4:
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6
        /usr/lib64/libgmp.so.10:
                libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6
        /lib64/libdl.so.2:
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libz.so.1:
                libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.14) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libc.so.6:
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
jmbsvicetto@skimmer ~ $ ls -la /usr/lib64/libgmp*
lrwxrwxrwx 1 root root     16 Sep 16 03:42 /usr/lib64/libgmp.so -> libgmp.so.10.0.2
lrwxrwxrwx 1 root root     16 Sep 16 03:42 /usr/lib64/libgmp.so.10 -> libgmp.so.10.0.2
-rwxr-xr-x 1 root root 474752 Sep 16 03:42 /usr/lib64/libgmp.so.10.0.2
lrwxrwxrwx 1 root root     17 Sep 16 03:42 /usr/lib64/libgmpxx.so -> libgmpxx.so.4.2.2
lrwxrwxrwx 1 root root     17 Sep 16 03:42 /usr/lib64/libgmpxx.so.4 -> libgmpxx.so.4.2.2
-rwxr-xr-x 1 root root  18464 Sep 16 03:42 /usr/lib64/libgmpxx.so.4.2.2
jmbsvicetto@skimmer ~ $ cat /var/tmp/portage/sys-libs/zlib-1.2.7/temp/build.log 
 * Package:    sys-libs/zlib-1.2.7
 * Repository: gentoo
 * Maintainer: base-system@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux multilib userland_GNU
 * FEATURES:   preserve-libs sandbox splitdebug
>>> Unpacking source...
>>> Unpacking zlib-1.2.7.tar.gz to /var/tmp/portage/sys-libs/zlib-1.2.7/work
>>> Source unpacked in /var/tmp/portage/sys-libs/zlib-1.2.7/work
>>> Compiling source in /var/tmp/portage/sys-libs/zlib-1.2.7/work/zlib-1.2.7 ...
./configure --shared --prefix=/usr --libdir=/usr/lib64 --uname=linux
Using x86_64-pc-linux-gnu-ar
Using x86_64-pc-linux-gnu-ranlib
Using x86_64-pc-linux-gnu-nm
Checking for x86_64-pc-linux-gnu-gcc...
Checking for shared library support...
No shared library support; try without defining CC and CFLAGS
Building static library libz.a version 1.2.7 with cc.
Checking for off64_t... No.
Checking for fseeko... No.
Checking for strerror... No.
Checking for unistd.h... No.
Checking for stdarg.h... No.
Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf().
Checking for snprintf() in stdio.h... No.
  WARNING: snprintf() not found, falling back to sprintf(). zlib
  can build but will be open to possible buffer-overflow security
  vulnerabilities.
Checking for return value of sprintf()... No.
  WARNING: apparently sprintf() does not return a value. zlib
  can build but will be open to possible string-format security
  vulnerabilities.
Looking for a four-byte integer type... Not found.
make -j4 
cc -O2 -pipe -DNO_FSEEKO -DNO_STRERROR -DNO_snprintf -DHAS_sprintf_void -I. -c -o example.o test/example.c
cc -O2 -pipe -DNO_FSEEKO -DNO_STRERROR -DNO_snprintf -DHAS_sprintf_void   -c -o adler32.o adler32.c
cc -O2 -pipe -DNO_FSEEKO -DNO_STRERROR -DNO_snprintf -DHAS_sprintf_void   -c -o crc32.o crc32.c
cc -O2 -pipe -DNO_FSEEKO -DNO_STRERROR -DNO_snprintf -DHAS_sprintf_void   -c -o deflate.o deflate.c
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory
make: *** [example.o] Error 1
make: *** Waiting for unfinished jobs....
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory
make: *** [crc32.o] Error 1
make: *** [adler32.o] Error 1
make: *** [deflate.o] Error 1
emake failed
 * ERROR: sys-libs/zlib-1.2.7 failed (compile phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  93:  Called src_compile
 *   environment, line 1498:  Called die
 * The specific snippet of code:
 *               emake || die
 * 
 * If you need support, post the output of `emerge --info '=sys-libs/zlib-1.2.7'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/zlib-1.2.7'`.
 * The complete build log is located at '/var/log/portage/build/sys-libs/zlib-1.2.7:20130916-042240.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/sys-libs/zlib-1.2.7/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/zlib-1.2.7/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-libs/zlib-1.2.7/work/zlib-1.2.7'
 * S: '/var/tmp/portage/sys-libs/zlib-1.2.7/work/zlib-1.2.7'
jmbsvicetto@skimmer ~ $ 


So the build is failing because cc1, according to ldd is linking to libgmp.so.3, although it doesn't show what is depending on it. I confirmed the old libs was removed from the system. On the other hand, scanelf doesn't list that link anywhere.
Comment 4 SpanKY gentoo-dev 2013-09-29 01:11:40 UTC
(In reply to Jorge Manuel B. S. Vicetto from comment #3)
> jmbsvicetto@skimmer ~ $ ldd -v /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1

use lddtree instead to show which ELF is actually linking against libgmp.so.3

also run `file -L /usr/lib/libgmp.so.3` and on the cc1 prog to make sure they're the same ELF format (ABI)
Comment 5 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2013-09-29 14:58:27 UTC
(In reply to SpanKY from comment #4)
> (In reply to Jorge Manuel B. S. Vicetto from comment #3)
> > jmbsvicetto@skimmer ~ $ ldd -v /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1
> 
> use lddtree instead to show which ELF is actually linking against libgmp.so.3

jmbsvicetto@skimmer ~ $ lddtree /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1
cc1 => /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1 (interpreter => /lib64/ld-linux-x86-64.so.2)
    libmpc.so.2 => /usr/lib64/libmpc.so.2
        libgmp.so.3 => not found
    libmpfr.so.4 => /usr/lib64/libmpfr.so.4
    libgmp.so.10 => /usr/lib64/libgmp.so.10
    libdl.so.2 => /lib64/libdl.so.2
    libz.so.1 => /lib64/libz.so.1
    libc.so.6 => /lib64/libc.so.6

> also run `file -L /usr/lib/libgmp.so.3` and on the cc1 prog to make sure
> they're the same ELF format (ABI)

jmbsvicetto@skimmer ~ $ file -L /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
jmbsvicetto@skimmer ~ $ file -L usr/lib64/libgmp.so.3*
usr/lib64/libgmp.so.3:     ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
usr/lib64/libgmp.so.3.5.2: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
Comment 6 SpanKY gentoo-dev 2013-09-30 00:33:46 UTC
(In reply to Jorge Manuel B. S. Vicetto from comment #5)

gcc itself is not linking against the old gmp, the dev-libs/mpc package is.

you can try:
$ ldd -v /usr/lib64/libmpc.so.2

and then:
$ LD_DEBUG=all /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1 --version
Comment 7 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2013-12-23 19:16:48 UTC
I'm going to close this bug as skimmer started working again.
I'll reopen this bug if I can duplicate this or skimmer fails again.