diff mbox

fix configure: duplicate/incorrect order of -lrt

Message ID CA++az7o4XHTnRVNqZZqUkNE0Y7mJH_eOwNxSxDmjmMKkj-Z8eA@mail.gmail.com
State New
Headers show

Commit Message

Rick Liu May 30, 2014, 9:20 p.m. UTC
From 55a9abb88c53ace0791a01269ad0690c7ddcdcf7 Mon Sep 17 00:00:00 2001
From: Rick Liu <yrliu.ca@gmail.com>
Date: Fri, 30 May 2014 14:10:20 -0700
Subject: [PATCH] fix configure: duplicate/incorrect order of -lrt

'-lrt' flag duplicationi/incorrect order
would cause 'undefined reference to clock_gettime' error during compilation
time.

Before fix:
... -o qemu-bridge-helper qemu-bridge-helper.o    -lrt -pthread
-lgthread-2.0 -lrt -lglib-2.0
After fix:
... -o qemu-bridge-helper qemu-bridge-helper.o    -pthread -lgthread-2.0
-lrt -lglib-2.0

Reference:
http://hi.baidu.com/sanitywolf/item/7a8b69c1e76dd220a0b50ab1

Signed-off-by: Rick Liu <yrliu.ca@gmail.com>
---
 configure |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
1.7.9.5

Comments

Paolo Bonzini May 31, 2014, 7:59 a.m. UTC | #1
Il 30/05/2014 23:20, Rick Liu ha scritto:
>  # we need pthread for static linking. use previous pthread test result
>  elif compile_prog "" "-lrt $pthread_lib" ; then
> -  LIBS="-lrt $LIBS"
> -  libs_qga="-lrt $libs_qga"

The "compile_prog" argument should also place -lrt last.

Paolo
diff mbox

Patch

diff --git a/configure b/configure
index b7635e4..179496a 100755
--- a/configure
+++ b/configure
@@ -2808,8 +2808,8 @@  if compile_prog "" "" ; then
   :
 # we need pthread for static linking. use previous pthread test result
 elif compile_prog "" "-lrt $pthread_lib" ; then
-  LIBS="-lrt $LIBS"
-  libs_qga="-lrt $libs_qga"
+  LIBS="$LIBS -lrt"
+  libs_qga="$libs_qga -lrt"
 fi

 if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \