linking against libebb

15 views
Skip to first unread message

Christian Ost

unread,
Aug 25, 2008, 6:29:29 AM8/25/08
to ebbebb
Hi,

i am experiencing some strange issues when trying to link against
libebb:

(1) linking against libebb.0.1.so (BTW please change the name to
libebb.so-0.1)

gcc -o copperwire copperwire.o -lebb
(created a symlink /usr/lib/libebb.so => /usr/lib/libebb.0.1.so)
=> no error output, however

`ldd -r copperwire` gives

undefined symbol: ebb_server_init (./copperwire)
linux-vdso.so.1 => (0x00007fff1ebfe000)
libptr_array-0.1.so => /usr/lib/libptr_array-0.1.so
(0x00007fb01670d000)
libc.so.6 => /lib/libc.so.6 (0x00007fb0163ab000)
libev.so.3 => /usr/lib/libev.so.3 (0x00007fb01619f000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb01690f000)
libm.so.6 => /lib/libm.so.6 (0x00007fb015f1e000)
librt.so.1 => /lib/librt.so.1 (0x00007fb015d15000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007fb015af9000)

(if i do the linking without -lebb, i get the undefined symbol error -
so somehow the linker
believes to link against libebb, but does not actually do this?)

So I had a look at the example:

make examples gives me:

examples/hello_world.c:11: Warnung: »c« definiert, aber nicht
verwendet
cc -L/usr/lib -lev -L/home/cost/local/libev/lib -L/usr/lib -lgnutls -L/
home/cost/local/libeio/lib -leio -Wall -I. -I/usr/include -I/home/cost/
local/libev/include -I/usr/include -I/home/cost/local/libeio/include -
DVERSION=\"0.1\" -DHAVE_GNUTLS -DHAVE_EIO -lev -o examples/hello_world
examples/hello_world.o libebb.a
cc: examples/hello_world.o: No such file or directory

so there seems to be some error in your Makefile, however saw you
tried linking
against libebb.a and tried this, too:

(2) linking against libebb.a (using -lgnutls -lev)

linking succeeds, but when trying to run the resulting executable I
get:

