bliss: Use $(HOST_PREBUILT_TAG) where possible
Change-Id: If211d23ce72b3404368cd723cbb9ea801e61802c
diff --git a/build/tasks/blissify.mk b/build/tasks/blissify.mk
index f4053b6..311b51e 100644
--- a/build/tasks/blissify.mk
+++ b/build/tasks/blissify.mk
@@ -15,7 +15,7 @@
# Bliss Target Zip
BLISS_TARGET_PACKAGE := $(PRODUCT_OUT)/$(BLISS_BUILD_ZIP).zip
-SHA256 := prebuilts/build-tools/path/$(HOST_OS)-x86/sha256sum
+SHA256 := prebuilts/build-tools/path/$(HOST_PREBUILT_TAG)/sha256sum
.PHONY: blissify
blissify: $(INTERNAL_OTA_PACKAGE_TARGET)
diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk
index 35a6976..29e0a41 100644
--- a/build/tasks/kernel.mk
+++ b/build/tasks/kernel.mk
@@ -237,7 +237,7 @@
# Use the default version of clang if TARGET_KERNEL_CLANG_VERSION hasn't been set by the device config
KERNEL_CLANG_VERSION := $(LLVM_PREBUILTS_VERSION)
endif
- TARGET_KERNEL_CLANG_PATH ?= $(BUILD_TOP)/prebuilts/clang/host/$(HOST_OS)-x86/$(KERNEL_CLANG_VERSION)
+ TARGET_KERNEL_CLANG_PATH ?= $(BUILD_TOP)/prebuilts/clang/host/$(HOST_PREBUILT_TAG)/$(KERNEL_CLANG_VERSION)
ifeq ($(KERNEL_ARCH),arm64)
KERNEL_CLANG_TRIPLE ?= CLANG_TRIPLE=aarch64-linux-gnu-
else ifeq ($(KERNEL_ARCH),arm)
diff --git a/config/BoardConfigKernel.mk b/config/BoardConfigKernel.mk
index 0ffb5e8..e913330 100644
--- a/config/BoardConfigKernel.mk
+++ b/config/BoardConfigKernel.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2018-2019 The LineageOS Project
+# Copyright (C) 2018-2020 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -51,7 +51,7 @@
endif
CLANG_PREBUILTS := $(BUILD_TOP)/prebuilts/clang/host/$(HOST_OS)-x86/clang-r416183b1
-GCC_PREBUILTS := $(BUILD_TOP)/prebuilts/gcc/$(HOST_OS)-x86
+GCC_PREBUILTS := $(BUILD_TOP)/prebuilts/gcc/$(HOST_PREBUILT_TAG)
ifeq ($(TARGET_KERNEL_NEW_GCC_COMPILE),true)
ifeq ($(TARGET_KERNEL_CLANG_COMPILE),true)
$(error TARGET_KERNEL_NEW_GCC_COMPILE cannot be used with TARGET_KERNEL_CLANG_COMPILE!)
@@ -117,7 +117,7 @@
KERNEL_MAKE_FLAGS :=
# Add back threads, ninja cuts this to $(nproc)/2
-KERNEL_MAKE_FLAGS += -j$(shell $(prebuilt_build_tools_lineage_bin)/nproc --all)
+KERNEL_MAKE_FLAGS += -j$(shell nproc --all)
ifeq ($(KERNEL_ARCH),arm)
# Avoid "Unknown symbol _GLOBAL_OFFSET_TABLE_" errors
@@ -130,9 +130,9 @@
endif
ifeq ($(HOST_OS),darwin)
- KERNEL_MAKE_FLAGS += HOSTCFLAGS="-I$(BUILD_TOP)/external/elfutils/libelf -I/usr/local/opt/openssl/include -fuse-ld=lld" HOSTLDFLAGS="-L/usr/local/opt/openssl/lib -fuse-ld=lld"
+ KERNEL_MAKE_FLAGS += HOSTCFLAGS="-I$(BUILD_TOP)/external/elfutils/libelf -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib"
else
- KERNEL_MAKE_FLAGS += CPATH="/usr/include:/usr/include/x86_64-linux-gnu" HOSTCFLAGS="-fuse-ld=lld" HOSTLDFLAGS="-L/usr/lib/x86_64-linux-gnu -L/usr/lib64 -fuse-ld=lld"
+ KERNEL_MAKE_FLAGS += CPATH="/usr/include:/usr/include/x86_64-linux-gnu" HOSTCFLAGS="-L/usr/lib/x86_64-linux-gnu -L/usr/lib64"
endif
ifneq ($(TARGET_KERNEL_ADDITIONAL_FLAGS),)
@@ -140,9 +140,9 @@
endif
TOOLS_PATH_OVERRIDE := \
- PATH=$(BUILD_TOP)/$(prebuilt_build_tools_lineage_bin):$$PATH \
- LD_LIBRARY_PATH=$(BUILD_TOP)/$(prebuilt_build_tools_lineage)/$(HOST_PREBUILT_TAG)/lib:$$LD_LIBRARY_PATH \
- PERL5LIB=$(BUILD_TOP)/$(prebuilt_build_tools_lineage)/common/perl-base
+ PATH=$(BUILD_TOP)/prebuilts/tools-lineage/$(HOST_PREBUILT_TAG)/bin:$$PATH \
+ LD_LIBRARY_PATH=$(BUILD_TOP)/prebuilts/tools-lineage/$(HOST_PREBUILT_TAG)/lib:$$LD_LIBRARY_PATH \
+ PERL5LIB=$(BUILD_TOP)/prebuilts/tools-lineage/common/perl-base
# Set DTBO image locations so the build system knows to build them
ifeq (true,$(filter true, $(TARGET_NEEDS_DTBOIMAGE) $(BOARD_KERNEL_SEPARATED_DTBO)))
@@ -150,15 +150,20 @@
endif
# Set use the full path to the make command
-KERNEL_MAKE_CMD := $(BUILD_TOP)/prebuilts/build-tools/$(HOST_OS)-x86/bin/make
+KERNEL_MAKE_CMD := $(BUILD_TOP)/prebuilts/build-tools/$(HOST_PREBUILT_TAG)/bin/make
-# Set the full path to the clang command
-KERNEL_MAKE_FLAGS += HOSTCC=$(CLANG_PREBUILTS)/bin/clang
-KERNEL_MAKE_FLAGS += HOSTCXX=$(CLANG_PREBUILTS)/bin/clang++
+# Set the full path to the gcc command
+ifeq ($(HOST_OS),darwin)
+KERNEL_HOST_TOOLCHAIN_ROOT := $(GCC_PREBUILTS)/host/i686-apple-darwin-4.2.1/bin/i686-apple-darwin11-
+else
+KERNEL_HOST_TOOLCHAIN_ROOT := $(GCC_PREBUILTS)/host/x86_64-linux-glibc2.17-4.8/bin/x86_64-linux-
+endif
+KERNEL_MAKE_FLAGS += HOSTCC=$(KERNEL_HOST_TOOLCHAIN_ROOT)gcc
+KERNEL_MAKE_FLAGS += HOSTCXX=$(KERNEL_HOST_TOOLCHAIN_ROOT)g++
# Since Linux 4.16, flex and bison are required
-KERNEL_MAKE_FLAGS += LEX=$(BUILD_TOP)/prebuilts/build-tools/$(HOST_OS)-x86/bin/flex
-KERNEL_MAKE_FLAGS += YACC=$(BUILD_TOP)/prebuilts/build-tools/$(HOST_OS)-x86/bin/bison
+KERNEL_MAKE_FLAGS += LEX=$(BUILD_TOP)/prebuilts/build-tools/$(HOST_PREBUILT_TAG)/bin/flex
+KERNEL_MAKE_FLAGS += YACC=$(BUILD_TOP)/prebuilts/build-tools/$(HOST_PREBUILT_TAG)/bin/bison
KERNEL_MAKE_FLAGS += M4=$(BUILD_TOP)/prebuilts/build-tools/$(HOST_OS)-x86/bin/m4
TOOLS_PATH_OVERRIDE += BISON_PKGDATADIR=$(BUILD_TOP)/prebuilts/build-tools/common/bison