Skip to contentSkip to conversation

build failure with coroutine-gthread

Qemu-devel Aneesh Kumar K.V 4 participants 7 messages Aug 8, 2011 – Aug 10, 2011

lore
Share & tools
lore
#0 lore raw

LINK qemu-ga
coroutine-gthread.o: In function `coroutine_init':
/home/opensource/sources/qemu/qemu-upstream/coroutine-gthread.c:39: undefined reference to `g_thread_init'
collect2: ld returned 1 exit status

The below patch fix the failure. I also added the patch in the VirtFS pull request.

commit 4b76a481ee28166d5f415ef97833c624f4fc0792

Author: Stefan Hajnoczi <[email protected]>
Date:   Mon Aug 8 13:04:05 2011 +0530

coroutine: add gthread dependency

Commit 1fc7bd4a86a2bfeafcec29445871eb97469a2699 removed the gthread and gio dependency since qemu-ga did not require it. Coroutines require gthread, so add it back in.

configure +8 -10
index 0c67a4a..a6687f7 100755
@@ -1844,16 +1844,14 @@ fi
 
 ##########################################
 # glib support probe
-if test "$guest_agent" != "no" ; then
-    if $pkg_config --modversion glib-2.0 > /dev/null 2>&1 ; then
-        glib_cflags=`$pkg_config --cflags glib-2.0 2>/dev/null`
-        glib_libs=`$pkg_config --libs glib-2.0 2>/dev/null`
-        libs_softmmu="$glib_libs $libs_softmmu"
-        libs_tools="$glib_libs $libs_tools"
-    else
-        echo "glib-2.0 required to compile QEMU"
-        exit 1
-    fi
+if $pkg_config --modversion gthread-2.0 > /dev/null 2>&1 ; then
+    glib_cflags=`$pkg_config --cflags gthread-2.0 2>/dev/null`
+    glib_libs=`$pkg_config --libs gthread-2.0 2>/dev/null`
+    libs_softmmu="$glib_libs $libs_softmmu"
+    libs_tools="$glib_libs $libs_tools"
+else
+    echo "glib-2.0 required to compile QEMU"
+    exit 1
 fi
 
 ##########################################
#1 lore raw
Quoted 9 lines · Aneesh Kumar K.V

 LINK  qemu-ga
coroutine-gthread.o: In function `coroutine_init':
/home/opensource/sources/qemu/qemu-upstream/coroutine-gthread.c:39: undefined reference to `g_thread_init'
collect2: ld returned 1 exit status

The below patch fix the failure.  I also added the patch in the VirtFS pull request.

It appears coroutine-core v7 was merged instead of v8. The differences are minor:
* Bisectability: introduce gthread implementation before ucontext/fibers
* Depend on gthread, not just glib, for multithreaded programming

Here is the patchwork link to the gthread dependency patch in case a committer wants to merge it immediately:
http://patchwork.ozlabs.org/patch/106810/

Stefan

#2 lore raw
Quoted 12 lines · Stefan Hajnoczi
Quoted 9 lines · Aneesh Kumar K.V

 LINK  qemu-ga
coroutine-gthread.o: In function `coroutine_init':
/home/opensource/sources/qemu/qemu-upstream/coroutine-gthread.c:39: undefined reference to `g_thread_init'
collect2: ld returned 1 exit status

The below patch fix the failure.  I also added the patch in the VirtFS pull request.

Quoted 9 lines

It appears coroutine-core v7 was merged instead of v8. The differences are minor:
* Bisectability: introduce gthread implementation before ucontext/fibers
* Depend on gthread, not just glib, for multithreaded programming

Here is the patchwork link to the gthread dependency patch in case a committer wants to merge it immediately:
http://patchwork.ozlabs.org/patch/106810/

I added a version that applies to master in the pull request

http://article.gmane.org/gmane.comp.emulators.qemu/112648

Message-id:"[email protected]"

http://repo.or.cz/w/qemu/v9fs.git/commit/4b76a481ee28166d5f415ef97833c624f4fc0792

-aneesh

#3 lore raw
In reply to Stefan Hajnoczi
Quoted 12 lines · Stefan Hajnoczi
Quoted 9 lines · Aneesh Kumar K.V

 LINK  qemu-ga
coroutine-gthread.o: In function `coroutine_init':
/home/opensource/sources/qemu/qemu-upstream/coroutine-gthread.c:39: undefined reference to `g_thread_init'
collect2: ld returned 1 exit status

The below patch fix the failure.  I also added the patch in the VirtFS pull request.

Quoted 8 lines

It appears coroutine-core v7 was merged instead of v8.  The differences are minor:
 * Bisectability: introduce gthread implementation before ucontext/fibers
 * Depend on gthread, not just glib, for multithreaded programming

