Bug 457622 - linking against libdbus fails: undefined reference to `__libc_csu_fini'
linking against libdbus fails: undefined reference to `__libc_csu_fini'
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: binutils (Show other bugs)
9
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Jan Kratochvil
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-01 16:26 EDT by Sam Steingold
Modified: 2012-01-20 08:40 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-09-08 12:05:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
C file which fails (1.73 KB, text/x-csrc)
2008-08-01 16:26 EDT, Sam Steingold
no flags Details
List of the packages on the test host. (5.66 KB, application/octet-stream)
2008-08-19 14:13 EDT, Jan Kratochvil
no flags Details
list of packages on the machine where the bug is exhibited (11.32 KB, application/octet-stream)
2008-08-19 14:50 EDT, Sam Steingold
no flags Details
strace dump (76.33 KB, application/octet-stream)
2008-09-04 11:08 EDT, Sam Steingold
no flags Details

  None (edit)
Description Sam Steingold 2008-08-01 16:26:38 EDT
Description of problem:


Version-Release number of selected component (if applicable):
dbus-1.2.1-1.fc9.i386
dbus-devel-1.2.1-1.fc9.i386

How reproducible:
always

Steps to Reproduce:
C file is attached
gcc -o conftest -g -O2 libc-csu.c -L/lib -ldbus-1
(note: "-L/lib -ldbus-1" come from
/usr/bin/pkg-config --libs dbus-1)

Actual results:

/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crt1.o: In function `_start':
(.text+0xc): undefined reference to `__libc_csu_fini'
/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crt1.o: In function `_start':
(.text+0x11): undefined reference to `__libc_csu_init'
collect2: ld returned 1 exit status



Expected results:

