From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 7C7F958E6 for ; Thu, 9 Oct 2014 12:01:15 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 09 Oct 2014 03:08:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,683,1406617200"; d="scan'208";a="585932807" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 09 Oct 2014 03:08:34 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s99A8Xco001801; Thu, 9 Oct 2014 11:08:34 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s99A8XPp005995; Thu, 9 Oct 2014 11:08:33 +0100 Received: (from smonroy@localhost) by sivswdev02.ir.intel.com with id s99A8X0P005991; Thu, 9 Oct 2014 11:08:33 +0100 From: Sergio Gonzalez Monroy To: dev@dpdk.org Date: Thu, 9 Oct 2014 11:08:33 +0100 Message-Id: <1412849313-5958-1-git-send-email-sergio.gonzalez.monroy@intel.com> X-Mailer: git-send-email 1.8.5.4 In-Reply-To: <1412611022-8278-1-git-send-email-sergio.gonzalez.monroy@intel.com> References: <1412611022-8278-1-git-send-email-sergio.gonzalez.monroy@intel.com> Subject: [dpdk-dev] [PATCH v2] Pass CC option when building kernel modules X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Oct 2014 10:01:15 -0000 At least on kernels 3.15 or newer, wrong compiler flags are set when building kernel modules. v2: Remove unnecessary reset of CC when being included from the kernel. Signed-off-by: Sergio Gonzalez Monroy --- 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 c4ca3fd..41c0d0f 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) + CC=$(KERNELCC) CROSS_COMPILE=$(CROSS) # 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 ee4f451..40cb389 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 262ebdf..993eb26 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 612370d..f03a2a2 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 -- 1.9.3