qga-win: fixes for builds with VSS/fsfreeze enabled
cover qga-win: fixes for builds with VSS/fsfreeze enabled
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(-)
PATCH 1/2 qga-win: include glib when building VSS DLL
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.
--- qga/vss-win32/Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
qga/vss-win32/Makefile.objs +1 -1
@@ -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)$@")
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH 1/2] qga-win: include glib when building VSS DLL
Quoted 27 lines · Michael Roth
Commit
3ebee3b191edefinedassert()asg_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é <[email protected]>Cc Daniel P. Berrangé <[email protected]>Signed-off-by Michael Roth <[email protected]>--- qga/vss-win32/Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)qga/vss-win32/Makefile.objs +0
-0
qga/vss-win32/Makefile.objs qga-vss-dll-obj-y += requester.o provider.o install.o · line 8
Quoted 5 lines
qga/vss-win32/Makefile.objs +1
-1@@ -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
Signature · 3 lines
|: 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 :|
Re: [Qemu-devel] [PATCH 1/2] qga-win: include glib when building VSS DLL
Quoting Daniel P. Berrangé (2019-02-13 03:12:06)
Quoted 31 lines · Michael Roth
Quoted 30 lines
Commit
3ebee3b191edefinedassert()asg_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é <[email protected]>Cc Daniel P. Berrangé <[email protected]>Signed-off-by Michael Roth <[email protected]>--- qga/vss-win32/Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)qga/vss-win32/Makefile.objs +0
-0@@ -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
Quoted 6 lines
qga/vss-win32/Makefile.objs qga-vss-dll-obj-y += requester.o provider.o install.o · line 8
Quoted 2 lines
qga/vss-win32/Makefile.objs +1
-1-$(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 -staticAdding -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).
Quoted 9 lines
Regards,
DanielSignature · 3 lines
|: 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 :|
PATCH 2/2 qga-win: fix VSS build breakage due to unintended gnu99 C++ flag
In reply to Michael RothCommit 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.
--- qga/vss-win32/Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
qga/vss-win32/Makefile.objs +1 -1
@@ -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
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH 2/2] qga-win: fix VSS build breakage due to unintended gnu99 C++ flag
Quoted 18 lines · Michael Roth
Commit
7be41675f7cset -std=gnu99 for C code viaQEMU_CFLAGS. Currently we generate a "custom"QEMU_CXXFLAGSfor VSS DLL C++ build by filtering out some options fromQEMU_CFLAGSand 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 forQEMU_CXXFLAGS, but as it turns out our resultingQEMU_CXXFLAGSwould 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
Quoted 7 lines
So fix the issue by re-using configure-generated
QEMU_CXXFLAGSand just handling these specific changes.Signed-off-by Michael Roth <[email protected]>--- qga/vss-win32/Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Regards,
Daniel
Signature · 3 lines
|: 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 :|