Here is the patchwork link to the gthread dependency patch in case a committer wants to merge it immediately:
http://patchwork.ozlabs.org/patch/106810/

Coroutines only need gthreads when both ucontext and win32 versions are unavailable. This is handled better by my patch:
http://lists.nongnu.org/archive/html/qemu-devel/2011-08/msg00998.html

#4 lore raw
Quoted 18 lines · Blue Swirl
Quoted 17 lines · Stefan Hajnoczi
Quoted 9 lines · Aneesh Kumar K.V

 LINK  qemu-ga
coroutine-gthread.o: In function `coroutine_init':
/home/opensource/sources/qemu/qemu-upstream/coroutine-gthread.c:39: undefined reference to `g_thread_init'
collect2: ld returned 1 exit status

The below patch fix the failure.  I also added the patch in the VirtFS pull request.

It appears coroutine-core v7 was merged instead of v8.  The differences are minor:
 * Bisectability: introduce gthread implementation before ucontext/fibers
 * Depend on gthread, not just glib, for multithreaded programming

Quoted 7 lines
Quoted 3 lines

Here is the patchwork link to the gthread dependency patch in case a committer wants to merge it immediately:
http://patchwork.ozlabs.org/patch/106810/

Coroutines only need gthreads when both ucontext and win32 versions are unavailable. This is handled better by my patch:
http://lists.nongnu.org/archive/html/qemu-devel/2011-08/msg00998.html

We would soon need that for VirtFS. So that will be another check of if (linux && atttr )

-aneesh

#5 lore raw
In reply to Blue Swirl
Quoted 18 lines · Blue Swirl
Quoted 17 lines · Stefan Hajnoczi
Quoted 9 lines · Aneesh Kumar K.V

 LINK  qemu-ga
coroutine-gthread.o: In function `coroutine_init':
/home/opensource/sources/qemu/qemu-upstream/coroutine-gthread.c:39: undefined reference to `g_thread_init'
collect2: ld returned 1 exit status

The below patch fix the failure.  I also added the patch in the VirtFS pull request.

It appears coroutine-core v7 was merged instead of v8.  The differences are minor:
 * Bisectability: introduce gthread implementation before ucontext/fibers
 * Depend on gthread, not just glib, for multithreaded programming

Quoted 7 lines
Quoted 3 lines

Here is the patchwork link to the gthread dependency patch in case a committer wants to merge it immediately:
http://patchwork.ozlabs.org/patch/106810/

Coroutines only need gthreads when both ucontext and win32 versions are unavailable. This is handled better by my patch:
http://lists.nongnu.org/archive/html/qemu-devel/2011-08/msg00998.html

Instead of adding more conditions around glib we should unconditionally depend on it. Dependencies always have an associated cost but I intend to use glib instead of reimplementing platform abstractions and common data structures.

The cost of maintaining non-emulation/non-virtualization code isn't worth avoiding the dependency. In fact I wish glib provided coroutines so we didn't need to implement them ourselves.

Stefan

#6 lore raw
Quoted 23 lines · Stefan Hajnoczi
Quoted 22 lines · Blue Swirl
Quoted 20 lines · Stefan Hajnoczi
Quoted 9 lines · Aneesh Kumar K.V

 LINK  qemu-ga
coroutine-gthread.o: In function `coroutine_init':
/home/opensource/sources/qemu/qemu-upstream/coroutine-gthread.c:39: undefined reference to `g_thread_init'
collect2: ld returned 1 exit status

The below patch fix the failure.  I also added the patch in the VirtFS pull request.

It appears coroutine-core v7 was merged instead of v8.  The differences are minor:
 * Bisectability: introduce gthread implementation before ucontext/fibers
 * Depend on gthread, not just glib, for multithreaded programming

Here is the patchwork link to the gthread dependency patch in case a committer wants to merge it immediately:
http://patchwork.ozlabs.org/patch/106810/

Quoted 8 lines
Quoted 3 lines

Coroutines only need gthreads when both ucontext and win32 versions are unavailable. This is handled better by my patch:
http://lists.nongnu.org/archive/html/qemu-devel/2011-08/msg00998.html

Instead of adding more conditions around glib we should unconditionally depend on it.  Dependencies always have an associated cost but I intend to use glib instead of reimplementing platform abstractions and common data structures.

I also thought glib dependency was going to be unconditional, but then this conditional dependency was introduced. Either make it unconditional or fix the condition.

Quoted 6 lines

The cost of maintaining non-emulation/non-virtualization code isn't worth avoiding the dependency.  In fact I wish glib provided coroutines so we didn't need to implement them ourselves.

Stefan