From: Sami Tolvanen Date: Thu, 16 Nov 2017 23:56:44 +0000 (-0800) Subject: ANDROID: arm64: pass code model to LLVMgold X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=05fc028f049491ece8c53560b68622baf24433e0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ANDROID: arm64: pass code model to LLVMgold With LTO_CLANG, even if we pass -mcmodel to clang, the flag isn't stored in the generated LLVM IR, which means it won't be used for the actual compilation at link time. Therefore, the flag needs to be passed to LLVMgold to actually take effect. Bug: 62093296 Bug: 67506682 Change-Id: I5cd21f97c800466f1bce039df56101ce4087ae20 Signed-off-by: Sami Tolvanen --- diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 90a387a0d013..e64f5f0c5fd7 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -102,6 +102,10 @@ CHECKFLAGS += -D__aarch64__ -m64 ifeq ($(CONFIG_ARM64_MODULE_CMODEL_LARGE), y) KBUILD_CFLAGS_MODULE += -mcmodel=large +ifeq ($(CONFIG_LTO_CLANG), y) +# Code model is not stored in LLVM IR, so we need to pass it also to LLVMgold +LDFLAGS += -plugin-opt=-code-model=large +endif endif ifeq ($(CONFIG_ARM64_MODULE_PLTS),y)