From 072d3935c2497638e9c2502f574c133caeba9d3d Mon Sep 17 00:00:00 2001 From: Mark Barnett Date: Tue, 27 Oct 2020 19:55:41 +0000 Subject: [PATCH] makefile-engine: Fix driver compilation on x86_64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove unnecessary -fno-pic and make sure x64 linker output doesn't put too much space between program header sections. By default, the GNU linker will align program headers to page boundaries. In Haiku's x86_64 builds this is 2MB, which the kernel considers to be too much wasted space. Fixes #15702 Change-Id: I2adce69b3de74340b05f7c0e8cda44d1b25b69fa Reviewed-on: https://review.haiku-os.org/c/haiku/+/3361 Reviewed-by: Jérôme Duval --- data/develop/makefile-engine | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/develop/makefile-engine b/data/develop/makefile-engine index 9fbffc90c1..7ca3e7bf7e 100644 --- a/data/develop/makefile-engine +++ b/data/develop/makefile-engine @@ -40,7 +40,7 @@ C++ := $(CXX) # Set up CFLAGS. ifeq ($(strip $(TYPE)), DRIVER) - CFLAGS += -D_KERNEL_MODE=1 -fno-pic + CFLAGS += -D_KERNEL_MODE=1 else CFLAGS += endif @@ -93,6 +93,9 @@ else ifeq ($(strip $(TYPE)), DRIVER) LDFLAGS += -nostdlib /boot/system/develop/lib/_KERNEL_ \ /boot/system/develop/lib/haiku_version_glue.o +ifeq ($(CPU), x86_64) + LDFLAGS += -z max-page-size=0x1000 +endif endif endif endif