All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/ programs need -lrt too since they use clock_gettime.
@ 2010-04-09 13:46 Török Edwin
  2010-04-09 19:00 ` Julien Cristau
  0 siblings, 1 reply; 3+ messages in thread
From: Török Edwin @ 2010-04-09 13:46 UTC (permalink / raw)
  To: dri-devel; +Cc: Török Edwin

When using the binutils gold linker, even if libdrm.so is already linked against
-lrt you still need to link your app against -lrt if your app needs symbols from
it.

Signed-off-by: Török Edwin <edwintorok@gmail.com>
---
 tests/Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3e74705..81006ab 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -4,7 +4,7 @@ AM_CPPFLAGS = \
 	-I $(top_srcdir)/include/drm \
 	-I $(top_srcdir)
 
-LDADD = $(top_builddir)/libdrm.la
+LDADD = $(top_builddir)/libdrm.la @CLOCK_LIB@
 
 noinst_PROGRAMS = \
 	dristat \
-- 
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tests/ programs need -lrt too since they use clock_gettime.
  2010-04-09 13:46 [PATCH] tests/ programs need -lrt too since they use clock_gettime Török Edwin
@ 2010-04-09 19:00 ` Julien Cristau
  2010-04-09 19:09   ` Török Edwin
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Cristau @ 2010-04-09 19:00 UTC (permalink / raw)
  To: Török Edwin; +Cc: dri-devel

On Fri, Apr  9, 2010 at 16:46:46 +0300, Török Edwin wrote:

> When using the binutils gold linker, even if libdrm.so is already linked against
> -lrt you still need to link your app against -lrt if your app needs symbols from
> it.
> 
> Signed-off-by: Török Edwin <edwintorok@gmail.com>
> ---
>  tests/Makefile.am |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index 3e74705..81006ab 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -4,7 +4,7 @@ AM_CPPFLAGS = \
>  	-I $(top_srcdir)/include/drm \
>  	-I $(top_srcdir)
>  
> -LDADD = $(top_builddir)/libdrm.la
> +LDADD = $(top_builddir)/libdrm.la @CLOCK_LIB@
>  
>  noinst_PROGRAMS = \
>  	dristat \

The tests don't use librt afaict, the uses of clock_gettime() are in
libdrm and libdrm_intel.  So your explanation doesn't seem to make
sense...

Cheers,
Julien

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tests/ programs need -lrt too since they use clock_gettime.
  2010-04-09 19:00 ` Julien Cristau
@ 2010-04-09 19:09   ` Török Edwin
  0 siblings, 0 replies; 3+ messages in thread
From: Török Edwin @ 2010-04-09 19:09 UTC (permalink / raw)
  To: Julien Cristau; +Cc: dri-devel

On 04/09/2010 10:00 PM, Julien Cristau wrote:
> On Fri, Apr  9, 2010 at 16:46:46 +0300, Török Edwin wrote:
>
>> When using the binutils gold linker, even if libdrm.so is already linked against
>> -lrt you still need to link your app against -lrt if your app needs symbols from
>> it.
>>
>> Signed-off-by: Török Edwin<edwintorok@gmail.com>
>> ---
>>   tests/Makefile.am |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/tests/Makefile.am b/tests/Makefile.am
>> index 3e74705..81006ab 100644
>> --- a/tests/Makefile.am
>> +++ b/tests/Makefile.am
>> @@ -4,7 +4,7 @@ AM_CPPFLAGS = \
>>   	-I $(top_srcdir)/include/drm \
>>   	-I $(top_srcdir)
>>
>> -LDADD = $(top_builddir)/libdrm.la
>> +LDADD = $(top_builddir)/libdrm.la @CLOCK_LIB@
>>
>>   noinst_PROGRAMS = \
>>   	dristat \
>
> The tests don't use librt afaict, the uses of clock_gettime() are in
> libdrm and libdrm_intel.  So your explanation doesn't seem to make
> sense...

The test app links dristat.o, and that includes xf86drm.c that uses 
clock_gettime.

Here is the link error I get without my patch:
make[1]: Entering directory `/home/edwin/drm/tests
libtool: link: gcc -m32 -O2 -g -o .libs/dristat dristat.o 
../.libs/libdrm.so
/usr/bin/ld: dristat.o: in function drmWaitVBlank:../xf86drm.c:1930: 
error: undefined reference to 'clock_gettime'
/usr/bin/ld: dristat.o: in function drmWaitVBlank:../xf86drm.c:1941: 
error: undefined reference to 'clock_gettime'
collect2: ld returned 1 exit status

dristat.c is including xf86drm.c directly (no idea why, shouldn't it get 
what it needs from libdrm.so?):
#include "xf86drm.c"

And xf86drm.c uses clock_gettime:
xf86drm.c:    ret = clock_gettime(CLOCK_MONOTONIC, &timeout);
xf86drm.c:      fprintf(stderr, "clock_gettime failed: %s\n", 
strerror(ret));
xf86drm.c:             clock_gettime(CLOCK_MONOTONIC, &cur);


Best regards,
--Edwin

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-09 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-09 13:46 [PATCH] tests/ programs need -lrt too since they use clock_gettime Török Edwin
2010-04-09 19:00 ` Julien Cristau
2010-04-09 19:09   ` Török Edwin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.