From 2756f7c7ae2082ca0b742cb2ece770198789d30e Mon Sep 17 00:00:00 2001 From: Frank Hunleth Date: Mon, 5 Mar 2018 13:59:05 -0500 Subject: [PATCH] linux: add BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF Some Linux kernel configuration options (such as CONFIG_UNWINDER_ORC) require building a host program that needs libelf. Users who have libelf installed on their system won't see a problem, but users who don't have libelf installed will get a build failure. Therefore, this commit adds an option that allows a user to indicate that his Linux kernel configuration requires libelf. When this option is enabled, we add host-elfutils to the dependencies of the linux package (host-elfutils provides the libelf library). Signed-off-by: Thomas Petazzoni --- linux/Config.in | 13 +++++++++++++ linux/linux.mk | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/linux/Config.in b/linux/Config.in index 5afd620..025a0e1 100644 --- a/linux/Config.in +++ b/linux/Config.in @@ -412,6 +412,19 @@ config BR2_LINUX_KERNEL_INSTALL_TARGET /boot if DTBs have been generated by the kernel build process. +config BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF + bool "Needs host libelf" + help + Some Linux kernel configuration options (such as + CONFIG_UNWINDER_ORC) require building a host program that + needs libelf. Enabling this option will ensure host-elfutils + (which provides libelf) gets built before the Linux kernel. + + Enable this option if you get a Linux kernel build failure + such as "Cannot generate ORC metadata for + CONFIG_UNWINDER_ORC=y, please install libelf-dev, + libelf-devel or elfutils-libelf-devel". + # Linux extensions source "linux/Config.ext.in" diff --git a/linux/linux.mk b/linux/linux.mk index 5300b9c..b724b66 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -80,6 +80,10 @@ LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_LZMA) += CONFIG_KERNEL_LZMA LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_LZO) += CONFIG_KERNEL_LZO LINUX_COMPRESSION_OPT_$(BR2_LINUX_KERNEL_XZ) += CONFIG_KERNEL_XZ +ifeq ($(BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF),y) +LINUX_DEPENDENCIES += host-elfutils +endif + # If host-uboot-tools is selected by the user, assume it is needed to # create a custom image ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS),y) -- 2.7.4