From df2cb420b996fb688adb57c9575efbf45d75f465 Mon Sep 17 00:00:00 2001 From: Sergio Gonzalez Monroy Date: Thu, 9 Oct 2014 11:08:33 +0100 Subject: [PATCH] mk: pass CC option for kernel modules At least on kernels 3.15 or newer, wrong compiler flags are set when building kernel modules. Signed-off-by: Sergio Gonzalez Monroy Acked-by: Bruce Richardson Acked-by: Pablo de Lara --- mk/rte.module.mk | 2 +- mk/toolchain/clang/rte.vars.mk | 5 +---- mk/toolchain/gcc/rte.vars.mk | 1 + mk/toolchain/icc/rte.vars.mk | 5 +---- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/mk/rte.module.mk b/mk/rte.module.mk index d906e787fb..7bf77c1957 100644 --- a/mk/rte.module.mk +++ b/mk/rte.module.mk @@ -78,7 +78,7 @@ build: _postbuild $(MODULE).ko: $(SRCS_LINKS) @if [ ! -f $(notdir Makefile) ]; then ln -nfs $(SRCDIR)/Makefile . ; fi @$(MAKE) -C $(RTE_KERNELDIR) M=$(CURDIR) O=$(RTE_KERNELDIR) \ - CROSS_COMPILE=$(CROSS) V=$(if $V,1,0) + CC=$(KERNELCC) CROSS_COMPILE=$(CROSS) V=$(if $V,1,0) # install module in $(RTE_OUTPUT)/kmod $(RTE_OUTPUT)/kmod/$(MODULE).ko: $(MODULE).ko diff --git a/mk/toolchain/clang/rte.vars.mk b/mk/toolchain/clang/rte.vars.mk index ee4f451a0c..40cb389ddc 100644 --- a/mk/toolchain/clang/rte.vars.mk +++ b/mk/toolchain/clang/rte.vars.mk @@ -38,11 +38,8 @@ # - define TOOLCHAIN_ASFLAGS variable (overriden by cmdline value) # -ifeq ($(KERNELRELEASE),) CC = $(CROSS)clang -else -CC = $(CROSS)gcc -endif +KERNELCC = $(CROSS)gcc CPP = $(CROSS)cpp # for now, we don't use as but nasm. # AS = $(CROSS)as diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk index 262ebdfa3c..993eb2674a 100644 --- a/mk/toolchain/gcc/rte.vars.mk +++ b/mk/toolchain/gcc/rte.vars.mk @@ -39,6 +39,7 @@ # CC = $(CROSS)gcc +KERNELCC = $(CROSS)gcc CPP = $(CROSS)cpp # for now, we don't use as but nasm. # AS = $(CROSS)as diff --git a/mk/toolchain/icc/rte.vars.mk b/mk/toolchain/icc/rte.vars.mk index 612370d8a6..f03a2a27c5 100644 --- a/mk/toolchain/icc/rte.vars.mk +++ b/mk/toolchain/icc/rte.vars.mk @@ -41,11 +41,8 @@ # Warning: we do not use CROSS environment variable as icc is mainly a # x86->x86 compiler -ifeq ($(KERNELRELEASE),) CC = icc -else -CC = gcc -endif +KERNELCC = gcc CPP = cpp AS = nasm AR = ar -- 2.20.1