Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

device-generic-common: Commit

device/generic/common


Commit MetaInfo

Revision13910420d3b57bfa8efd420632d57aedefd2221a (tree)
Time2022-04-27 04:41:53
AuthorMauro Rossi <issor.oruam@gmai...>
CommiterMauro Rossi

Log Message

build/tasks/kernel.mk: update parameters for building kernel with clang

These parameters improve the build process with prebuild clang 11.0.2
becasue they avoid llvm built-in asm related building errors
and work also for x86 32bit kernel targets

Change-Id: I1c806f67e2de3a7316c43e61032d2f5b8877e405

Change Summary

Incremental Difference

--- a/build/tasks/kernel.mk
+++ b/build/tasks/kernel.mk
@@ -25,10 +25,24 @@ TARGET_KERNEL_CONFIG ?= goldfish_defconfig
2525 KERNEL_CONFIG_DIR := arch/arm/configs
2626 endif
2727
28-KERNEL_CLANG_CLAGS := HOSTCC=$(abspath $(LLVM_PREBUILTS_PATH)/clang)
2928 ifeq ($(BUILD_KERNEL_WITH_CLANG),true)
30-CROSS_COMPILE := x86_64-linux-androidkernel-
31-KERNEL_CLANG_CLAGS += CC=$(abspath $(LLVM_PREBUILTS_PATH)/clang) CLANG_TRIPLE=x86_64-linux-gnu-
29+CROSS_COMPILE := $(abspath $(TARGET_TOOLS_PREFIX))
30+KERNEL_CLANG_FLAGS := \
31+ LLVM=1 \
32+ CC=$(abspath $(LLVM_PREBUILTS_PATH)/clang) \
33+ LD=$(abspath $(LLVM_PREBUILTS_PATH)/ld.lld) \
34+ AR=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-ar) \
35+ NM=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-nm) \
36+ OBJCOPY=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-objcopy) \
37+ OBJDUMP=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-objdump) \
38+ READELF=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-readelf) \
39+ OBJSIZE=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-size) \
40+ STRIP=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-strip) \
41+ HOSTCC=$(abspath $(LLVM_PREBUILTS_PATH)/clang) \
42+ HOSTCXX=$(abspath $(LLVM_PREBUILTS_PATH)/clang++) \
43+ HOSTLD=$(abspath $(LLVM_PREBUILTS_PATH)/ld.lld) \
44+ HOSTLDFLAGS=-fuse-ld=lld \
45+ HOSTAR=$(abspath $(LLVM_PREBUILTS_PATH)/llvm-ar)
3246 else
3347 ifeq ($(TARGET_KERNEL_ARCH),x86_64)
3448 ifeq ($(HOST_OS),darwin)
Show on old repository browser