Skip to contentSkip to conversation

qemu-traditional: update configure check for -lrt changes in glibc 2.17

PATCH In review Olaf Hering 2 participants 4 messages Dec 5, 2012 – May 1, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-traditional: update configure check for -lrt changes in glibc 2.17

configure uses clock_gettime to check whether -lrt is needed - and don't check other functions. With glibc 2.17 clock_gettime is part of libc, so use timer_gettime instead, which is in -lrt in old and new versions of glibc.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index 904e019..ace3c3e 100755
@@ -1097,7 +1097,7 @@ fi
 cat > $TMPC <<EOF
 #include <signal.h>
 #include <time.h>
-int main(void) { clockid_t id; return clock_gettime(id, NULL); }
+int main(void) { struct itimerspec v; timer_t t; return timer_gettime (t, &v); }
 EOF
 
 rt=no
Signature · 1 line
1.8.0.1
#1 lore raw

Ping

Quoted 23 lines · Olaf Hering

configure uses clock_gettime to check whether -lrt is needed - and don't check other functions. With glibc 2.17 clock_gettime is part of libc, so use timer_gettime instead, which is in -lrt in old and new versions of glibc.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index 904e019..ace3c3e 100755
@@ -1097,7 +1097,7 @@ fi
 cat > $TMPC <<EOF
 #include <signal.h>
 #include <time.h>
-int main(void) { clockid_t id; return clock_gettime(id, NULL); }
+int main(void) { struct itimerspec v; timer_t t; return timer_gettime (t, &v); }
 EOF
 
 rt=no
#2 lore raw

Ping

Quoted 27 lines · Olaf Hering

Ping

Quoted 23 lines · Olaf Hering

configure uses clock_gettime to check whether -lrt is needed - and don't check other functions. With glibc 2.17 clock_gettime is part of libc, so use timer_gettime instead, which is in -lrt in old and new versions of glibc.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index 904e019..ace3c3e 100755
@@ -1097,7 +1097,7 @@ fi
 cat > $TMPC <<EOF
 #include <signal.h>
 #include <time.h>
-int main(void) { clockid_t id; return clock_gettime(id, NULL); }
+int main(void) { struct itimerspec v; timer_t t; return timer_gettime (t, &v); }
 EOF
 
 rt=no
Acked-by
#3 lore raw
Quoted 1 line · Olaf Hering

Ping

Makes sense.

Quoted 29 lines · Olaf Hering
Quoted 28 lines

Ping

Quoted 23 lines · Olaf Hering

configure uses clock_gettime to check whether -lrt is needed - and don't check other functions. With glibc 2.17 clock_gettime is part of libc, so use timer_gettime instead, which is in -lrt in old and new versions of glibc.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index 904e019..ace3c3e 100755
@@ -1097,7 +1097,7 @@ fi
 cat > $TMPC <<EOF
 #include <signal.h>
 #include <time.h>
-int main(void) { clockid_t id; return clock_gettime(id, NULL); }
+int main(void) { struct itimerspec v; timer_t t; return timer_gettime (t, &v); }
 EOF
 
 rt=no