From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id C2B702BA8 for ; Fri, 1 Jul 2016 12:19:19 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 01 Jul 2016 03:19:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,556,1459839600"; d="scan'208";a="1013403332" Received: from smonroyx-mobl.ger.corp.intel.com (HELO [10.237.221.10]) ([10.237.221.10]) by fmsmga002.fm.intel.com with ESMTP; 01 Jul 2016 03:19:14 -0700 To: "Elo, Matias (Nokia - FI/Espoo)" , "dev@dpdk.org" References: <3745bde4-f539-21d4-51e4-369d35697e57@intel.com> Cc: "ferruh.yigit@intel.com" , "damarion@cisco.com" From: Sergio Gonzalez Monroy Message-ID: <555e6907-e7df-5856-50d5-bca5c4d27909@intel.com> Date: Fri, 1 Jul 2016 11:19:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] weak functions in some drivers 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: Fri, 01 Jul 2016 10:19:20 -0000 On 01/07/2016 11:16, Elo, Matias (Nokia - FI/Espoo) wrote: >> -----Original Message----- >> From: Sergio Gonzalez Monroy [mailto:sergio.gonzalez.monroy@intel.com] >> Sent: Friday, July 01, 2016 1:05 PM >> To: Elo, Matias (Nokia - FI/Espoo) ; >> dev@dpdk.org >> Cc: ferruh.yigit@intel.com; damarion@cisco.com >> Subject: Re: [dpdk-dev] weak functions in some drivers >> >> On 01/07/2016 10:42, Elo, Matias (Nokia - FI/Espoo) wrote: >>>>>>>> What is not clear to me is motivation to use weak here instead of simply >>>>> using >CONFIG_RTE_I40E_INC_VECTOR >>>>>>>> macro to exclude stubs in i40e_rxtx.c. It will make library smaller and >> avoid >>>>> issues like this one >>>>>>>> which are quite hard to troubleshoot. >>>>>>> Since this issue seen in fd.io, I didn't investigated more, but I don't >>>>>>> want to clock your valid question, this is an attempt to resurrect the >>>>>>> question ... >>>>>> Hi, >>>>>> >>>>>> We are having exactly the same problem. For us the aforementioned >>>>> workaround doesn't seem to work and vector mode is always disabled with >> the >>>>> i40e drivers. If I modify i40e_rxtx.c and exclude the stub functions using >>>>> CONFIG_RTE_I40E_INC_VECTOR everything works as expected. >>>>>> We are building DPDK with the CONFIG_RTE_BUILD_COMBINE_LIBS option >>>>> enabled and link DPDK library to our application. >>>>>> Any other ideas how this could be fixed? >>>>>> >>>>>> Regards, >>>>>> Matias >>>>>> >>>>> So you have tried to link a combined static lib with --whole-archive >>>>> -ldpdk --no-whole-archive and still get the wrong/weak function definition? >>>>> >>>>> Sergio >>>> I actually just managed to fix the problem. In our case I had to add >>>> '-Wl,--whole-archive,-ldpdk,--no-whole-archive' to the end of AM_LDFLAGS. >>>> >>> It turned out that the problem actually wasn't fixed. >>> >>> DPDK is built with CONFIG_RTE_BUILD_COMBINE_LIBS=y and >> EXTRA_CFLAGS="-fPIC" >>> What we are linking originally: >>> -l:libdpdk.a >>> >>> This works otherwise but vector mode i40e is not enabled. >>> >>> When trying: >>> -Wl,--whole-archive,-l:libdpdk.a,--no-whole-archive >>> >>> Linking fails with ' undefined reference' errors to several dpdk functions >> (rte_eal_init, rte_cpu_get_flag_enabled, rte_eth_stats_get...). >>> Btw. there seems to be a Stack Overflow question related to this: >> http://stackoverflow.com/questions/38064021/dpdk-include-libraries-in-dpdk- >> application-compiled-as-shared-library >>> -Matias >> What DPDK version are you using? > v16.04 Ok. I was asking because there is no CONFIG_RTE_BUILD_COMBINE_LIBS in 16.04. Could you provide full link/compile command line? I'm not able to reproduce the issue so far