]> Git Repo - linux.git/commitdiff
arm64: ensure the kernel is compiled for LP64
authorAndrew Pinski <[email protected]>
Mon, 18 Sep 2017 10:20:20 +0000 (11:20 +0100)
committerCatalin Marinas <[email protected]>
Mon, 18 Sep 2017 10:20:20 +0000 (11:20 +0100)
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 <[email protected]>
Signed-off-by: Philipp Tomsich <[email protected]>
Signed-off-by: Christoph Muellner <[email protected]>
Signed-off-by: Yury Norov <[email protected]>
Reviewed-by: David Daney <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
arch/arm64/Makefile

index 9b41f1e3b1a039cd45fe842e10abff0181186fdf..939b310913cf38cd7ca3136128fb5440340d7d12 100644 (file)
@@ -50,17 +50,22 @@ 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
 CHECKFLAGS     += -D__AARCH64EB__
 AS             += -EB
 LD             += -EB
+LDFLAGS                += -maarch64linuxb
 UTS_MACHINE    := aarch64_be
 else
 KBUILD_CPPFLAGS        += -mlittle-endian
 CHECKFLAGS     += -D__AARCH64EL__
 AS             += -EL
 LD             += -EL
+LDFLAGS                += -maarch64linux
 UTS_MACHINE    := aarch64
 endif
 
This page took 0.053144 seconds and 4 git commands to generate.