* [Qemu-devel] [PATCH] configure: use glib in glib pkg-config check.
@ 2014-02-03 4:26 Chris Johns
2014-02-03 10:29 ` Daniel P. Berrange
0 siblings, 1 reply; 6+ messages in thread
From: Chris Johns @ 2014-02-03 4:26 UTC (permalink / raw)
To: qemu-devel; +Cc: Chris Johns
Building against with a recent glib in a custom prefix fails because
the gthread cflags in the pkg-config file do not have the correct path
while the glib pc file does.
Signed-off-by: Chris Johns <chrisj@rtems.org>
---
configure | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index b472694..12f730f 100755
--- a/configure
+++ b/configure
@@ -2343,9 +2343,9 @@ if test "$mingw32" = yes; then
else
glib_req_ver=2.12
fi
-if $pkg_config --atleast-version=$glib_req_ver gthread-2.0; then
- glib_cflags=`$pkg_config --cflags gthread-2.0`
- glib_libs=`$pkg_config --libs gthread-2.0`
+if $pkg_config --atleast-version=$glib_req_ver glib-2.0; then
+ glib_cflags=`$pkg_config --cflags glib-2.0`
+ glib_libs=`$pkg_config --libs glib-2.0`
LIBS="$glib_libs $LIBS"
libs_qga="$glib_libs $libs_qga"
else
--
1.8.3.4 (Apple Git-47)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: use glib in glib pkg-config check.
2014-02-03 4:26 [Qemu-devel] [PATCH] configure: use glib in glib pkg-config check Chris Johns
@ 2014-02-03 10:29 ` Daniel P. Berrange
2014-02-03 22:56 ` Chris Johns
0 siblings, 1 reply; 6+ messages in thread
From: Daniel P. Berrange @ 2014-02-03 10:29 UTC (permalink / raw)
To: Chris Johns; +Cc: qemu-devel
On Mon, Feb 03, 2014 at 03:26:15PM +1100, Chris Johns wrote:
> Building against with a recent glib in a custom prefix fails because
> the gthread cflags in the pkg-config file do not have the correct path
> while the glib pc file does.
>
> Signed-off-by: Chris Johns <chrisj@rtems.org>
> ---
> configure | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/configure b/configure
> index b472694..12f730f 100755
> --- a/configure
> +++ b/configure
> @@ -2343,9 +2343,9 @@ if test "$mingw32" = yes; then
> else
> glib_req_ver=2.12
> fi
> -if $pkg_config --atleast-version=$glib_req_ver gthread-2.0; then
> - glib_cflags=`$pkg_config --cflags gthread-2.0`
> - glib_libs=`$pkg_config --libs gthread-2.0`
> +if $pkg_config --atleast-version=$glib_req_ver glib-2.0; then
> + glib_cflags=`$pkg_config --cflags glib-2.0`
> + glib_libs=`$pkg_config --libs glib-2.0`
> LIBS="$glib_libs $LIBS"
> libs_qga="$glib_libs $libs_qga"
> else
This change will cause -pthread linker + compiler flag to be lost.
What glib version are you seeing a problem with ? It seems we should
really fix glib, since this will affect countless 1000's of apps using
it, not try to workaround in all downstream apps.
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: use glib in glib pkg-config check.
2014-02-03 10:29 ` Daniel P. Berrange
@ 2014-02-03 22:56 ` Chris Johns
2014-02-03 23:17 ` Peter Maydell
2014-02-04 9:59 ` Daniel P. Berrange
0 siblings, 2 replies; 6+ messages in thread
From: Chris Johns @ 2014-02-03 22:56 UTC (permalink / raw)
To: Daniel P. Berrange; +Cc: qemu-devel
On 3/02/2014 9:29 pm, Daniel P. Berrange wrote:
> On Mon, Feb 03, 2014 at 03:26:15PM +1100, Chris Johns wrote:
>> Building against with a recent glib in a custom prefix fails because
>> the gthread cflags in the pkg-config file do not have the correct path
>> while the glib pc file does.
>>
>> Signed-off-by: Chris Johns <chrisj@rtems.org>
>> ---
>> configure | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/configure b/configure
>> index b472694..12f730f 100755
>> --- a/configure
>> +++ b/configure
>> @@ -2343,9 +2343,9 @@ if test "$mingw32" = yes; then
>> else
>> glib_req_ver=2.12
>> fi
>> -if $pkg_config --atleast-version=$glib_req_ver gthread-2.0; then
>> - glib_cflags=`$pkg_config --cflags gthread-2.0`
>> - glib_libs=`$pkg_config --libs gthread-2.0`
>> +if $pkg_config --atleast-version=$glib_req_ver glib-2.0; then
>> + glib_cflags=`$pkg_config --cflags glib-2.0`
>> + glib_libs=`$pkg_config --libs glib-2.0`
>> LIBS="$glib_libs $LIBS"
>> libs_qga="$glib_libs $libs_qga"
>> else
>
> This change will cause -pthread linker + compiler flag to be lost.
>
I see in gthread-2.0.pc ..
Libs: -L${libdir} -lgthread-2.0
Cflags: -D_REENTRANT
and qemu includes 'glib.h'. Without the glib pc flags being used the
build fails not being able to find 'glib.h'.
I have no idea about the relationship this has with -pthread. Are both
needed ? It is not a problem on darwin. Qemu is building and running the
RTEMS testsuite nicely on the arm architecture (with the posted zync
reset patch).
>
> What glib version are you seeing a problem with ?
glib-2.39.3 on darwin 13.0.2 (Mavrick).
> It seems we should
> really fix glib, since this will affect countless 1000's of apps using
> it, not try to workaround in all downstream apps.
This is outside of my field of view; to me it still looks qemu specific.
Chris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: use glib in glib pkg-config check.
2014-02-03 22:56 ` Chris Johns
@ 2014-02-03 23:17 ` Peter Maydell
2014-02-04 9:59 ` Daniel P. Berrange
1 sibling, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2014-02-03 23:17 UTC (permalink / raw)
To: Chris Johns; +Cc: QEMU Developers
On 3 February 2014 22:56, Chris Johns <chrisj@rtems.org> wrote:
> On 3/02/2014 9:29 pm, Daniel P. Berrange wrote:
>> This change will cause -pthread linker + compiler flag to be lost.
>>
>
> I see in gthread-2.0.pc ..
>
> Libs: -L${libdir} -lgthread-2.0
> Cflags: -D_REENTRANT
>
> and qemu includes 'glib.h'. Without the glib pc flags being used the build
> fails not being able to find 'glib.h'.
>
> I have no idea about the relationship this has with -pthread. Are both
> needed ? It is not a problem on darwin.
If you're going to make changes to configure it would be wiser to test
them also on Linux. Darwin is a bit of an outlier as far as QEMU goes.
In particular, the reason you're not noticing a problem:
manooth$ pkg-config --cflags gthread-2.0
-I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include
because on MacOSX we don't need any special flags for threading.
However on Linux it's the gthread-2.0 cflags that add -pthread:
pm215@canth:/tmp$ pkg-config --cflags gthread-2.0
-pthread -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include
because we do need special flags, and you've just dropped those.
Incidentally, on my Mountain Lion system:
manooth$ pkg-config --cflags glib-2.0
-I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include
and you can see that both gthread-2.0 and glib-2.0 give the same
set of includes.
(that's some random glib, I think 2.0.25, from fink packages.)
>> What glib version are you seeing a problem with ?
>
>
> glib-2.39.3 on darwin 13.0.2 (Mavrick).
Do Apple provide that with the system these days, or have you
installed that from some third-party (if so, who?)
Anyway, I notice from the glib documentation that the docs for
glib 2.30:
https://developer.gnome.org/glib/2.30/glib-compiling.html
talk about using pkg-config gthread-2.0, but the docs for 2.32
and later:
https://developer.gnome.org/glib/2.32/glib-compiling.html
don't any more. Is this the glib devs inflicting random churn
on everybody's build scripts?
Do you get the same version number from
'pkg-config --version gthread-2.0' as you do from
'pkg-config --version glib-2.0' or is the gthread pkg info
you have an old stale version, maybe?
thanks
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: use glib in glib pkg-config check.
2014-02-03 22:56 ` Chris Johns
2014-02-03 23:17 ` Peter Maydell
@ 2014-02-04 9:59 ` Daniel P. Berrange
2014-02-05 5:31 ` Chris Johns
1 sibling, 1 reply; 6+ messages in thread
From: Daniel P. Berrange @ 2014-02-04 9:59 UTC (permalink / raw)
To: Chris Johns; +Cc: qemu-devel
On Tue, Feb 04, 2014 at 09:56:38AM +1100, Chris Johns wrote:
> On 3/02/2014 9:29 pm, Daniel P. Berrange wrote:
> >On Mon, Feb 03, 2014 at 03:26:15PM +1100, Chris Johns wrote:
> >>Building against with a recent glib in a custom prefix fails because
> >>the gthread cflags in the pkg-config file do not have the correct path
> >>while the glib pc file does.
> >>
> >>Signed-off-by: Chris Johns <chrisj@rtems.org>
> >>---
> >> configure | 6 +++---
> >> 1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >>diff --git a/configure b/configure
> >>index b472694..12f730f 100755
> >>--- a/configure
> >>+++ b/configure
> >>@@ -2343,9 +2343,9 @@ if test "$mingw32" = yes; then
> >> else
> >> glib_req_ver=2.12
> >> fi
> >>-if $pkg_config --atleast-version=$glib_req_ver gthread-2.0; then
> >>- glib_cflags=`$pkg_config --cflags gthread-2.0`
> >>- glib_libs=`$pkg_config --libs gthread-2.0`
> >>+if $pkg_config --atleast-version=$glib_req_ver glib-2.0; then
> >>+ glib_cflags=`$pkg_config --cflags glib-2.0`
> >>+ glib_libs=`$pkg_config --libs glib-2.0`
> >> LIBS="$glib_libs $LIBS"
> >> libs_qga="$glib_libs $libs_qga"
> >> else
> >
> >This change will cause -pthread linker + compiler flag to be lost.
> >
>
> I see in gthread-2.0.pc ..
>
> Libs: -L${libdir} -lgthread-2.0
> Cflags: -D_REENTRANT
>
> and qemu includes 'glib.h'. Without the glib pc flags being used the
> build fails not being able to find 'glib.h'.
>
> I have no idea about the relationship this has with -pthread. Are
> both needed ? It is not a problem on darwin. Qemu is building and
> running the RTEMS testsuite nicely on the arm architecture (with the
> posted zync reset patch).
On Linux there are more flags present in gthread-2.0.pc that are not
present in glib-2.0.pc:
Name: GThread
Description: Thread support for GLib
Requires: glib-2.0
Version: 2.38.2
Libs: -L${libdir} -lgthread-2.0 -pthread
Cflags: -pthread
The 'Requires: glib-2.0' line there means that when QEMU asking for
flags for 'gthread-2.0', it will *also* get any flags listed in the
'glib-2.0.pc' file.
> >
> >What glib version are you seeing a problem with ?
>
> glib-2.39.3 on darwin 13.0.2 (Mavrick).
>
> >It seems we should
> >really fix glib, since this will affect countless 1000's of apps using
> >it, not try to workaround in all downstream apps.
>
> This is outside of my field of view; to me it still looks qemu specific.
I don't believe so. What QEMU is currently doing is correct so I
believe this is either a darwin specific glib bug or a flawed
build of glib on darwin.
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: use glib in glib pkg-config check.
2014-02-04 9:59 ` Daniel P. Berrange
@ 2014-02-05 5:31 ` Chris Johns
0 siblings, 0 replies; 6+ messages in thread
From: Chris Johns @ 2014-02-05 5:31 UTC (permalink / raw)
To: Daniel P. Berrange; +Cc: qemu-devel
On 4/02/2014 8:59 pm, Daniel P. Berrange wrote:
>
> On Linux there are more flags present in gthread-2.0.pc that are not
> present in glib-2.0.pc:
>
> Name: GThread
> Description: Thread support for GLib
> Requires: glib-2.0
> Version: 2.38.2
> Libs: -L${libdir} -lgthread-2.0 -pthread
> Cflags: -pthread
>
>
> The 'Requires: glib-2.0' line there means that when QEMU asking for
> flags for 'gthread-2.0', it will *also* get any flags listed in the
> 'glib-2.0.pc' file.
>
Ah yes this is correct. I will take a closer look. Thanks for this.
>>>
>>> What glib version are you seeing a problem with ?
>>
>> glib-2.39.3 on darwin 13.0.2 (Mavrick).
>>
>>> It seems we should
>>> really fix glib, since this will affect countless 1000's of apps using
>>> it, not try to workaround in all downstream apps.
>>
>> This is outside of my field of view; to me it still looks qemu specific.
>
> I don't believe so. What QEMU is currently doing is correct so I
> believe this is either a darwin specific glib bug or a flawed
> build of glib on darwin.
>
Yes I agree.
Chris
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-02-05 5:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-03 4:26 [Qemu-devel] [PATCH] configure: use glib in glib pkg-config check Chris Johns
2014-02-03 10:29 ` Daniel P. Berrange
2014-02-03 22:56 ` Chris Johns
2014-02-03 23:17 ` Peter Maydell
2014-02-04 9:59 ` Daniel P. Berrange
2014-02-05 5:31 ` Chris Johns
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).