qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] qga-win: fixes for builds with VSS/fsfreeze enabled
@ 2019-02-12 21:29 Michael Roth
  2019-02-12 21:29 ` [Qemu-devel] [PATCH 1/2] qga-win: include glib when building VSS DLL Michael Roth
  2019-02-12 21:29 ` [Qemu-devel] [PATCH 2/2] qga-win: fix VSS build breakage due to unintended gnu99 C++ flag Michael Roth
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Roth @ 2019-02-12 21:29 UTC (permalink / raw)
  To: qemu-devel

These fix a couple build regressions that have slipped in over that past
couple months and hopefully will help avoid future breakages.

 qga/vss-win32/Makefile.objs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 1/2] qga-win: include glib when building VSS DLL
  2019-02-12 21:29 [Qemu-devel] [PATCH 0/2] qga-win: fixes for builds with VSS/fsfreeze enabled Michael Roth
@ 2019-02-12 21:29 ` Michael Roth
  2019-02-13  9:12   ` Daniel P. Berrangé
  2019-02-12 21:29 ` [Qemu-devel] [PATCH 2/2] qga-win: fix VSS build breakage due to unintended gnu99 C++ flag Michael Roth
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Roth @ 2019-02-12 21:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P . Berrangé, qemu-stable

Commit 3ebee3b191e defined assert() as g_assert(), but when we build
the VSS DLL component of QGA (to handle fsfreeze) we do not include
glib, which results in breakage when building with VSS support enabled.

Fix this by including glib. Since the VSS DLL is built statically,
this introduces an additional dependency on static glib and supporting
libs for the mingw environment (possibly why we didn't include glib
originally), but VSS support already has very specific prerequisites
so it shouldn't affect too many build environments.

Since the VSS DLL code does use qemu/osdep.h, this should also help
avoid future breakages and possibly allow for some clean ups in current
VSS code.

Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Cc: Daniel P. Berrangé <berrange@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/vss-win32/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qga/vss-win32/Makefile.objs b/qga/vss-win32/Makefile.objs
index 23d08da225..dad9d1b0ba 100644
--- a/qga/vss-win32/Makefile.objs
+++ b/qga/vss-win32/Makefile.objs
@@ -5,7 +5,7 @@ qga-vss-dll-obj-y += requester.o provider.o install.o
 obj-qga-vss-dll-obj-y = $(addprefix $(obj)/, $(qga-vss-dll-obj-y))
 $(obj-qga-vss-dll-obj-y): QEMU_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wredundant-decls -fstack-protector-all -fstack-protector-strong, $(QEMU_CFLAGS)) -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor
 
-$(obj)/qga-vss.dll: LDFLAGS = -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup -lole32 -loleaut32 -lshlwapi -luuid -static
+$(obj)/qga-vss.dll: LDFLAGS = -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup -lglib-2.0 -lole32 -loleaut32 -lshlwapi -luuid -lintl -lws2_32 -static
 $(obj)/qga-vss.dll: $(obj-qga-vss-dll-obj-y) $(SRC_PATH)/$(obj)/qga-vss.def
 	$(call quiet-command,$(CXX) -o $@ $(qga-vss-dll-obj-y) $(SRC_PATH)/qga/vss-win32/qga-vss.def $(CXXFLAGS) $(LDFLAGS),"LINK","$(TARGET_DIR)$@")
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 2/2] qga-win: fix VSS build breakage due to unintended gnu99 C++ flag
  2019-02-12 21:29 [Qemu-devel] [PATCH 0/2] qga-win: fixes for builds with VSS/fsfreeze enabled Michael Roth
  2019-02-12 21:29 ` [Qemu-devel] [PATCH 1/2] qga-win: include glib when building VSS DLL Michael Roth
@ 2019-02-12 21:29 ` Michael Roth
  2019-02-13  9:13   ` Daniel P. Berrangé
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Roth @ 2019-02-12 21:29 UTC (permalink / raw)
  To: qemu-devel

Commit 7be41675f7c set -std=gnu99 for C code via QEMU_CFLAGS. Currently
we generate a "custom" QEMU_CXXFLAGS for VSS DLL C++ build by
filtering out some options from QEMU_CFLAGS and adding some others.
Since we don't filter out -std=gnu99 currently this breaks builds when
VSS support is enabled.

We could keep the existing approach, filter out -std=gnu99 from
QEMU_CFLAGS, and add -std=gnu++98, like configure currently does for
QEMU_CXXFLAGS, but as it turns out our resulting QEMU_CXXFLAGS would
be exactly what configure already generates, just with these filtered
out:

  -fstack-protector-all -fstack-protector-strong

