[phobos] clock_gettime changes

Jonathan M Davis jmdavisProg at gmx.com
Sat Nov 20 01:43:53 PST 2010


On Saturday 20 November 2010 01:33:45 Brad Roberts wrote:
> ... seems to have broken both the druntime and phobos unit tests.
> 
> http://d.puremagic.com/test-results/test.ghtml?runid=3025
> 
> druntime's error:
> unittest.o: In function
> `_D4core4sync6config7mktspecFKS4core3sys5posix6signal8timespeclZv':
> src/rt/typeinfo/ti_wchar.d:(.text._D4core4sync6config7mktspecFKS4core3sys5p
> osix6signal8timespeclZv+0xa): undefined reference to `clock_gettime'
> 
> phobos' error:
> unittest.o: In function
> `_D4core4sync6config7mktspecFKS4core3sys5posix6signal8timespeclZv':
> src/rt/typeinfo/ti_wchar.d:(.text._D4core4sync6config7mktspecFKS4core3sys5p
> osix6signal8timespeclZv+0xa): undefined reference to `clock_gettime'
> 
> Adding -L-lrt to the DFLAGS variable in dmd.conf fixes the problem. 
> That'll need to be reflected in the shipped dmd.conf, assuming it's the
> right fix.  I don't have access to the other posix platforms to see if
> it's needed there or not.

librt is required for clock_gettime(), so that is the correct fix. Apparently, 
MacOS doesn't have clock_gettime(), so it will continue to use gettimeofday() 
and won't need librt (it probably isn't on the system anyway, or it would have 
clock_gettime()). I have no idea about FreeBSD.

- Jonathan M Davis


More information about the phobos mailing list