Received: from eggs.gnu.org ([2001:4830:134:3::10]:39703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4RYy-0002aT-0c for qemu-devel@nongnu.org; Mon, 15 Jun 2015 06:24:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4RYx-0000WP-4q for qemu-devel@nongnu.org; Mon, 15 Jun 2015 06:24:19 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:101::1]:46013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4RYw-0000Vy-Un for qemu-devel@nongnu.org; Mon, 15 Jun 2015 06:24:19 -0400 From: Aurelien Jarno Date: Mon, 15 Jun 2015 12:24:03 +0200 Message-Id: <1434363843-14576-1-git-send-email-aurelien@aurel32.net> Subject: [Qemu-devel] [PATCH] s390/bios: build with -fdelete-null-pointer-checks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Cornelia Huck , Christian Borntraeger , Alexander Graf , Aurelien Jarno Starting with version 4.9, GCC assumes it can't safely dereference null pointers, and uses this for some optimizations. On s390, the lowcore memory is located at address 0, so this assumption is wrong and breaks the s390-ccw firmware. Pass -fdelete-null-pointer-checks to avoid that. Cc: Cornelia Huck Cc: Christian Borntraeger Cc: Alexander Graf Signed-off-by: Aurelien Jarno --- pc-bios/s390-ccw/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile index 009bb8d..746603a 100644 --- a/pc-bios/s390-ccw/Makefile +++ b/pc-bios/s390-ccw/Makefile @@ -10,7 +10,7 @@ $(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 -CFLAGS += -fPIE -fno-stack-protector -ffreestanding +CFLAGS += -fPIE -fno-stack-protector -ffreestanding -fno-delete-null-pointer-checks LDFLAGS += -Wl,-pie -nostdlib build-all: s390-ccw.img -- 2.1.4