and these added:

  -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor

So fix the issue by re-using configure-generated QEMU_CXXFLAGS and
just handling these specific changes.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/vss-win32/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qga/vss-win32/Makefile.objs b/qga/vss-win32/Makefile.objs
index dad9d1b0ba..fd3ba1896b 100644
--- a/qga/vss-win32/Makefile.objs
+++ b/qga/vss-win32/Makefile.objs
@@ -3,7 +3,7 @@
 qga-vss-dll-obj-y += requester.o provider.o install.o
 
 obj-qga-vss-dll-obj-y = $(addprefix $(obj)/, $(qga-vss-dll-obj-y))
-$(obj-qga-vss-dll-obj-y): QEMU_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wredundant-decls -fstack-protector-all -fstack-protector-strong, $(QEMU_CFLAGS)) -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor
+$(obj-qga-vss-dll-obj-y): QEMU_CXXFLAGS := $(filter-out -fstack-protector-all -fstack-protector-strong, $(QEMU_CXXFLAGS)) -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor
 
 $(obj)/qga-vss.dll: LDFLAGS = -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup -lglib-2.0 -lole32 -loleaut32 -lshlwapi -luuid -lintl -lws2_32 -static
 $(obj)/qga-vss.dll: $(obj-qga-vss-dll-obj-y) $(SRC_PATH)/$(obj)/qga-vss.def
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] qga-win: include glib when building VSS DLL
  2019-02-12 21:29 ` [Qemu-devel] [PATCH 1/2] qga-win: include glib when building VSS DLL Michael Roth
@ 2019-02-13  9:12   ` Daniel P. Berrangé
  2019-02-13 13:17     ` Michael Roth
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel P. Berrangé @ 2019-02-13  9:12 UTC (permalink / raw)
  To: Michael Roth; +Cc: qemu-devel, qemu-stable

On Tue, Feb 12, 2019 at 03:29:16PM -0600, Michael Roth wrote:
> Commit 3ebee3b191e defined assert() as g_assert(), but when we build
> the VSS DLL component of QGA (to handle fsfreeze) we do not include
> glib, which results in breakage when building with VSS support enabled.
> 
> Fix this by including glib. Since the VSS DLL is built statically,
> this introduces an additional dependency on static glib and supporting
> libs for the mingw environment (possibly why we didn't include glib
> originally), but VSS support already has very specific prerequisites
> so it shouldn't affect too many build environments.
> 
> Since the VSS DLL code does use qemu/osdep.h, this should also help
> avoid future breakages and possibly allow for some clean ups in current
> VSS code.
> 
> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> Cc: Daniel P. Berrangé <berrange@redhat.com>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> ---
>  qga/vss-win32/Makefile.objs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qga/vss-win32/Makefile.objs b/qga/vss-win32/Makefile.objs
> index 23d08da225..dad9d1b0ba 100644
> --- a/qga/vss-win32/Makefile.objs
> +++ b/qga/vss-win32/Makefile.objs
> @@ -5,7 +5,7 @@ qga-vss-dll-obj-y += requester.o provider.o install.o
>  obj-qga-vss-dll-obj-y = $(addprefix $(obj)/, $(qga-vss-dll-obj-y))
>  $(obj-qga-vss-dll-obj-y): QEMU_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wredundant-decls -fstack-protector-all -fstack-protector-strong, $(QEMU_CFLAGS)) -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor
>  
> -$(obj)/qga-vss.dll: LDFLAGS = -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup -lole32 -loleaut32 -lshlwapi -luuid -static
> +$(obj)/qga-vss.dll: LDFLAGS = -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup -lglib-2.0 -lole32 -loleaut32 -lshlwapi -luuid -lintl -lws2_32 -static

Adding -lglib-2.0 makes sense, but your commit message doesn't explain
why -lintl or -lws2_32 are being added & they don't really make sense
to me.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] qga-win: fix VSS build breakage due to unintended gnu99 C++ flag
  2019-02-12 21:29 ` [Qemu-devel] [PATCH 2/2] qga-win: fix VSS build breakage due to unintended gnu99 C++ flag Michael Roth
