Here is the results of my merge to get memprof: gcc -mcpu=k6 -march=k6 -O3 -pipe -Wall -o memprof bfdutils.o inode.o leakdetect.o main.o process.o profile.o server.o tree.o -rdynamic -L/usr/lib -L/usr/X11R6/lib -lglade-gnome -lglade -lxml -lz -lgnomeui -lart_lgpl -lgdk_imlib -lSM -lICE -lgtk -lgdk -lgmodule -ldl -lXi -lXext -lX11 -lgnome -lgnomesupport -lesd -lasound -laudiofile -lm -ldb1 -lglib -Wl,-Bstatic -lbfd -liberty -Wl,-Bdynamic server.o: In function `create_control_socket': server.o(.text+0xe8): the use of `mktemp' is dangerous, better use `mkstemp' /usr/lib/libbfd.a(bfd.o): In function `bfd_scan_vma': bfd.o(.text+0x21d): undefined reference to `_sch_istable' /usr/lib/libbfd.a(srec.o): In function `srec_scan': srec.o(.text+0xc5): undefined reference to `_sch_istable' srec.o(.text+0x2df): undefined reference to `_sch_istable' srec.o(.text+0x501): undefined reference to `_sch_istable' srec.o(.text+0x5dc): undefined reference to `_sch_istable' /usr/lib/libbfd.a(binary.o)(.text+0x188): more undefined references to `_sch_istable' follow /usr/lib/libbfd.a(elf-strtab.o): In function `_bfd_elf_strtab_finalize': elf-strtab.o(.text+0x1cb): undefined reference to `htab_create' elf-strtab.o(.text+0x1e0): undefined reference to `htab_create' elf-strtab.o(.text+0x253): undefined reference to `htab_find_slot_with_hash' elf-strtab.o(.text+0x27a): undefined reference to `htab_find_slot_with_hash' elf-strtab.o(.text+0x2cc): undefined reference to `htab_delete' elf-strtab.o(.text+0x2e1): undefined reference to `htab_delete' /usr/lib/libbfd.a(aout32.o): In function `aout_link_write_symbols': aout32.o(.text+0x4447): undefined reference to `_sch_istable' /usr/lib/libbfd.a(archive.o): In function `_bfd_generic_read_ar_hdr_mag': archive.o(.text+0x1ac): undefined reference to `_sch_istable' /usr/lib/libbfd.a(archures.o): In function `bfd_default_scan': archures.o(.text+0x155): undefined reference to `_sch_istable' /usr/lib/libbfd.a(syms.o): In function `bfd_decode_symclass': syms.o(.text+0x227): undefined reference to `_sch_toupper' /usr/lib/libbfd.a(stabs.o): In function `_bfd_link_section_stabs': stabs.o(.text+0x402): undefined reference to `_sch_istable' /usr/lib/libbfd.a(merge.o): In function `merge_strings': merge.o(.text+0x904): undefined reference to `htab_create' merge.o(.text+0x925): undefined reference to `htab_create' merge.o(.text+0x9bc): undefined reference to `htab_find_slot_with_hash' merge.o(.text+0xa15): undefined reference to `htab_find_slot_with_hash' merge.o(.text+0xa7d): undefined reference to `htab_delete' merge.o(.text+0xa92): undefined reference to `htab_delete' collect2: ld returned 1 exit status make[2]: *** [memprof] Error 1 make[2]: Leaving directory `/var/tmp/portage/memprof-0.4.1-r1/work/memprof-0.4.1' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/memprof-0.4.1-r1/work/memprof-0.4.1' make: *** [all-recursive-am] Error 2 !!! ERROR: The ebuild did not complete successfully. !!! Function src_compile, Line 13, Exitcode 2 !!! (no error message) !!! emerge aborting on /usr/portage/dev-util/memprof/memprof-0.4.1-r1.ebuild . Suggestions?
BTW: It also does this on memprof-0.4.1.ebuild: gcc -mcpu=k6 -march=k6 -O3 -pipe -Wall -o memprof bfdutils.o inode.o leakdetect.o main.o process.o profile.o server.o tree.o -rdynamic -L/usr/lib -L/usr/X11R6/lib -lglade-gnome -lglade -lxml -lz -lgnomeui -lart_lgpl -lgdk_imlib -lSM -lICE -lgtk -lgdk -lgmodule -ldl -lXi -lXext -lX11 -lgnome -lgnomesupport -lesd -lasound -laudiofile -lm -ldb1 -lglib -Wl,-Bstatic -lbfd -liberty -Wl,-Bdynamic server.o: In function `create_control_socket': server.o(.text+0xe8): the use of `mktemp' is dangerous, better use `mkstemp' /usr/lib/libbfd.a(bfd.o): In function `bfd_scan_vma': bfd.o(.text+0x21d): undefined reference to `_sch_istable' /usr/lib/libbfd.a(srec.o): In function `srec_scan': srec.o(.text+0xc5): undefined reference to `_sch_istable' srec.o(.text+0x2df): undefined reference to `_sch_istable' srec.o(.text+0x501): undefined reference to `_sch_istable' srec.o(.text+0x5dc): undefined reference to `_sch_istable' /usr/lib/libbfd.a(binary.o)(.text+0x188): more undefined references to `_sch_istable' follow /usr/lib/libbfd.a(elf-strtab.o): In function `_bfd_elf_strtab_finalize': elf-strtab.o(.text+0x1cb): undefined reference to `htab_create' elf-strtab.o(.text+0x1e0): undefined reference to `htab_create' elf-strtab.o(.text+0x253): undefined reference to `htab_find_slot_with_hash' elf-strtab.o(.text+0x27a): undefined reference to `htab_find_slot_with_hash' elf-strtab.o(.text+0x2cc): undefined reference to `htab_delete' elf-strtab.o(.text+0x2e1): undefined reference to `htab_delete' /usr/lib/libbfd.a(aout32.o): In function `aout_link_write_symbols': aout32.o(.text+0x4447): undefined reference to `_sch_istable' /usr/lib/libbfd.a(archive.o): In function `_bfd_generic_read_ar_hdr_mag': archive.o(.text+0x1ac): undefined reference to `_sch_istable' /usr/lib/libbfd.a(archures.o): In function `bfd_default_scan': archures.o(.text+0x155): undefined reference to `_sch_istable' /usr/lib/libbfd.a(syms.o): In function `bfd_decode_symclass': syms.o(.text+0x227): undefined reference to `_sch_toupper' /usr/lib/libbfd.a(stabs.o): In function `_bfd_link_section_stabs': stabs.o(.text+0x402): undefined reference to `_sch_istable' /usr/lib/libbfd.a(merge.o): In function `merge_strings': merge.o(.text+0x904): undefined reference to `htab_create' merge.o(.text+0x925): undefined reference to `htab_create' merge.o(.text+0x9bc): undefined reference to `htab_find_slot_with_hash' merge.o(.text+0xa15): undefined reference to `htab_find_slot_with_hash' merge.o(.text+0xa7d): undefined reference to `htab_delete' merge.o(.text+0xa92): undefined reference to `htab_delete' collect2: ld returned 1 exit status make[2]: *** [memprof] Error 1 make[2]: Leaving directory `/var/tmp/portage/memprof-0.4.1/work/memprof-0.4.1' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/memprof-0.4.1/work/memprof-0.4.1' make: *** [all-recursive-am] Error 2 !!! ERROR: The ebuild did not complete successfully. !!! Function src_compile, Line 13, Exitcode 2 !!! (no error message) !!! emerge aborting on /usr/portage/dev-util/memprof/memprof-0.4.1.ebuild .
This bug is not related to the other bugs which I have submitted that are memory-related. This build fails exactly the same way EACH time I build it (unlike the others). This is certainly a library problem, as indicated by the linker error.
I did some more digging and found out who provides the libbfd that the build is complaining about. It's from sys-devel/binutils. So I checked /var/db/pkg to see what I had installed and found that there were two versions installed/merged: binutils-2.11.90.0.7 binutils-2.11.92.0.12.3-r1 So I unmerged binutils-2.11.90.0.7: ebuild binutils-2.11.90.0.7/binutils-2.11.90.0.7.ebuild unmerge Then re-merged the newer binutils-2.11.92.0.12.3-r1: emerge b-2.11.92.0.12.3-r1/binutils-2.11.92.0.12.3-r1.ebuild Then I re-built memprof: emerge memprof-0.4.1-r1.ebuild and it built just fine. So mystery solved (except I don't know how I got two copies of binutils merged... oh well).