[openib-general] Re: [PATCH] rdma_lat-09 and results

Grant Grundler iod00d at hp.com
Fri Jun 3 17:33:01 PDT 2005


On Fri, Jun 03, 2005 at 02:45:19AM +0300, Michael S. Tsirkin wrote:
...
> Its possible to link libibverbs and libmthca statically.
> I did it once.

While I can get "mthca.a" to link statically, I get warnings
and the binary doesn't work.

-LOADLIBES += -libverbs
+LOADLIBES += -static -libverbs -lpthread -lsysfs -ldl

$ make
cc -Wall -O2 -g -D_GNU_SOURCE     rdma_lat.c get_clock.c -static -libverbs -lpthread -lsysfs -ldl -L/usr/lib/infiniband/ -lmthca  -o rdma_lat
/usr/lib/gcc-lib/ia64-linux/3.3.5/../../../libibverbs.a(src_libibverbs_la-init.o)(.text+0x22): In function `load_driver':
: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/ccxfeerJ.o(.text+0x132): In function `pp_connect_sock':
/home/src/openib_gen2/src/userspace/perftest/rdma_lat.c:120: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
...
$ ldd rdma_lat
        not a dynamic executable
grundler at gsyprf3$ taskset 1 ./rdma_lat -C -n 100000
libibverbs: Warning: no userspace device-specific driver found for uverbs0
        driver search path: /usr/lib/infiniband
	No IB devices found
	Segmentation fault

Sounds like libibverbs *must* dynamically load mthca.so in order to operate.
I'll look at libibverbs source but this smells like a rat hole.

I'm also wondering why "-dn" and "-Bstatic" do NOT produce static binary.
"man ld" suggests those are equivalents to "-static".

thanks,
grant



More information about the general mailing list