the file is compiled successfully
Comment 1 Sam Steingold 2008-08-01 16:26:38 EDT
Created attachment 313229 [details]
C file which fails
Comment 2 David Zeuthen 2008-08-01 18:44:25 EDT
This doesn't look like a problem with D-Bus. Closing.
Comment 3 Sam Steingold 2008-08-02 23:10:41 EDT
if this is not a problem with dbus - what is this a problem with?!
please reassign it!
Comment 4 David Zeuthen 2008-08-14 12:52:12 EDT
(In reply to comment #3)
> if this is not a problem with dbus - what is this a problem with?!
> please reassign it!

Why do you think it's not a bug with your program?
Comment 5 Sam Steingold 2008-08-14 12:59:17 EDT
please take a look at the program.
it comes from autoconf and is completely trivial.
note that the error comes from the linker, not the compiler.
Comment 6 David Zeuthen 2008-08-14 13:08:19 EDT
(In reply to comment #5)
> please take a look at the program.
> it comes from autoconf and is completely trivial.
> note that the error comes from the linker, not the compiler.

Reopen the bug and assign it to the toolchain guys?
Comment 7 Sam Steingold 2008-08-14 13:32:31 EDT
(In reply to comment #6)
> (In reply to comment #5)
> > please take a look at the program.
> > it comes from autoconf and is completely trivial.
> > note that the error comes from the linker, not the compiler.
> 
> Reopen the bug and assign it to the toolchain guys?

please do.
I don't see a "toolchain" Component.
thanks.
Comment 8 Jan Kratochvil 2008-08-19 14:13:07 EDT
Created attachment 314566 [details]
List of the packages on the test host.
Comment 9 Jan Kratochvil 2008-08-19 14:14:45 EDT
I have the problem unreproducible, feel free to reopen the Bug with additional info.
Please try at least if you do not have some local installation corruption:
rpm -V binutils dbus-devel gcc glibc glibc-common glibc-devel glibc-headers gmp kernel-headers libcap mpfr
Comment 10 Sam Steingold 2008-08-19 14:47:57 EDT
(In reply to comment #9)
> I have the problem unreproducible, feel free to reopen the Bug with additional
> info.
> Please try at least if you do not have some local installation corruption:
> rpm -V binutils dbus-devel gcc glibc glibc-common glibc-devel glibc-headers gmp
> kernel-headers libcap mpfr

$ sudo rpm -V binutils dbus-devel gcc glibc glibc-common glibc-devel glibc-headers gmp kernel-headers libcap mpfr
finishes successfully, produces no output, exit code 0.
$ rpm -q binutils dbus-devel gcc glibc glibc-common glibc-devel glibc-headers gmp kernel-headers libcap mpfr
binutils-2.18.50.0.6-5.fc9.i386
dbus-devel-1.2.1-1.fc9.i386
gcc-4.3.0-8.i386
glibc-2.8-8.i686
glibc-common-2.8-8.i386
glibc-devel-2.8-8.i386
glibc-headers-2.8-8.i386
gmp-4.2.2-7.fc9.i386
kernel-headers-2.6.25.14-108.fc9.i386
libcap-2.06-4.fc9.i386
mpfr-2.3.0-3.fc9.i386
$
Comment 11 Sam Steingold 2008-08-19 14:50:36 EDT
Created attachment 314568 [details]
list of packages on the machine where the bug is exhibited
Comment 12 Denys Vlasenko 2008-08-21 08:30:57 EDT
Just a data point. Works on my machine.

$ rpm -q binutils dbus-devel gcc glibc glibc-common glibc-devel glibc-headers gmp kernel-headers libcap mpfr
binutils-2.18.50.0.6-5.fc9.x86_64
dbus-devel-1.2.1-1.fc9.x86_64
gcc-4.3.0-8.x86_64
glibc-2.8-8.x86_64
glibc-2.8-8.i386
glibc-common-2.8-8.x86_64
glibc-devel-2.8-8.x86_64
glibc-devel-2.8-8.i386
glibc-headers-2.8-8.x86_64
gmp-4.2.2-7.fc9.x86_64
kernel-headers-2.6.25.11-97.fc9.x86_64
libcap-2.06-4.fc9.x86_64
mpfr-2.3.0-3.fc9.x86_64
Comment 13 Jan Kratochvil 2008-08-30 15:36:20 EDT
I believe you have there an excessive (as it is not a part of any shipped rpm) file `/lib/libc.a' as can be reproduced by `ar rcs /lib/libc.a'.
Otherwise please submit the dump `x' from:
strace -s2000 -f -q -o x gcc -o conftest -g -O2 libc-csu.c -L/lib -ldbus-1
Comment 14 Sam Steingold 2008-09-04 11:08:05 EDT
Created attachment 315761 [details]
strace dump
Comment 15 Sam Steingold 2008-09-04 11:09:04 EDT
(In reply to comment #13)
> I believe you have there an excessive (as it is not a part of any shipped rpm)
> file `/lib/libc.a' as can be reproduced by `ar rcs /lib/libc.a'.

no, the file is not there:
$ ls /lib/libc.a
ls: cannot access /lib/libc.a: No such file or directory

> Otherwise please submit the dump `x' from:
> strace -s2000 -f -q -o x gcc -o conftest -g -O2 libc-csu.c -L/lib -ldbus-1

$ strace -s2000 -f -q -o x gcc -o conftest -g -O2 libc-csu.c -L/lib -ldbus-1
/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crt1.o: In function `_start':
(.text+0xc): undefined reference to `__libc_csu_fini'
/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crt1.o: In function `_start':
(.text+0x11): undefined reference to `__libc_csu_init'
collect2: ld returned 1 exit status

x.gz is attached
Comment 16 Jan Kratochvil 2008-09-08 10:11:17 EDT
According to the strace dump you have there `/lib/libc.so' but it is not provided by the Fedora rpms.  Fedora provides `/usr/lib/libc.so' instead.
Comment 17 Sam Steingold 2008-09-08 12:05:45 EDT
indeed,
sudo rm -fv /lib/libc.so
appears to have solved the problem.
thanks!
Comment 18 David G. Pickett 2012-01-18 14:02:34 EST
I got burnt when I was moving libraries around, as the missing objects are in libc_nonshared.a, linked in by this cute bit, a text *.so:

$ cat /usr/lib64/libc.so
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a  AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )

Note You need to log in before you can comment on or make changes to this bug.