From 0e37b474981568f2790f75f5d1105bbb2509515c Mon Sep 17 00:00:00 2001 From: Zihao Yu Date: Wed, 28 Aug 2024 12:53:32 +0800 Subject: [PATCH] {x86,x86_64}-qemu: fix "array subscript 0 is outside array bounds" * see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523#c1 --- scripts/isa/x86.mk | 1 + scripts/isa/x86_64.mk | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/isa/x86.mk b/scripts/isa/x86.mk index d4e1b91..83af50a 100644 --- a/scripts/isa/x86.mk +++ b/scripts/isa/x86.mk @@ -1,5 +1,6 @@ export CROSS_COMPILE := x86_64-linux-gnu- CFLAGS += -m32 -fno-pic -fno-omit-frame-pointer -march=i386 CFLAGS += -fcf-protection=none # remove endbr32 in Ubuntu 20.04 with a CPU newer than Comet Lake +CFLAGS += --param=min-pagesize=0 # fix warning about "array subscript 0 is outside array bounds" ASFLAGS += -m32 -fno-pic LDFLAGS += -melf_i386 diff --git a/scripts/isa/x86_64.mk b/scripts/isa/x86_64.mk index 5241d71..f42ad03 100644 --- a/scripts/isa/x86_64.mk +++ b/scripts/isa/x86_64.mk @@ -1,4 +1,5 @@ export CROSS_COMPILE := x86_64-linux-gnu- CFLAGS += -m64 -fPIC -mno-sse +CFLAGS += --param=min-pagesize=0 # fix warning about "array subscript 0 is outside array bounds" ASFLAGS += -m64 -fPIC LDFLAGS += -melf_x86_64