Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 91059 - coreutils links against C++ library
Summary: coreutils links against C++ library
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-01 08:27 UTC by Fabio Strozzi
Modified: 2009-10-27 18:50 UTC (History)
1 user (show)

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


Attachments
emerge acl log (log,108.35 KB, text/plain)
2005-05-01 21:14 UTC, Jakub Moc (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Strozzi 2005-05-01 08:27:09 UTC
On boot, when /etc/init.d/modules is called, modules-update fails complaining that cp cannot load the libstc++.so.6 shared library.
The library has been compiled correctly and after login cp works without problems.

'ldd /bin/cp' shows:
        libacl.so.1 => /lib/libacl.so.1 (0x00002aaaaabc3000)
        libattr.so.1 => /lib/libattr.so.1 (0x00002aaaaacca000)
        libc.so.6 => /lib/libc.so.6 (0x00002aaaaadce000)
        libstdc++.so.6 => //usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3-20050110/libstdc++.so.6 (0x00002aaaab007000)
        libm.so.6 => /lib/libm.so.6 (0x00002aaaab1f7000)
        libgcc_s.so.1 => //usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3-20050110/libgcc_s.so.1 (0x00002aaaab37e000)
        /lib64/ld-linux-x86-64.so.2 (0x00002aaaaaaab000)

Since libstdc++.so.6 is under /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3-20050110/, it's never accessible on boot until /usr is mounted.
IMHO, the problem depends on /etc/init.d/modules being called before /etc/init.d/localmount, which is necessary for /usr/ to be mounted. 
But /etc/init.d/localmount depends on /etc/init.d/modules.
Is that a paradox :-) ?
I tried to modify /sbin/modules-update, and it turns out that /bin/mv is affected by this problem too.
I'm not sure, but maybe the problem started when I builded coreutils (last version I tried is 5.2.1-r5) with the acl USE flag.

Reproducible: Always
Steps to Reproduce:
1. simply boot




Portage 2.0.51.20-r5 (default-linux/amd64/2005.0, gcc-3.4.3-20050110,
glibc-2.3.5-r0, 2.6.11-gentoo-r4-c1 x86_64)
=================================================================
System uname: 2.6.11-gentoo-r4-c1 x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.6.11
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.3
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=athlon64 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O2 -march=athlon64 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox strict usersandbox"
GENTOO_MIRRORS="http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/
http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/
ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://212.54.48.26/gentoo/"
LANG="it_IT@euro"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="amd64 X aalib acl acpi alsa bash-completion berkdb bitmap-fonts crypt
cscope dvd esd flac font-server fortran gd gdbm gif gpm gtk guile imagemagick
imlib ipv6 java jp2 jpeg libwww lzw lzw-tiff mad maildir mbox mikmod mng motif
mozilla mp3 nas ncurses nls nptl nptlonly ogg oggvorbis opengl oss pam perl
plotutils png python readline ruby sdl slang speex ssl svg sysfs syslog tcpd
tetex tiff truetype truetype-fonts type1-fonts usb userlocales vorbis wmf xml2
xmms xpm xrandr xv zlib userland_GNU kernel_linux libc_glibc"
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Carsten Lohrke (RETIRED) gentoo-dev 2005-05-01 09:06:55 UTC
Please use "New -> Gentoo Linux -> Component: Ebuilds" in future. Infrastructure is not the correct addressee.
Comment 2 SpanKY gentoo-dev 2005-05-01 10:06:09 UTC
your /bin/cp should not be linked against the C++ library

please post the output after running:
for f in /bin/cp /lib/libacl.so.1 /lib/libattr.so.1 /lib/libc.so.6 /lib/libm.so.6 libgcc_s.so.1 ; do
    readelf -d ${f} | grep NEEDED
done
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2005-05-01 18:41:48 UTC
Same here:

