aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-08-30 15:24:45 +0200
committerJo-Philipp Wich <jo@mein.io>2019-09-03 10:44:21 +0200
commitfe43969336201f2cc7d103b68fd6e65989bee184 (patch)
treeb43abbd34dc21b51a990cb03ed5f43dcb81bd8b5
parentf3ab336d7ceda929dc8dc4a8b09a9552dc6be0b1 (diff)
downloadupstream-fe43969336201f2cc7d103b68fd6e65989bee184.tar.gz
upstream-fe43969336201f2cc7d103b68fd6e65989bee184.tar.bz2
upstream-fe43969336201f2cc7d103b68fd6e65989bee184.zip
include: kernel-build: pass pkg-config overrides to kernel build
Pass suitable pkg-config overrides to the kernel build process in order to let our pkg-config wrapper discover libraries provided by tools/. This mainly affects the use of libelf which is required for the CONFIG_STACK_VALIDATION features. So far, the build system either silently used host system libraries or kbuild simply disabled the feature due to the lack of a suitable libelf. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--include/kernel-build.mk6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/kernel-build.mk b/include/kernel-build.mk
index b7bcf0e17d..3fdf7efc52 100644
--- a/include/kernel-build.mk
+++ b/include/kernel-build.mk
@@ -131,10 +131,16 @@ define BuildKernel
$(Kernel/Configure)
touch $$@
+ $(LINUX_DIR)/.modules: export STAGING_PREFIX=$$(STAGING_DIR_HOST)
+ $(LINUX_DIR)/.modules: export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig
+ $(LINUX_DIR)/.modules: export PKG_CONFIG_LIBDIR=$$(STAGING_DIR_HOST)/lib/pkgconfig
$(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
$(Kernel/CompileModules)
touch $$@
+ $(LINUX_DIR)/.image: export STAGING_PREFIX=$$(STAGING_DIR_HOST)
+ $(LINUX_DIR)/.image: export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig
+ $(LINUX_DIR)/.image: export PKG_CONFIG_LIBDIR=$$(STAGING_DIR_HOST)/lib/pkgconfig
$(LINUX_DIR)/.image: $(STAMP_CONFIGURED) $(if $(CONFIG_STRIP_KERNEL_EXPORTS),$(KERNEL_BUILD_DIR)/symtab.h) FORCE
$(Kernel/CompileImage)
$(Kernel/CollectDebug)