From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] efd: fix compilation by removing dep to libmath Date: Mon, 30 Jan 2017 10:58:34 +0100 Message-ID: <2268006.QGpdl6P310@xps13> References: <1485526997-31111-1-git-send-email-olivier.matz@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, "De Lara Guarch, Pablo" , "Marohn, Byron" To: Olivier Matz Return-path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id E92743B5 for ; Mon, 30 Jan 2017 10:58:35 +0100 (CET) Received: by mail-wm0-f53.google.com with SMTP id v77so39857050wmv.0 for ; Mon, 30 Jan 2017 01:58:35 -0800 (PST) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2017-01-27 14:45, De Lara Guarch, Pablo: > From: Olivier Matz [mailto:olivier.matz@6wind.com] > > > > When we compile the dpdk with: > > CONFIG_RTE_LIBRTE_EFD=y > > CONFIG_RTE_LIBRTE_NFP_PMD=n > > CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=n > > CONFIG_RTE_LIBRTE_SCHED=n > > CONFIG_RTE_LIBRTE_METER=n > > > > The linker gives the following error: > > lib/librte_efd.a(rte_efd.o): In function `rte_efd_create': > > lib/librte_efd/rte_efd.c:560: undefined reference to `log2' > > collect2: error: ld returned 1 exit status > > > > This is because the '-lm' is missing in mk/rte.app.mk. > > > > An alternative, which is proposed by this patch, is to use the compiler > > builtin rte_bsf32() to process log2 instead of the libmath log2() that > > requires to include math.h and link with -lm. > > > > Signed-off-by: Olivier Matz > > Acked-by: Pablo de Lara > > Nice catch, thanks! Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library") Applied, thanks