diff mbox series

[06/20] arm64: ensure the kernel is compiled for LP64

Message ID 20170604120009.342-7-ynorov@caviumnetworks.com
State Superseded
Headers show
Series [01/20] compat ABI: use non-compat openat and open_by_handle_at variants | expand

Commit Message

Yury Norov June 4, 2017, 11:59 a.m. UTC
From: Andrew Pinski <apinski@cavium.com>


The kernel needs to be compiled as a LP64 binary for ARM64, even when
using a compiler that defaults to code-generation for the ILP32 ABI.
Consequently, we need to explicitly pass '-mabi=lp64' (supported on
gcc-4.9 and newer).

Signed-off-by: Andrew Pinski <Andrew.Pinski@caviumnetworks.com>

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>

Reviewed-by: David Daney <ddaney@caviumnetworks.com>

---
 arch/arm64/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

-- 
2.11.0
diff mbox series

Patch

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index f839ecd919f9..5ddfb3140f7a 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -50,15 +50,20 @@  KBUILD_CFLAGS	+= -fno-asynchronous-unwind-tables
 KBUILD_CFLAGS	+= $(call cc-option, -mpc-relative-literal-loads)
 KBUILD_AFLAGS	+= $(lseinstr) $(brokengasinst)
 
+KBUILD_CFLAGS	+= $(call cc-option,-mabi=lp64)
+KBUILD_AFLAGS	+= $(call cc-option,-mabi=lp64)
+
 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
 KBUILD_CPPFLAGS	+= -mbig-endian
 AS		+= -EB
 LD		+= -EB
+LDFLAGS		+= -maarch64linuxb
 UTS_MACHINE	:= aarch64_be
 else
 KBUILD_CPPFLAGS	+= -mlittle-endian
 AS		+= -EL
 LD		+= -EL
+LDFLAGS		+= -maarch64linux
 UTS_MACHINE	:= aarch64
 endif