Bug 457622 - linking against libdbus fails: undefined reference to `__libc_csu_fini'
Summary: linking against libdbus fails: undefined reference to `__libc_csu_fini'
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: 9
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jan Kratochvil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-08-01 20:26 UTC by Sam Steingold
Modified: 2012-01-20 13:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-09-08 16:05:45 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
C file which fails (1.73 KB, text/x-csrc)
2008-08-01 20:26 UTC, Sam Steingold
no flags Details
List of the packages on the test host. (5.66 KB, application/octet-stream)
2008-08-19 18:13 UTC, 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 18:50 UTC, Sam Steingold
no flags Details
strace dump (76.33 KB, application/octet-stream)
2008-09-04 15:08 UTC, Sam Steingold
no flags Details

Description Sam Steingold 2008-08-01 20:26:38 UTC
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 20:26:38 UTC
Created attachment 313229 [details]
C file which fails

Comment 2 David Zeuthen 2008-08-01 22:44:25 UTC
This doesn't look like a problem with D-Bus. Closing.

Comment 3 Sam Steingold 2008-08-03 03:10:41 UTC
if this is not a problem with dbus - what is this a problem with?!
please reassign it!

Comment 4 David Zeuthen 2008-08-14 16:52:12 UTC
(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 16:59:17 UTC
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 17:08:19 UTC
(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 17:32:31 UTC
(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 18:13:07 UTC
Created attachment 314566 [details]
List of the packages on the test host.

Comment 9 Jan Kratochvil 2008-08-19 18:14:45 UTC
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 18:47:57 UTC
(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 18:50:36 UTC
Created attachment 314568 [details]
list of packages on the machine where the bug is exhibited

Comment 12 Denys Vlasenko 2008-08-21 12:30:57 UTC
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 19:36:20 UTC
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 15:08:05 UTC
Created attachment 315761 [details]
strace dump

Comment 15 Sam Steingold 2008-09-04 15:09:04 UTC
(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 14:11:17 UTC
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 16:05:45 UTC
indeed,
sudo rm -fv /lib/libc.so
appears to have solved the problem.
thanks!

Comment 18 David G. Pickett 2012-01-18 19:02:34 UTC
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.