ldd /bin/cp
        linux-gate.so.1 =>  (0xffffe000)
        libacl.so.1 => /lib/libacl.so.1 (0xb7fd4000)
        libattr.so.1 => /lib/libattr.so.1 (0xb7fcf000)
        libc.so.6 => /lib/libc.so.6 (0xb7eb9000)
        libstdc++.so.5 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/libstdc++.so.5 (0xb7dfc000)
        libm.so.6 => /lib/libm.so.6 (0xb7dd9000)
        libgcc_s.so.1 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/libgcc_s.so.1 (0xb7dd1000)
        /lib/ld-linux.so.2 (0xb7feb000)


0x00000001 (NEEDED)                     Shared library: [libacl.so.1]
 0x00000001 (NEEDED)                     Shared library: [libattr.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [libattr.so.1]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.5]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.5]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [ld-linux.so.2]
 0x00000001 (NEEDED)                     Shared library: [ld-linux.so.2]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
readelf: Error: 'libgcc_s.so.1': No such file

Huh? *confused*
Comment 4 SpanKY gentoo-dev 2005-05-01 20:46:16 UTC
err, that output is useless, try this

for f in /bin/cp /lib/libacl.so.1 /lib/libattr.so.1 /lib/libc.so.6 /lib/libm.so.6 /lib/libgcc_s.so.1 ; do
    echo ${f}
    readelf -d ${f} | grep NEEDED
done
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2005-05-01 20:48:39 UTC
OK. ;-)

/bin/cp
 0x00000001 (NEEDED)                     Shared library: [libacl.so.1]
 0x00000001 (NEEDED)                     Shared library: [libattr.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
/lib/libacl.so.1
 0x00000001 (NEEDED)                     Shared library: [libattr.so.1]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.5]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
/lib/libattr.so.1
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.5]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
/lib/libc.so.6
 0x00000001 (NEEDED)                     Shared library: [ld-linux.so.2]
/lib/libm.so.6
 0x00000001 (NEEDED)                     Shared library: [ld-linux.so.2]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
/lib/libgcc_s.so.1
readelf: Error: '/lib/libgcc_s.so.1': No such file

Of course there is no such file, it
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2005-05-01 20:48:39 UTC
OK. ;-)

/bin/cp
 0x00000001 (NEEDED)                     Shared library: [libacl.so.1]
 0x00000001 (NEEDED)                     Shared library: [libattr.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
/lib/libacl.so.1
 0x00000001 (NEEDED)                     Shared library: [libattr.so.1]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.5]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
/lib/libattr.so.1
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.5]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
/lib/libc.so.6
 0x00000001 (NEEDED)                     Shared library: [ld-linux.so.2]
/lib/libm.so.6
 0x00000001 (NEEDED)                     Shared library: [ld-linux.so.2]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
/lib/libgcc_s.so.1
readelf: Error: '/lib/libgcc_s.so.1': No such file

Of course there is no such file, it´s in /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/
Comment 7 SpanKY gentoo-dev 2005-05-01 20:59:51 UTC
what versions of sys-apps/{acl,attr} do you have emerged ?  i have acl-2.2.7 and attr-2.4.19 and neither link with C++ on my boxes ...
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2005-05-01 21:03:19 UTC
sys-apps/acl-2.2.27 and sys-apps/attr-2.4.19

*more confused*
Comment 9 Jakub Moc (RETIRED) gentoo-dev 2005-05-01 21:07:16 UTC
Actually, there is only one version for both in portage, so not much choice. :-)
Comment 10 SpanKY gentoo-dev 2005-05-01 21:09:16 UTC
no, but not everyone stays up-to-date :P

please run `emerge acl >& log` and attach the log file
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2005-05-01 21:14:14 UTC
Created attachment 57791 [details]
emerge acl log
Comment 12 SpanKY gentoo-dev 2005-05-01 21:22:46 UTC
looks like the final link stage is using g++ for some stupid reason ...

what version of libtool do you have emerged ?  why not post `emerge info` now :p