*** stack smashing detected ***: /home/cost/kupferwerk/copperwire/
debug/./src/copperwire terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x37)[0x7f2a7171f607]
/lib/libc.so.6(__fortify_fail+0x0)[0x7f2a7171f5d0]
/home/cost/kupferwerk/copperwire/debug/./src/copperwire[0x401763]
/lib/libc.so.6(__libc_start_main+0xf4)[0x7f2a716501c4]
/home/cost/kupferwerk/copperwire/debug/./src/copperwire[0x401669]
======= Memory map: ========
00400000-0040f000 r-xp 00000000 08:04
811354 /home/cost/kupferwerk/copperwire/
debug/src/copperwire
0060e000-0060f000 rw-p 0000e000 08:04
811354 /home/cost/kupferwerk/copperwire/
debug/src/copperwire
0060f000-00630000 rw-p 0060f000 00:00
0 [heap]
7f2a70506000-7f2a70513000 r-xp 00000000 08:04
1392704 /lib/libgcc_s.so.1
7f2a70513000-7f2a70713000 ---p 0000d000 08:04
1392704 /lib/libgcc_s.so.1
7f2a70713000-7f2a70714000 rw-p 0000d000 08:04
1392704 /lib/libgcc_s.so.1
7f2a70714000-7f2a7072a000 r-xp 00000000 08:04
1392757 /lib/libpthread-2.7.so
7f2a7072a000-7f2a7092a000 ---p 00016000 08:04
1392757 /lib/libpthread-2.7.so
7f2a7092a000-7f2a7092c000 rw-p 00016000 08:04
1392757 /lib/libpthread-2.7.so
7f2a7092c000-7f2a70930000 rw-p 7f2a7092c000 00:00 0
7f2a70930000-7f2a70933000 r-xp 00000000 08:04
1392708 /lib/libgpg-error.so.0.3.0
7f2a70933000-7f2a70b32000 ---p 00003000 08:04
1392708 /lib/libgpg-error.so.0.3.0
7f2a70b32000-7f2a70b33000 rw-p 00002000 08:04
1392708 /lib/libgpg-error.so.0.3.0
7f2a70b33000-7f2a70b3b000 r-xp 00000000 08:04
1392763 /lib/librt-2.7.so
7f2a70b3b000-7f2a70d3a000 ---p 00008000 08:04
1392763 /lib/librt-2.7.so
7f2a70d3a000-7f2a70d3c000 rw-p 00007000 08:04
1392763 /lib/librt-2.7.so
7f2a70d3c000-7f2a70dbc000 r-xp 00000000 08:04
1392716 /lib/libm-2.7.so
7f2a70dbc000-7f2a70fbb000 ---p 00080000 08:04
1392716 /lib/libm-2.7.so
7f2a70fbb000-7f2a70fbd000 rw-p 0007f000 08:04
1392716 /lib/libm-2.7.so
7f2a70fbd000-7f2a71009000 r-xp 00000000 08:04
1392706 /lib/libgcrypt.so.11.2.3
7f2a71009000-7f2a71208000 ---p 0004c000 08:04
1392706 /lib/libgcrypt.so.11.2.3
7f2a71208000-7f2a7120b000 rw-p 0004b000 08:04
1392706 /lib/libgcrypt.so.11.2.3
7f2a7120b000-7f2a71221000 r-xp 00000000 08:04
3074389 /usr/lib/libz.so.1.2.3.3
7f2a71221000-7f2a71421000 ---p 00016000 08:04
3074389 /usr/lib/libz.so.1.2.3.3
7f2a71421000-7f2a71422000 rw-p 00016000 08:04
3074389 /usr/lib/libz.so.1.2.3.3
7f2a71422000-7f2a71432000 r-xp 00000000 08:04
3074313 /usr/lib/libtasn1.so.3.0.12
7f2a71432000-7f2a71631000 ---p 00010000 08:04
3074313 /usr/lib/libtasn1.so.3.0.12
7f2a71631000-7f2a71632000 rw-p 0000f000 08:04
3074313 /usr/lib/libtasn1.so.3.0.12
7f2a71632000-7f2a7178a000 r-xp 00000000 08:04
1392679 /lib/libc-2.7.so
7f2a7178a000-7f2a7198a000 ---p 00158000 08:04
1392679 /lib/libc-2.7.so
7f2a7198a000-7f2a7198d000 r--p 00158000 08:04
1392679 /lib/libc-2.7.so
7f2a7198d000-7f2a7198f000 rw-p 0015b000 08:04
1392679 /lib/libc-2.7.so
7f2a7198f000-7f2a71994000 rw-p 7f2a7198f000 00:00 0
7f2a71994000-7f2a719a0000 r-xp 00000000 08:04
3075145 /usr/lib/libev.so.3.0.0
7f2a719a0000-7f2a71b9f000 ---p 0000c000 08:04
3075145 /usr/lib/libev.so.3.0.0
7f2a71b9f000-7f2a71ba0000 rw-p 0000b000 08:04
3075145 /usr/lib/libev.so.3.0.0
7f2a71ba0000-7f2a71c1b000 r-xp 00000000 08:04
3073667 /usr/lib/libgnutls.so.13.9.1
7f2a71c1b000-7f2a71e1a000 ---p 0007b000 08:04
3073667 /usr/lib/libgnutls.so.1Aborted

Would be nice, if someone had a suggestion how to solve this
problem...

Thank you very much!


Christian

Christian Ost

unread,
Aug 25, 2008, 6:58:06 AM8/25/08
to ebbebb
ok, the stack smashing error was due to a programming mistake on
my behalf, the second configuration actually works.

However two poitns remain:

What could cause the strange behaviour in (1)?

Please update your Makefile to place hello_world.o
in ./examples/ instead of .

Thanks!


Christian

ry dahl

unread,
Aug 25, 2008, 11:25:52 AM8/25/08
to ebb...@googlegroups.com
Hey Christian,

Thanks for looking at this. These linking problems are always a pain
for me. I've updated the Makefile - and things seem to be working
okay. I'm still have a strange issue with callbacks linked against the
so. I'll try to fix that soon.

I updated the make install/uninstall tasks. So you should be able to
use that. For the moment link against the .a if you're experiencing my
callback problem too.


ry

Reply all
Reply to author
Forward
0 new messages