From 5823e640f008729a4018e414d7c996e71969ac94 Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Mon, 1 Oct 2018 16:21:22 -0700 Subject: [PATCH] ANDROID: arm64: kbuild: only specify code model with LTO for modules This fixes CONFIG_LTO_CLANG for LLVM >= r334571 where LLVMgold actually started respecting the code model flag. Bug: 116819139 Bug: 119418330 Test: builds with LLVM r334571, boots on a device, all modules load Change-Id: I1af9d24ed1b789a40ac1e85bd00e176ff8a68aa5 Signed-off-by: Sami Tolvanen Signed-off-by: Miguel de Dios --- arch/arm64/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index b54572206413..b0f0f607c479 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -104,7 +104,7 @@ 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 +KBUILD_LDFLAGS_MODULE += -plugin-opt=-code-model=large endif endif -- 2.20.1