From: Ting Liu Date: Fri, 8 Mar 2013 15:28:29 +0000 (+0000) Subject: qemu: configure properly check if -lrt is needed X-Git-Tag: 2.1~534^2~309 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=6b607b728bdad4126b9af9fe62178b42fb77e555;p=meta-freescale.git qemu: configure properly check if -lrt is needed -lrt is needed to avoid the error "undefined reference to `timer_settime'". add the check in configure. Backport from http://git.qemu.org/?p=qemu.git commit: 8bacde8d86a09699207d85d4bab06162aed18dc4 Fix the below build issue: | ../qemu-timer.o: In function `dynticks_rearm_timer': | .../qemu/1.0+fsl-r2/git/qemu-timer.c:597: undefined reference to `timer_gettime' | .../qemu/1.0+fsl-r2/git/qemu-timer.c:610: undefined reference to `timer_settime' | ../qemu-timer.o: In function `dynticks_stop_timer': | .../qemu/1.0+fsl-r2/git/qemu-timer.c:583: undefined reference to `timer_delete' | ../qemu-timer.o: In function `dynticks_start_timer': | .../qemu/1.0+fsl-r2/git/qemu-timer.c:565: undefined reference to `timer_create' | ivshmem.o: In function `pci_ivshmem_init': | .../qemu/1.0+fsl-r2/git/hw/ivshmem.c:720: undefined reference to `shm_open' | .../qemu/1.0+fsl-r2/git/hw/ivshmem.c:727: undefined reference to `shm_open' | collect2: error: ld returned 1 exit status | make[1]: *** [qemu-system-ppc] Error 1 | make: *** [subdir-ppc-softmmu] Error 2 | ERROR: oe_runmake failed | ERROR: Function failed: do_compile Yocto 1.4_M4 uses qemu 1.3.1 which includes this fix. So this issue only appeared to us. Signed-off-by: Ting Liu --- diff --git a/meta-fsl-ppc/recipes-devtools/qemu/files/0001-configure-properly-check-if-lrt-is-needed.patch b/meta-fsl-ppc/recipes-devtools/qemu/files/0001-configure-properly-check-if-lrt-is-needed.patch new file mode 100644 index 00000000..d74ddb9d --- /dev/null +++ b/meta-fsl-ppc/recipes-devtools/qemu/files/0001-configure-properly-check-if-lrt-is-needed.patch @@ -0,0 +1,43 @@ +From e5906138d8042817cc3b49872dd181c66a11abdf Mon Sep 17 00:00:00 2001 +From: Ting Liu +Date: Wed, 6 Mar 2013 01:56:35 -0600 +Subject: [PATCH] configure: properly check if -lrt is needed + +Upstream-Status: Backport +commit 8bacde8d86a09699207d85d4bab06162aed18dc4 + +Signed-off-by: Natanael Copa +Signed-off-by: Blue Swirl +Signed-off-by: Ting Liu +--- + configure | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 999375a..29b3e30 100755 +--- a/configure ++++ b/configure +@@ -2444,13 +2444,18 @@ fi + cat > $TMPC < + #include +-int main(void) { clockid_t id; return clock_gettime(id, NULL); } ++int main(void) { ++ timer_create(CLOCK_REALTIME, NULL, NULL); ++ return clock_gettime(CLOCK_REALTIME, NULL); ++} + EOF + + if compile_prog "" "" ; then + : +-elif compile_prog "" "-lrt" ; 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" + fi + + if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \ +-- +1.7.9.7 + diff --git a/meta-fsl-ppc/recipes-devtools/qemu/qemu_1.0.bb b/meta-fsl-ppc/recipes-devtools/qemu/qemu_1.0.bb index ff4afde3..19efd9f2 100644 --- a/meta-fsl-ppc/recipes-devtools/qemu/qemu_1.0.bb +++ b/meta-fsl-ppc/recipes-devtools/qemu/qemu_1.0.bb @@ -5,11 +5,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ # This means v1.0 with FSL specific patches applied PV = "1.0+fsl" -PR = "r2" +PR = "r3" DEPENDS += "dtc" -SRC_URI = "git://git.freescale.com/ppc/sdk/qemu.git" +SRC_URI = "git://git.freescale.com/ppc/sdk/qemu.git \ + file://0001-configure-properly-check-if-lrt-is-needed.patch \ +" SRCREV = "7feabd47a814214dc4bebfd97d0eaf30dc50a68f" S = "${WORKDIR}/git"