Skip to contentSkip to conversation

s390/bios: build with -fdelete-null-pointer-checks

PATCH In review Aurelien Jarno 2 participants 2 messages Jun 15, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390/bios: build with -fdelete-null-pointer-checks

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 <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc Alexander Graf <[email protected]>
---
 pc-bios/s390-ccw/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
pc-bios/s390-ccw/Makefile +1 -1
index 009bb8d..746603a 100644
@@ -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
Signature · 1 line
2.1.4
#1 lore raw

Am 15.06.2015 um 12:24 schrieb Aurelien Jarno:

Quoted 19 lines

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 <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc Alexander Graf <[email protected]>
---
 pc-bios/s390-ccw/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
pc-bios/s390-ccw/Makefile +0 -0
index 009bb8d..746603a 100644

pc-bios/s390-ccw/Makefile $(call set-vpath, $(SRC_PATH)/pc-bios/s390-ccw) · line 16

Quoted 8 lines
pc-bios/s390-ccw/Makefile +1 -1
@@ -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

applied thanks.