Received: from eggs.gnu.org ([2001:4830:134:3::10]:49180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZFaD-0002GD-MN for qemu-devel@nongnu.org; Mon, 15 Aug 2016 06:57:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZFa8-0007rO-OA for qemu-devel@nongnu.org; Mon, 15 Aug 2016 06:57:29 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZFa8-0007rK-F4 for qemu-devel@nongnu.org; Mon, 15 Aug 2016 06:57:24 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7FArbbR071261 for ; Mon, 15 Aug 2016 06:57:23 -0400 Received: from e06smtp09.uk.ibm.com (e06smtp09.uk.ibm.com [195.75.94.105]) by mx0a-001b2d01.pphosted.com with ESMTP id 24symnk9g8-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 15 Aug 2016 06:57:23 -0400 Received: from localhost by e06smtp09.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 15 Aug 2016 11:57:21 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id ECA692190046 for ; Mon, 15 Aug 2016 11:56:41 +0100 (BST) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u7FAvH8m23068860 for ; Mon, 15 Aug 2016 10:57:17 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u7FAvGrf030977 for ; Mon, 15 Aug 2016 04:57:17 -0600 Date: Mon, 15 Aug 2016 12:57:15 +0200 From: Cornelia Huck In-Reply-To: <1471256891-203570-2-git-send-email-borntraeger@de.ibm.com> References: <1471256891-203570-1-git-send-email-borntraeger@de.ibm.com> <1471256891-203570-2-git-send-email-borntraeger@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20160815125715.333dcd38.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH 1/1] pc-bios/s390-ccw.img: Fix build List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger Cc: pbonzini@redhat.com, marcandre.lureau@redhat.com, qemu-devel@nongnu.org, peter.maydell@linaro.org On Mon, 15 Aug 2016 12:28:11 +0200 Christian Borntraeger wrote: > Since > commit a9c87304b76d ("build-sys: fix building with make CFLAGS=.. argument") > > pc-bios/s390-ccw.img build might fail with > > --- snip --- > main.o: In function `virtio_setup': > qemu/pc-bios/s390-ccw/main.c:117: undefined reference to `__stack_chk_fail' > --- snip --- > > Changing the CFLAGS to QEMU_CFLAGS does the trick. > > We also need to fix a potential aliasing bug as we now compile with > -O2 instead of -O0. This was the warning message: > > --- snip --- > /home/cborntra/REPOS/qemu/pc-bios/s390-ccw/virtio.c:64:5: error: > dereferencing type-punned pointer will break strict-aliasing rules > [-Werror=strict-aliasing] Can we preserve no strict aliasing somehow? I don't really want to change the bios code at that point if not needed. > return kvm_hypercall(KVM_S390_VIRTIO_CCW_NOTIFY, *(u32 *)&schid, > --- snip --- > > Signed-off-by: Christian Borntraeger > --- > pc-bios/s390-ccw/Makefile | 6 ++++-- > pc-bios/s390-ccw/virtio.c | 7 ++++++- > 2 files changed, 10 insertions(+), 3 deletions(-) > > diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile > index 4208cb4..a9dcca4 100644 > --- a/pc-bios/s390-ccw/Makefile > +++ b/pc-bios/s390-ccw/Makefile > @@ -10,8 +10,10 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/s390-ccw) > .PHONY : all clean build-all > > OBJECTS = start.o main.o bootmap.o sclp-ascii.o virtio.o virtio-scsi.o > -CFLAGS += -fPIE -fno-stack-protector -ffreestanding -march=z900 > -CFLAGS += -fno-delete-null-pointer-checks -msoft-float > +QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS)) > +QEMU_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -msoft-float > +QEMU_CFLAGS += -march=z900 -fPIE > +QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -fno-stack-protector) > LDFLAGS += -Wl,-pie -nostdlib Does not look unreasonable, but as I've lost myself in the makefile dependencies before, I'd like another review.