@ 2019-02-13  9:13   ` Daniel P. Berrangé
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel P. Berrangé @ 2019-02-13  9:13 UTC (permalink / raw)
  To: Michael Roth; +Cc: qemu-devel

On Tue, Feb 12, 2019 at 03:29:17PM -0600, Michael Roth wrote:
> Commit 7be41675f7c set -std=gnu99 for C code via QEMU_CFLAGS. Currently
> we generate a "custom" QEMU_CXXFLAGS for VSS DLL C++ build by
> filtering out some options from QEMU_CFLAGS and adding some others.
> Since we don't filter out -std=gnu99 currently this breaks builds when
> VSS support is enabled.
> 
> We could keep the existing approach, filter out -std=gnu99 from
> QEMU_CFLAGS, and add -std=gnu++98, like configure currently does for
> QEMU_CXXFLAGS, but as it turns out our resulting QEMU_CXXFLAGS would
> be exactly what configure already generates, just with these filtered
> out:
> 
>   -fstack-protector-all -fstack-protector-strong
> 
> and these added:
> 
>   -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor
> 
> So fix the issue by re-using configure-generated QEMU_CXXFLAGS and
> just handling these specific changes.
> 
> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> ---
>  qga/vss-win32/Makefile.objs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] qga-win: include glib when building VSS DLL
  2019-02-13  9:12   ` Daniel P. Berrangé
@ 2019-02-13 13:17     ` Michael Roth
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Roth @ 2019-02-13 13:17 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: qemu-devel, qemu-stable

Quoting Daniel P. Berrangé (2019-02-13 03:12:06)
> On Tue, Feb 12, 2019 at 03:29:16PM -0600, Michael Roth wrote:
> > Commit 3ebee3b191e defined assert() as g_assert(), but when we build
> > the VSS DLL component of QGA (to handle fsfreeze) we do not include
> > glib, which results in breakage when building with VSS support enabled.
> > 
> > Fix this by including glib. Since the VSS DLL is built statically,
> > this introduces an additional dependency on static glib and supporting
> > libs for the mingw environment (possibly why we didn't include glib
> > originally), but VSS support already has very specific prerequisites
> > so it shouldn't affect too many build environments.
> > 
> > Since the VSS DLL code does use qemu/osdep.h, this should also help
> > avoid future breakages and possibly allow for some clean ups in current
> > VSS code.
> > 
> > Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> > Cc: Daniel P. Berrangé <berrange@redhat.com>
> > Cc: qemu-stable@nongnu.org
> > Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> > ---
> >  qga/vss-win32/Makefile.objs | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/qga/vss-win32/Makefile.objs b/qga/vss-win32/Makefile.objs
> > index 23d08da225..dad9d1b0ba 100644
> > --- a/qga/vss-win32/Makefile.objs
> > +++ b/qga/vss-win32/Makefile.objs
> > @@ -5,7 +5,7 @@ qga-vss-dll-obj-y += requester.o provider.o install.o
> >  obj-qga-vss-dll-obj-y = $(addprefix $(obj)/, $(qga-vss-dll-obj-y))
> >  $(obj-qga-vss-dll-obj-y): QEMU_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wredundant-decls -fstack-protector-all -fstack-protector-strong, $(QEMU_CFLAGS)) -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor
> >  
> > -$(obj)/qga-vss.dll: LDFLAGS = -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup -lole32 -loleaut32 -lshlwapi -luuid -static
> > +$(obj)/qga-vss.dll: LDFLAGS = -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup -lglib-2.0 -lole32 -loleaut32 -lshlwapi -luuid -lintl -lws2_32 -static
> 
> Adding -lglib-2.0 makes sense, but your commit message doesn't explain
> why -lintl or -lws2_32 are being added & they don't really make sense
> to me.

Those are dependencies introduced by glib for w32 socket APIs and 
gettext/internationalization. I was getting linker errors otherwise.

I'll add a note in the commit msg before applying (if there's no need for
a re-respin).

> 
> 
> Regards,
> Daniel
> -- 
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-02-13 13:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-12 21:29 [Qemu-devel] [PATCH 0/2] qga-win: fixes for builds with VSS/fsfreeze enabled Michael Roth
2019-02-12 21:29 ` [Qemu-devel] [PATCH 1/2] qga-win: include glib when building VSS DLL Michael Roth
2019-02-13  9:12   ` Daniel P. Berrangé
2019-02-13 13:17     ` Michael Roth
2019-02-12 21:29 ` [Qemu-devel] [PATCH 2/2] qga-win: fix VSS build breakage due to unintended gnu99 C++ flag Michael Roth
2019-02-13  9:13   ` Daniel P. Berrangé

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).