qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH][KQEMU] Disable SSP in monitor


From: Anthony Liguori
Subject: [Qemu-devel] [PATCH][KQEMU] Disable SSP in monitor
Date: Mon, 05 Feb 2007 18:20:50 -0600
User-agent: Thunderbird 1.5.0.9 (X11/20070103)

Disable GCC's stack protector. Works with older GCC's by using Linux's cc-option function.

Thanks again for GPL'ing KQEMU :-)

Regards,

Anthony Liguori
--- a/common/Makefile   2007-02-05 16:57:37.000000000 -0600
+++ b/common/Makefile   2007-02-05 18:16:41.000000000 -0600
@@ -21,6 +21,12 @@
 #ARCH=i386
 #ARCH=x86_64
 
+# From the Linux kernel
+# cc-option
+# Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
+cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \
+              /dev/null 2>&1`"; then echo "$(2)"; else echo "$(3)"; fi ;)
+
 HOST_CC=gcc
 MON_CC=gcc
 MON_LD=ld
@@ -44,6 +50,11 @@
 CFLAGS=$(COMMON_CFLAGS)
 MON_CFLAGS=$(COMMON_CFLAGS)
 KERNEL_CFLAGS=$(COMMON_CFLAGS)
+
+# Disable SSP if GCC supports it.
+MON_CFLAGS+=$(call cc-option,$(CC),-fno-stack-protector,)
+MON_CFLAGS+=$(call cc-option,$(CC),-fno-stack-protector-all,)
+
 ifeq ($(ARCH), x86_64)
 KERNEL_CFLAGS+=-mcmodel=kernel
 MON_CFLAGS+= -fpic # needed for correct computed goto relocations

reply via email to

[Prev in Thread] Current Thread [Next in Thread]