build: kernel: build arm kernel modules with -fno-pic

With androidkernel (androideabi) toolchains, -fpic is enabled by default.
At least on my 3.4 arm kernel, this causes an issue with kernel modules:
"Unknown symbol _GLOBAL_OFFSET_TABLE_".

On traditional armeabi toolchains, -fpic is not enabled, resulting in working
kernel modules; let's follow that here.

Change-Id: I3058b5213b34bdde9bb9d744563c7d55cd42d2a5
gugelfrei
Ziyan 8 years ago committed by Ethan Chen
parent 20c06fd75e
commit 54648c2a3b

@ -116,6 +116,11 @@ TARGET_PREBUILT_INT_KERNEL := $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/$(TARGET_PR
# Clear this first to prevent accidental poisoning from env
MAKE_FLAGS :=
ifeq ($(KERNEL_ARCH),arm)
# Avoid "Unknown symbol _GLOBAL_OFFSET_TABLE_" errors
MAKE_FLAGS += CFLAGS_MODULE="-fno-pic"
endif
ifeq ($(KERNEL_ARCH),arm64)
# Avoid "unsupported RELA relocation: 311" errors (R_AARCH64_ADR_GOT_PAGE)
MAKE_FLAGS += CFLAGS_MODULE="-fno-pic"

Loading…
Cancel
Save