Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HEE54-0008Dy-Qb for qemu-devel@nongnu.org; Mon, 05 Feb 2007 19:21:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HEE53-0008Dj-Gi for qemu-devel@nongnu.org; Mon, 05 Feb 2007 19:21:06 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HEE53-0008De-2C for qemu-devel@nongnu.org; Mon, 05 Feb 2007 19:21:05 -0500 Received: from mail.cs.utexas.edu ([128.83.139.10]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HEE52-0006w1-Np for qemu-devel@nongnu.org; Mon, 05 Feb 2007 19:21:04 -0500 Message-ID: <45C7C9E2.7030205@cs.utexas.edu> Date: Mon, 05 Feb 2007 18:20:50 -0600 From: Anthony Liguori MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030905090009030903020004" Subject: [Qemu-devel] [PATCH][KQEMU] Disable SSP in monitor Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabrice Bellard Cc: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------030905090009030903020004 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------030905090009030903020004 Content-Type: text/x-patch; name="kqemu-stack-protector.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kqemu-stack-protector.diff" --- 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 --------------030905090009030903020004--