From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 70A3E2C2C for ; Fri, 1 Jul 2016 12:05:29 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 01 Jul 2016 03:05:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,556,1459839600"; d="scan'208";a="1013397835" 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:05:27 -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: Date: Fri, 1 Jul 2016 11:05:26 +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:05:30 -0000 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?