makefile-engine: Fix driver compilation on x86_64

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 <[email protected]>
This commit is contained in:
Mark Barnett
2020-10-30 07:41:17 +00:00
committed by Jérôme Duval
parent ebb21bd148
commit 072d3935c2
+4 -1
View File
@@ -40,7 +40,7 @@ C++ := $(CXX)
# Set up CFLAGS. # Set up CFLAGS.
ifeq ($(strip $(TYPE)), DRIVER) ifeq ($(strip $(TYPE)), DRIVER)
CFLAGS += -D_KERNEL_MODE=1 -fno-pic CFLAGS += -D_KERNEL_MODE=1
else else
CFLAGS += CFLAGS +=
endif endif
@@ -93,6 +93,9 @@ else
ifeq ($(strip $(TYPE)), DRIVER) ifeq ($(strip $(TYPE)), DRIVER)
LDFLAGS += -nostdlib /boot/system/develop/lib/_KERNEL_ \ LDFLAGS += -nostdlib /boot/system/develop/lib/_KERNEL_ \
/boot/system/develop/lib/haiku_version_glue.o /boot/system/develop/lib/haiku_version_glue.o
ifeq ($(CPU), x86_64)
LDFLAGS += -z max-page-size=0x1000
endif
endif endif
endif endif
endif endif