Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 150557 - dev-libs/glib-2.12.4 fails to compile on g/fbsd.
Summary: dev-libs/glib-2.12.4 fails to compile on g/fbsd.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: High normal (vote)
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-09 03:53 UTC by Javier Villavicencio (RETIRED)
Modified: 2006-10-09 05:23 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
glib-2.12.4-clock_gettime.patch (glib-2.12.4-clock_gettime.patch,309 bytes, patch)
2006-10-09 03:54 UTC, Javier Villavicencio (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Javier Villavicencio (RETIRED) gentoo-dev 2006-10-09 03:53:27 UTC
glib configure checks for the system support of the function clock_gettime and of the definition _POSIX_MONOTONIC_CLOCK to be >= 0, but in FreeBSD the latter is defined as -1

the code in gtimer.c checks for both HAVE_CLOCK_GETTIME and HAVE_MONOTONIC_CLOCK to be defined  in order to use clock_gettime() and the struct timespec over struct timeval, defining USE_CLOCK_GETTIME to do so.

But in the line 260 of gtimer.c instead of continue using USE_CLOCK_GETTIME to enable this functionality it uses HAVE_CLOCK_GETTIME, raising the following errors on Gentoo/FreeBSD:

gtimer.c: In function 'IA__g_timer_elapsed':
gtimer.c:264: error: 'struct timeval' has no member named 'tv_nsec'
gtimer.c:264: error: 'struct timeval' has no member named 'tv_nsec'
gtimer.c:266: error: 'struct timeval' has no member named 'tv_nsec'
gtimer.c:270: error: 'struct timeval' has no member named 'tv_nsec'
gtimer.c:270: error: 'struct timeval' has no member named 'tv_nsec'
gtimer.c:270: error: 'struct timeval' has no member named 'tv_nsec'
gtimer.c:273: error: 'struct timeval' has no member named 'tv_nsec'
gtimer.c:282: error: 'struct timeval' has no member named 'tv_nsec'

(as in without USE_CLOCK_GETTIME the GTimer variable is defined as struct timeval, which has the member tv_usec, but with USE_CLOCK_GETTIME it is defined as struct timespec, which has the member named tv_nsec)
Comment 1 Javier Villavicencio (RETIRED) gentoo-dev 2006-10-09 03:54:35 UTC
Created attachment 99185 [details, diff]
glib-2.12.4-clock_gettime.patch

Proposed patch to fix this problem.
Comment 2 Mart Raudsepp gentoo-dev 2006-10-09 05:23:34 UTC
Fixed without revbump (build issue). Thanks!