From d807db71bc55da4b07c0a414c6df10e009b4006b Mon Sep 17 00:00:00 2001 From: Alexander Koskovich Date: Wed, 15 Jun 2022 23:58:31 -0700 Subject: [PATCH] lineage: config: Don't pass CFLAGS_MODULE="-fno-pic" if using LLVM * Seemingly not an issue for kernels compiled with LLVM, tested with kernel versions 4.4 -> 5.4. Change-Id: I00adee2e10e99a540099b5e1a6a1ab9be0b99050 --- config/BoardConfigKernel.mk | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/config/BoardConfigKernel.mk b/config/BoardConfigKernel.mk index 9fb56683..29c6ec65 100644 --- a/config/BoardConfigKernel.mk +++ b/config/BoardConfigKernel.mk @@ -111,14 +111,16 @@ KERNEL_MAKE_FLAGS := # Add back threads, ninja cuts this to $(nproc)/2 KERNEL_MAKE_FLAGS += -j$(shell prebuilts/tools-lineage/$(HOST_PREBUILT_TAG)/bin/nproc --all) -ifeq ($(KERNEL_ARCH),arm) - # Avoid "Unknown symbol _GLOBAL_OFFSET_TABLE_" errors - KERNEL_MAKE_FLAGS += CFLAGS_MODULE="-fno-pic" -endif +ifeq ($(TARGET_KERNEL_CLANG_COMPILE),false) + ifeq ($(KERNEL_ARCH),arm) + # Avoid "Unknown symbol _GLOBAL_OFFSET_TABLE_" errors + KERNEL_MAKE_FLAGS += CFLAGS_MODULE="-fno-pic" + endif -ifeq ($(KERNEL_ARCH),arm64) - # Avoid "unsupported RELA relocation: 311" errors (R_AARCH64_ADR_GOT_PAGE) - KERNEL_MAKE_FLAGS += CFLAGS_MODULE="-fno-pic" + ifeq ($(KERNEL_ARCH),arm64) + # Avoid "unsupported RELA relocation: 311" errors (R_AARCH64_ADR_GOT_PAGE) + KERNEL_MAKE_FLAGS += CFLAGS_MODULE="-fno-pic" + endif endif ifeq ($(HOST_OS),darwin)