Bug 57852

Summary: swrast_dri.so.tmp: undefined reference to `clock_gettime'
Product: Mesa Reporter: Vinson Lee <vlee>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: medium CC: alexandre.f.demers, jfonseca
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Add librt linking

Description Vinson Lee 2012-12-03 18:59:44 UTC
mesa: a4311054c78536acba0c3006c5d2805e182fa483 (master)

$ ./autogen.sh --with-dri-drivers= --with-gallium-drivers=swrast
[...]
$ make
[...]
swrast_dri.so.tmp: undefined reference to `clock_gettime'


16f0d70ffe6d42d22b9e6b927b297e75a199aa78 is the first bad commit
commit 16f0d70ffe6d42d22b9e6b927b297e75a199aa78
Author: James Benton <jbenton@vmware.com>
Date:   Mon Dec 3 07:00:37 2012 +0000

    llvmpipe: Implement PIPE_QUERY_TIMESTAMP and PIPE_QUERY_TIME_ELAPSED.
    
    This required an update for the query storage in llvmpipe, there
    can now be an active query per query type, so an occlusion query
    can run at the same time as a time elapsed query.
    
    Based on PIPE_QUERY_TIME_ELAPSED patch from Dave Airlie.
    
    v2: fix up piglits for timers (also from Dave Airlie)
    
    a) if we don't render anything the result is 0, so just
    return the current time
    
    b) add missing screen get_timestamp callback.
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: José Fonseca <jfonseca@vmware.com>

:040000 040000 dd23bb4dce38136b225871f7d9e45735ba288f8b c67764b6789feb066882d829e66e16b7f3b7b552 M	src
Comment 1 Laurent carlier 2012-12-03 22:25:11 UTC
Created attachment 70978 [details] [review]
Add librt linking
Comment 2 Aaron Watry 2012-12-04 01:16:21 UTC
Tested Laurent's patch successfully with r600g with mesa git version 21694b8eac.
Comment 3 Matt Turner 2012-12-04 04:01:20 UTC
*** Bug 57859 has been marked as a duplicate of this bug. ***
Comment 4 Dave Airlie 2012-12-04 04:49:42 UTC
does

http://lists.freedesktop.org/archives/mesa-dev/2012-December/030988.html

help either case?

we may need to fix the patch posted her to use CLOCK_LIB.
Comment 5 Alexandre Demers 2012-12-04 05:14:47 UTC
(In reply to comment #4)
> does
> 
> http://lists.freedesktop.org/archives/mesa-dev/2012-December/030988.html
> 
> help either case?
> 
> we may need to fix the patch posted her to use CLOCK_LIB.

Patch from proposed link doesn't fix the linking process. However, Laurent's patch does the trick for both 64 and 32 bit builds (cross compilation).
Comment 6 Dave Airlie 2012-12-04 08:03:20 UTC
should be fixed in master now. reopen if not.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.