/usr/bin/libtool --mode=link i686-pc-linux-gnu-gcc -Wl,--version-script,../exports -rpath /lib -version-info 2:0:1 -o libacl.la  acl_add_perm.lo acl_calc_mask.lo acl_clear_perms.lo acl_copy_entry.lo acl_copy_ext.lo acl_copy_int.lo acl_create_entry.lo acl_delete_def_file.lo acl_delete_entry.lo acl_delete_perm.lo acl_dup.lo acl_free.lo acl_from_text.lo acl_get_entry.lo acl_get_fd.lo acl_get_file.lo acl_get_perm.lo acl_get_permset.lo acl_get_qualifier.lo acl_get_tag_type.lo acl_init.lo acl_set_fd.lo acl_set_file.lo acl_set_permset.lo acl_set_qualifier.lo acl_set_tag_type.lo acl_to_text.lo acl_valid.lo acl_size.lo acl_to_any_text.lo acl_entries.lo acl_check.lo acl_error.lo acl_cmp.lo acl_extended_fd.lo acl_extended_file.lo acl_equiv_mode.lo acl_from_mode.lo __acl_to_any_text.lo __acl_to_xattr.lo __acl_from_xattr.lo __acl_reorder_obj_p.lo __libobj.lo __apply_mask_to_mode.lo perm_copy_fd.lo perm_copy_file.lo   -lattr ../libmisc/libmisc.la
g++ -shared -nostdlib /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/../../../crti.o /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/crtbeginS.o  .libs/acl_add_perm.o .libs/acl_calc_mask.o .libs/acl_clear_perms.o .libs/acl_copy_entry.o .libs/acl_copy_ext.o .libs/acl_copy_int.o .libs/acl_create_entry.o .libs/acl_delete_def_file.o .libs/acl_delete_entry.o .libs/acl_delete_perm.o .libs/acl_dup.o .libs/acl_free.o .libs/acl_from_text.o .libs/acl_get_entry.o .libs/acl_get_fd.o .libs/acl_get_file.o .libs/acl_get_perm.o .libs/acl_get_permset.o .libs/acl_get_qualifier.o .libs/acl_get_tag_type.o .libs/acl_init.o .libs/acl_set_fd.o .libs/acl_set_file.o .libs/acl_set_permset.o .libs/acl_set_qualifier.o .libs/acl_set_tag_type.o .libs/acl_to_text.o .libs/acl_valid.o .libs/acl_size.o .libs/acl_to_any_text.o .libs/acl_entries.o .libs/acl_check.o .libs/acl_error.o .libs/acl_cmp.o .libs/acl_extended_fd.o .libs/acl_extended_file.o .libs/acl_equiv_mode.o .libs/acl_from_mode.o .libs/__acl_to_any_text.o .libs/__acl_to_xattr.o .libs/__acl_from_xattr.o .libs/__acl_reorder_obj_p.o .libs/__libobj.o .libs/__apply_mask_to_mode.o .libs/perm_copy_fd.o .libs/perm_copy_file.o -Wl,--whole-archive ../libmisc/.libs/libmisc.a -Wl,--no-whole-archive  -Wl,--rpath -Wl,/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130 -Wl,--rpath -Wl,/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130 /lib/libattr.so -L/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130 -L/usr/i686-pc-linux-gnu/bin -L/usr/i686-pc-linux-gnu/lib -L/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/../../../../i686-pc-linux-gnu/lib -L/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/../../.. /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/libstdc++.so -lm -lc -lgcc_s /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/crtendS.o /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/../../../crtn.o  -Wl,--version-script -Wl,../exports -Wl,-soname -Wl,libacl.so.1 -o .libs/libacl.so.1.1.0
Comment 13 Jakub Moc (RETIRED) gentoo-dev 2005-05-01 21:25:57 UTC
Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.4.20041102-r1, 2.6.11-gentoo-r6 i686)
=================================================================
System uname: 2.6.11-gentoo-r6 i686 AMD Athlon(tm) XP  2200+
Gentoo Base System version 1.6.11
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Apr 29 2005, 09:54:18)]
ccache version 2.4 [enabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.5, 1.8.5-r3, 1.6.3, 1.7.9-r1, 1.4_p6, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r7
sys-devel/libtool:   1.4.3-r4, 1.5.16
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-mcpu=athlon-xp -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-mcpu=athlon-xp -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig buildpkg ccache distlocks sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="cs_CZ"
LINGUAS="cs en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 3dnow X acl acpi alsa apm arts avi bash-completion berkdb bitmap-fonts cdr crypt cups curl dvd dvdr emboss encode fbcon foomaticdb fortran gdbm gif gpm icq imap imlib java jpeg kde kdeenablefinal kdexdeltas libg++ libwww mad maildir mikmod mmx motif mozilla mp3 mpeg ncurses nls nptl nptlonly nvidia offensive ogg opengl pam pdflib perl png python qt quicktime readline sdl slang socks5 spell sse ssl svga tcpd tiff truetype truetype-fonts type1-fonts unicode usb vorbis win32codecs xml xml2 xmms xv zlib linguas_cs linguas_en userland_GNU kernel_linux libc_glibc"
Unset:  ASFLAGS, CBUILD, CTARGET, LC_ALL, LDFLAGS
Comment 14 SpanKY gentoo-dev 2005-05-01 21:33:22 UTC
ugh, whats with version 1.4.5 on your system

try doing `emerge -C libtool && emerge libtool` and see if acl emerges w/out being linked to libstdc++
Comment 15 Jakub Moc (RETIRED) gentoo-dev 2005-05-01 21:44:52 UTC
Look much more sane now...

/bin/cp
 0x00000001 (NEEDED)                     Shared library: [libacl.so.1]
 0x00000001 (NEEDED)                     Shared library: [libattr.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
/lib/libacl.so.1
 0x00000001 (NEEDED)                     Shared library: [libattr.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
/lib/libattr.so.1
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
/lib/libc.so.6
 0x00000001 (NEEDED)                     Shared library: [ld-linux.so.2]
/lib/libm.so.6
 0x00000001 (NEEDED)                     Shared library: [ld-linux.so.2]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
/lib/libgcc_s.so.1
readelf: Error: '/lib/libgcc_s.so.1': No such file

This was a pretty unmaintained box which was upgraded almost from scratch on this weekend, so

1/ Why the old libtool was not upgraded but rather sloted?
2/ Still - what
Comment 16 Jakub Moc (RETIRED) gentoo-dev 2005-05-01 21:44:52 UTC
Look much more sane now...

/bin/cp
 0x00000001 (NEEDED)                     Shared library: [libacl.so.1]
 0x00000001 (NEEDED)                     Shared library: [libattr.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
/lib/libacl.so.1
 0x00000001 (NEEDED)                     Shared library: [libattr.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
/lib/libattr.so.1
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
/lib/libc.so.6
 0x00000001 (NEEDED)                     Shared library: [ld-linux.so.2]
/lib/libm.so.6
 0x00000001 (NEEDED)                     Shared library: [ld-linux.so.2]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
/lib/libgcc_s.so.1
readelf: Error: '/lib/libgcc_s.so.1': No such file

This was a pretty unmaintained box which was upgraded almost from scratch on this weekend, so

1/ Why the old libtool was not upgraded but rather sloted?
2/ Still - what´s wrong with that /lib/libgcc_s.so.1 ?

Anyway, please don´t close this bug b/c I pretty much hijacked it and I don´t see the libtool problem in the original bugreport. ;-)
Comment 17 SpanKY gentoo-dev 2005-05-01 21:48:13 UTC
ignore the libgcc_s.so.1 thing, that's fine

original reporter: please try doing an `emerge sync` and re-emerging acl and see if that fixes this for you
Comment 18 Jakub Moc (RETIRED) gentoo-dev 2005-05-01 21:52:08 UTC
One more thing - I also needed to re-emerge attr, otherwise it was only half-fixed. ;-)
Comment 19 Fabio Strozzi 2005-05-02 15:02:02 UTC
Thank you all, and sorry if I have not been as fast as you :-)
I recompiled acl, attr and coreutils and now the error has disappered on boot.
cp is no more compiled against libstdc++. This problem is fixed.
But /sbin/modules-update still complains at line 58: tail is not found.
Of course, it is under /usr/bin which is not mounted before localmount is called.
Should I open another bug report?
Thanks
Comment 20 SpanKY gentoo-dev 2005-05-02 15:06:06 UTC
there is already another bug or two dealing with modules' dependency on /usr being mounted

i'll chalk this bug up to old packages causing heart burn ;)