[PATCH] kernel.bbclass: build host programs with native sysroots

DORMANTno replies

From: <hidden>
Date: 2017-09-20 08:17:05
Subsystem: the rest · Maintainer: Linus Torvalds

From: Wenzong Fan <redacted>

Allow to search header files and libs from native sysroots.

For example, an expanded BUILD_CFLAGS includes:
  '-isystem/builddir/to/linux-yocto/recipe-sysroot-native/usr/include'

And an expanded BUILD_LDFLAGS includes:
  '-L/builddir/to/linux-yocto/recipe-sysroot-native/usr/lib
   -Wl,-rpath-link,/builddir/to/linux-yocto/recipe-sysroot-native/usr/lib
   -Wl,-rpath,/builddir/to/linux-yocto/recipe-sysroot-native/usr/lib'

Signed-off-by: Wenzong Fan <redacted>
---
 meta/classes/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 02a5e961cb..5a2f23e3a8 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -155,7 +155,7 @@ UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}"
 # Some Linux kernel configurations need additional parameters on the command line
 KERNEL_EXTRA_ARGS ?= ""
 
-EXTRA_OEMAKE = " HOSTCC="${BUILD_CC}" HOSTCPP="${BUILD_CPP}""
+EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}""
 KERNEL_ALT_IMAGETYPE ??= ""
 
 copy_initramfs() {
-- 
2.13.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help