Skip to content

Commit

Permalink
kernel: Use pahole from Google prebuilts
Browse files Browse the repository at this point in the history
This fixes the following warnings:

  13:04:54 Disallowed PATH tool "pahole" used: []string{"pahole", "--version"}
  13:04:54 See https://android.googlesource.com/platform/build/+/master/Changes.md#PATH_Tools for more information.
  "pahole" is not allowed to be used. See https://android.googlesource.com/platform/build/+/master/Changes.md#PATH_Tools for more information.
  /home/bgcngm/android/lineage/kernel/oneplus/sm8550/scripts/pahole-flags.sh: 12: [: Illegal number:
  /home/bgcngm/android/lineage/kernel/oneplus/sm8550/scripts/pahole-flags.sh: 16: [: Illegal number:
  /home/bgcngm/android/lineage/kernel/oneplus/sm8550/scripts/pahole-flags.sh: 20: [: Illegal number:

Change-Id: Ice2a3753301a7b7782037fd35544e2831b258650
  • Loading branch information
bgcngm authored and basamaryan committed Sep 20, 2023
1 parent 9e680e0 commit 7a816e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions build/tasks/kernel.mk
Expand Up @@ -86,7 +86,6 @@ TARGET_MERGE_DTBS_WILDCARD ?= *

## Internal variables
DTC := $(HOST_OUT_EXECUTABLES)/dtc
PAHOLE := $(HOST_OUT_EXECUTABLES)/pahole
KERNEL_OUT := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
RECOVERY_KERNEL_OUT := $(TARGET_OUT_INTERMEDIATES)/RECOVERY_KERNEL_OBJ
DTBO_OUT := $(TARGET_OUT_INTERMEDIATES)/DTBO_OBJ
Expand Down Expand Up @@ -431,7 +430,7 @@ $(KERNEL_CONFIG): $(KERNEL_OUT) $(ALL_KERNEL_DEFCONFIG_SRCS)
@echo "Building Kernel Config"
$(call make-kernel-config,$(KERNEL_OUT),$(KERNEL_DEFCONFIG))

$(TARGET_PREBUILT_INT_KERNEL): $(KERNEL_CONFIG) $(DEPMOD) $(DTC) $(PAHOLE)
$(TARGET_PREBUILT_INT_KERNEL): $(KERNEL_CONFIG) $(DEPMOD) $(DTC)
@echo "Building Kernel Image ($(BOARD_KERNEL_IMAGE_NAME))"
$(call make-kernel-target,$(BOARD_KERNEL_IMAGE_NAME))
$(hide) if grep -q '^CONFIG_OF=y' $(KERNEL_CONFIG); then \
Expand Down Expand Up @@ -605,7 +604,7 @@ $(RECOVERY_KERNEL_CONFIG): $(ALL_RECOVERY_KERNEL_DEFCONFIG_SRCS)
@echo "Building Recovery Kernel Config"
$(call make-kernel-config,$(RECOVERY_KERNEL_OUT),$(RECOVERY_DEFCONFIG))

$(TARGET_PREBUILT_INT_RECOVERY_KERNEL): $(RECOVERY_KERNEL_CONFIG) $(DEPMOD) $(DTC) $(PAHOLE)
$(TARGET_PREBUILT_INT_RECOVERY_KERNEL): $(RECOVERY_KERNEL_CONFIG) $(DEPMOD) $(DTC)
@echo "Building Recovery Kernel Image ($(BOARD_KERNEL_IMAGE_NAME))"
$(call make-recovery-kernel-target,$(BOARD_KERNEL_IMAGE_NAME))

Expand Down
3 changes: 3 additions & 0 deletions config/BoardConfigKernel.mk
Expand Up @@ -219,6 +219,9 @@ KERNEL_MAKE_FLAGS += YACC=$(BUILD_TOP)/prebuilts/build-tools/$(HOST_PREBUILT_TAG
KERNEL_MAKE_FLAGS += M4=$(BUILD_TOP)/prebuilts/build-tools/$(HOST_PREBUILT_TAG)/bin/m4
TOOLS_PATH_OVERRIDE += BISON_PKGDATADIR=$(BUILD_TOP)/prebuilts/build-tools/common/bison

# Since Linux 5.10, pahole is required
KERNEL_MAKE_FLAGS += PAHOLE=$(BUILD_TOP)/prebuilts/kernel-build-tools/linux-x86/bin/pahole

# Set the out dir for the kernel's O= arg
# This needs to be an absolute path, so only set this if the standard out dir isn't used
OUT_DIR_PREFIX := $(shell echo $(OUT_DIR) | sed -e 's|/target/.*$$||g')
Expand Down

0 comments on commit 7a816e6

Please sign in to comment.