* [Qemu-devel] qemu-0.8.2 on glibc 2.2.5
@ 2006-07-26 17:38 Bill Rossi
2006-10-23 11:39 ` [Qemu-devel] qemu-0.8.2 on glibc 2.2.5: CLOCK_MONOTONIC not defined Wolfgang Schildbach
0 siblings, 1 reply; 3+ messages in thread
From: Bill Rossi @ 2006-07-26 17:38 UTC (permalink / raw)
To: qemu-devel
Fails to compile on Linux with glibc 2.2.5. CLOCK_MONOTONIC isn't
defined in glibc 2.2.5. The following patch is a workaround:
--- qemu-0.8.2/vl.c 2006-07-22 13:23:34.000000000 -0400
+++ ../qemu-0.8.2/vl.c 2006-07-26 11:37:34.000000000 -0400
@@ -541,7 +541,7 @@
static void init_get_clock(void)
{
use_rt_clock = 0;
-#if defined(__linux__)
+#if 0 //defined(__linux__)
{
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
@@ -553,7 +553,7 @@
static int64_t get_clock(void)
{
-#if defined(__linux__)
+#if 0 //defined(__linux__)
if (use_rt_clock) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] qemu-0.8.2 on glibc 2.2.5: CLOCK_MONOTONIC not defined
2006-07-26 17:38 [Qemu-devel] qemu-0.8.2 on glibc 2.2.5 Bill Rossi
@ 2006-10-23 11:39 ` Wolfgang Schildbach
2006-10-23 17:00 ` Martin Bochnig
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schildbach @ 2006-10-23 11:39 UTC (permalink / raw)
To: qemu-devel
I stumbled upon the same problem as Bill Rossi (see his post below):
The current cvs version of qemu fails to compile on my machine because
CLOCK_MONOTONIC is not defined in my glibc. According to clock_gettime(3),
systems that define this functionality have _POSIX_MONOTONIC_CLOCK and
_POSIX_TIMERS set. Updating the ifdef (see patch below) to include these
makes the offending code go away on my CLOCK_MONOTONIC-less system
(gcc3.3), but continues to include it on a newer system with a later
libgcc. Not sure if the __linux__ in there is still necessary, but I left
it in for good measure.
Please consider for inclusing into CVS.
Thx,
- Wolfgang Schildbach
Index: vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.217
diff -r1.217 vl.c
550c550
< #if defined(__linux__)
---
> #if defined (__linux__) && defined(_POSIX_TIMERS) &&
defined(_POSIX_MONOTONIC_CLOCK)
562c562
< #if defined(__linux__)
---
> #if defined (__linux__) && defined(_POSIX_TIMERS) &&
defined(_POSIX_MONOTONIC_CLOCK)
Bill Rossi wrote on 26.07.2006 19:38:08:
>
> Fails to compile on Linux with glibc 2.2.5. CLOCK_MONOTONIC isn't
> defined in glibc 2.2.5. The following patch is a workaround:
>
> --- qemu-0.8.2/vl.c 2006-07-22 13:23:34.000000000 -0400
> +++ ../qemu-0.8.2/vl.c 2006-07-26 11:37:34.000000000 -0400
> @@ -541,7 +541,7 @@
> static void init_get_clock(void)
> {
> use_rt_clock = 0;
> -#if defined(__linux__)
> +#if 0 //defined(__linux__)
> {
> struct timespec ts;
> if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
> @@ -553,7 +553,7 @@
>
> static int64_t get_clock(void)
> {
> -#if defined(__linux__)
> +#if 0 //defined(__linux__)
> if (use_rt_clock) {
> struct timespec ts;
> clock_gettime(CLOCK_MONOTONIC, &ts);
>
>
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
--
Wolfgang Schildbach
Group Manager Systems Engineering and Consulting
Coding Technologies GmbH
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] qemu-0.8.2 on glibc 2.2.5: CLOCK_MONOTONIC not defined
2006-10-23 11:39 ` [Qemu-devel] qemu-0.8.2 on glibc 2.2.5: CLOCK_MONOTONIC not defined Wolfgang Schildbach
@ 2006-10-23 17:00 ` Martin Bochnig
0 siblings, 0 replies; 3+ messages in thread
From: Martin Bochnig @ 2006-10-23 17:00 UTC (permalink / raw)
To: qemu-devel
Wolfgang Schildbach wrote:
>I stumbled upon the same problem as Bill Rossi (see his post below):
>
>The current cvs version of qemu fails to compile on my machine because
>CLOCK_MONOTONIC is not defined in my glibc. According to clock_gettime(3),
>systems that define this functionality have _POSIX_MONOTONIC_CLOCK and
>_POSIX_TIMERS set. Updating the ifdef (see patch below) to include these
>makes the offending code go away on my CLOCK_MONOTONIC-less system
>(gcc3.3), but continues to include it on a newer system with a later
>libgcc. Not sure if the __linux__ in there is still necessary, but I left
>
>
The same happens on Solaris(11, but probably all versions).
(Note: Solaris uses its own libc not glibc.)
A complete merge of opensolaris.org's current QEMU patch
http://opensolaris.org/os/project/qemu/downloads/
from 0.8.2 to cvs may follow some time next week.
Two other things needed to be changed for cvs.current to build on
Solaris/SunOS5.x.
Martin Bochnig
at nowhere
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-10-23 17:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-26 17:38 [Qemu-devel] qemu-0.8.2 on glibc 2.2.5 Bill Rossi
2006-10-23 11:39 ` [Qemu-devel] qemu-0.8.2 on glibc 2.2.5: CLOCK_MONOTONIC not defined Wolfgang Schildbach
2006-10-23 17:00 ` Martin Bochnig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).