From patchwork Sun Aug 30 22:48:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 32601 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id E1E85B7B6C for ; Mon, 31 Aug 2009 08:51:53 +1000 (EST) Received: from localhost ([127.0.0.1]:59798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MhtFW-0003pl-5H for incoming@patchwork.ozlabs.org; Sun, 30 Aug 2009 18:51:50 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MhtF2-0003pZ-NF for qemu-devel@nongnu.org; Sun, 30 Aug 2009 18:51:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MhtEy-0003no-9M for qemu-devel@nongnu.org; Sun, 30 Aug 2009 18:51:20 -0400 Received: from [199.232.76.173] (port=57173 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MhtEy-0003nl-4P for qemu-devel@nongnu.org; Sun, 30 Aug 2009 18:51:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18970) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MhtEx-0008Bk-Jn for qemu-devel@nongnu.org; Sun, 30 Aug 2009 18:51:15 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7UMpE0V013078; Sun, 30 Aug 2009 18:51:14 -0400 Received: from localhost.localdomain (vpn1-4-209.ams2.redhat.com [10.36.4.209]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7UMpCVu014552; Sun, 30 Aug 2009 18:51:13 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 31 Aug 2009 00:48:45 +0200 Message-Id: <524d68ff85692c828b714ecf4dfdca248bb52f38.1251672463.git.quintela@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PATCH 1/2] Remove CFLAGS parameter in cc-option X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org With cc-option we are testing if gcc just accept a particular option, we don't need CFLAGS at all. And this fixes the recursive problem with CFLAGS Signed-off-by: Juan Quintela --- pc-bios/optionrom/Makefile | 2 +- rules.mak | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index 0fbd3ab..097bcf4 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -9,7 +9,7 @@ VPATH=$(SRC_PATH)/pc-bios/optionrom CFLAGS = -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin CFLAGS += -I$(SRC_PATH) -CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector,"") +CFLAGS += $(call cc-option, -fno-stack-protector,"") build-all: multiboot.bin diff --git a/rules.mak b/rules.mak index c0315ac..3fdbfd3 100644 --- a/rules.mak +++ b/rules.mak @@ -19,7 +19,7 @@ LINK = $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $(1) $(ARLIBS_BEGIN) $(ARLIBS quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1)) # cc-option -# Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0) +# Usage: CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0) -cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \ - > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;) +cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ + > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)