Skip to contentSkip to conversation

fitering out -fstack-protector-strong

PATCH New Joseph Hindin 2 participants 3 messages Apr 1, 2015 – Apr 2, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 fitering out -fstack-protector-strong

The cross-compilation of VSS DLL from QEMU GA for Windows with MinGW fails because of disreparancy between compiler's and linker's stack protection options. The current qga/vss-win32/Makefile.objs filters out option '-fstack-protector-all' from compiler's option, but commit 63678e17c introduced changes in configure script, setting '-fstack-protector-strong' compiler option when available.

The '-fstack-protector-strong' option was not filtered out by the VSS DLL Makefile.objs file, resulting in linking error.

Paolo Bonzini in the message
http://lists.nongnu.org/archive/html/qemu-devel/2015-03/msg02719.html
from 12.03.2015 suggested to fix the problem in a way similar to existing.

The patch follows the advice and filters out both '-fstack-protector-strong' and '-fstack-protector-all' from compiler's options' list.

Joseph Hindin (1):
qga: fitering out -fstack-protector-strong

 qga/vss-win32/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.1.0
#1 lore raw

PATCH v2 1/1 qga: fitering out -fstack-protector-strong

configure script may add -fstack-protector-strong option instead of -fstack-protector-all, depending on availability ( see commit 63678e17c ). Both options have to by filtered out for qga-vss.dll, otherwise MinGW cross-compilation fails at linking stage.

---
 qga/vss-win32/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qga/vss-win32/Makefile.objs +1 -1
index 6a69d50..7c96c6b 100644
@@ -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, $(QEMU_CFLAGS)) -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor
+$(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: $(obj-qga-vss-dll-obj-y) $(SRC_PATH)/$(obj)/qga-vss.def
Signature · 1 line
2.1.0
#2 lore raw

Re: [Qemu-devel] [PATCH v2] qga: fitering out -fstack-protector-strong

Quoted 7 lines · Joseph Hindin

configure script may add -fstack-protector-strong option instead of -fstack-protector-all, depending on availability ( see commit 63678e17c ). Both options have to by filtered out for qga-vss.dll, otherwise MinGW cross-compilation fails at linking stage.

Thanks, applied. For 2.4 it would be interesting to see if we can actually enable the stack protector.

Paolo

Quoted 18 lines
---
 qga/vss-win32/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qga/vss-win32/Makefile.objs +1 -1
index 6a69d50..7c96c6b 100644
@@ -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, $(QEMU_CFLAGS)) -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor
+$(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: $(obj-qga-vss-dll-obj-y) $(SRC_PATH)/$(obj)/qga-vss.def