Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: ensure the kernel is compiled for LP64

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>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Andrew Pinski and committed by
Catalin Marinas
3d6a7b99 c73cc120

+5
+5
arch/arm64/Makefile
··· 50 50 KBUILD_CFLAGS += $(call cc-option, -mpc-relative-literal-loads) 51 51 KBUILD_AFLAGS += $(lseinstr) $(brokengasinst) 52 52 53 + KBUILD_CFLAGS += $(call cc-option,-mabi=lp64) 54 + KBUILD_AFLAGS += $(call cc-option,-mabi=lp64) 55 + 53 56 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y) 54 57 KBUILD_CPPFLAGS += -mbig-endian 55 58 CHECKFLAGS += -D__AARCH64EB__ 56 59 AS += -EB 57 60 LD += -EB 61 + LDFLAGS += -maarch64linuxb 58 62 UTS_MACHINE := aarch64_be 59 63 else 60 64 KBUILD_CPPFLAGS += -mlittle-endian 61 65 CHECKFLAGS += -D__AARCH64EL__ 62 66 AS += -EL 63 67 LD += -EL 68 + LDFLAGS += -maarch64linux 64 69 UTS_MACHINE := aarch64 65 70 endif 66 71