[dpdk-dev] [PATCH] mk: pass CROSS_COMPILE when compiling kernel modules

Aaro Koskinen aaro.koskinen at nsn.com
Fri Feb 7 17:44:18 CET 2014


Pass CROSS_COMPILE to the kernel build system when compiling kernel
modules. Although we export CC etc. the top level kernel Makefile will
override the environment. As a result it will end up using wrong tools
if cross-compilation is desired but CROSS_COMPILE is not set.

Signed-off-by: Aaro Koskinen <aaro.koskinen at nsn.com>
---
 mk/rte.module.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mk/rte.module.mk b/mk/rte.module.mk
index b3a630e..5d66d90 100644
--- a/mk/rte.module.mk
+++ b/mk/rte.module.mk
@@ -77,7 +77,7 @@ build: _postbuild
 # build module
 $(MODULE).ko: $(SRCS_LINKS)
 	@if [ ! -f $(notdir Makefile) ]; then ln -nfs $(SRCDIR)/Makefile . ; fi
-	@$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR)
+	@$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR) CROSS_COMPILE=$(CROSS)
 
 # install module in $(RTE_OUTPUT)/kmod
 $(RTE_OUTPUT)/kmod/$(MODULE).ko: $(MODULE).ko
-- 
1.8.5.1



More information about the dev mailing list