This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix test-suite failure with -Wl,--as-needed


On Sun, Oct 7, 2012 at 8:51 PM, Allan McRae <allan@archlinux.org> wrote:
> When building the test-suite with --as-needed in your LDFLAGS, the
> test test-cond24 fails linking:
>
> /build/nptl/tst-cond24.o: In function `thread_fun_timed':
> tst-cond24.c:(.text+0x30c): undefined reference to `clock_gettime'
> collect2: error: ld returned 1 exit status
>
>
> nptl/ChangeLog:
>
> 2012-10-08      Allan McRae     <allan@archlinux.org>
>
>         *Makefile (LDFLAGS-tst-cond24): Use $(no-as-needed).
>
> ---
>  nptl/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/nptl/Makefile b/nptl/Makefile
> index 67c2627..a89619d 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -275,7 +275,7 @@ gen-as-const-headers = pthread-errnos.sym
>
>  LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst
>
> -LDFLAGS-tst-cond24 = -lrt
> +LDFLAGS-tst-cond24 = $(no-as-needed) -lrt
>
>  include ../Makeconfig
>
> --
> 1.7.12.2
>

For my own curiosity, why is that needed? clock_gettime is provided by
librt, which we're clearly linking against.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]