On 10/04/2010 01:55 PM, Bruno Haible wrote:
Hello Bruce,

/bin/sh ../libtool --tag=CC --mode=link gcc  -g -O2   -o pt_chown pt_chown.o 
libposix.la
libtool: link: gcc -g -O2 -o .libs/pt_chown pt_chown.o
./.libs/libposix.so -Wl,-rpath -Wl,/usr/local/lib
./.libs/libposix.so: undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
make[4]: *** [pt_chown] Error 1

libposix.so ought to have been linked with -lrt. I suggest two modifications:

1)   libposix_la_LDFLAGS += -no-undefined

    This should ensure that on all platforms, the linking of libposix.so will
    fail if there are undefined references. Without waiting for a program to
    be linked with libposix.

With the nice side effect of allowing it to be used on cygwin and mingw as a shared library. :)

--
Eric Blake   [email protected]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Reply via email to