[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libposix

From: Bruno Haible
Subject: Re: libposix
Date: Mon, 4 Oct 2010 21:55:26 +0200
User-agent: KMail/1.9.9

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.

2)   libposix_la_LIBADD += $(LIB_CLOCK_GETTIME)

   Link with the library that configure has determined is needed for
   clock_gettime. And many more:

$ for m in `./posix-modules` ; do ./gnulib-tool --extract-link-directive $m ; 































$(LTLIBICONV) when linking with libtool, $(LIBICONV) otherwise

$(LTLIBICONV) when linking with libtool, $(LIBICONV) otherwise








































The reason is that gnulib-tool does not set _LIBADD or _LDFLAGS variables.
You have to do it, based on the 'Link:' directives in the module descriptions.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]