From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 5CBE17F30 for ; Tue, 11 Nov 2014 16:44:29 +0100 (CET) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1XoDli-0006IN-Id; Tue, 11 Nov 2014 10:54:16 -0500 Date: Tue, 11 Nov 2014 10:54:08 -0500 From: Neil Horman To: "De Lara Guarch, Pablo" Message-ID: <20141111155408.GC31973@hmsreliant.think-freely.org> References: <91383E96CE459D47BCE92EFBF5CE73B004E9D503@IRSMSX108.ger.corp.intel.com> <20141111141857.GA4807@sivswdev02.ir.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] building shared library 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: Tue, 11 Nov 2014 15:44:29 -0000 On Tue, Nov 11, 2014 at 03:26:04PM +0000, De Lara Guarch, Pablo wrote: > > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Newman Poborsky > > Sent: Tuesday, November 11, 2014 3:17 PM > > To: Gonzalez Monroy, Sergio > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] building shared library > > > > Hi, > > > > after building DPDK libs as shared libraries and linking it, I'm back to my > > first problem: rte_eal_driver_register() never gest called and my app > > crashes since there are no drivers registered. As previously mentioned, in > > regular DPDK user app this functions is called for every driver before > > main(). How? > > If I am not wrong here, you have to use the -d option to specify the driver you want to use. > > Btw, the option you were looking for can be found in config/common_linuxapp or config/common_bsdapp. > Alternatively, when you link your application you can speify -llibrte_pmd_ and your applicaion should call all the constructors when the dynamic loader hits your binaries DT_NEEDED table. Thats how you can avoid the command line specification. Neil > Pablo > > > > BR, > > Newman > > > > On Tue, Nov 11, 2014 at 3:44 PM, Newman Poborsky > > > > wrote: > > > > > Hi Sergio, > > > > > > no, that sounds good, thank you. Since I'm not that familiar with DPDK > > > build system, where should this option be set? In 'lib' folder's Makefile? > > > > > > Thank you once again! > > > > > > BR, > > > Newman > > > > > > On Tue, Nov 11, 2014 at 3:18 PM, Sergio Gonzalez Monroy < > > > sergio.gonzalez.monroy@intel.com> wrote: > > > > > >> On Tue, Nov 11, 2014 at 01:10:29PM +0100, Newman Poborsky wrote: > > >> > Hi, > > >> > > > >> > I want to build one .so file with my app (it contains API that I want to > > >> > call through JNI) and all DPDK libs that I use in my app. > > >> > > > >> > As I've already mentioned, when I build and start my dpdk app as a > > >> > standalone application, I can see that before main() is called, there > > >> is a > > >> > call to 'rte_eal_driver_register()' function for every driver. When I > > >> build > > >> > .so file, this does not happen and no driver is registered so everyting > > >> > after rte_eal_init() fails. > > >> > > > >> Hi Newman, > > >> > > >> AFAIK the current build system does not support that. > > >> > > >> You can build DPDK as shared libs by setting the following config option: > > >> CONFIG_RTE_BUILD_SHARED_LIB=y > > >> > > >> Then build your app as an .so that links against DPDK libs, so you have > > >> explicit dependencies (such dependencies should show with ldd). > > >> > > >> Is there any reason why you want everything to be a single .so ? > > >> > > >> I don't know much about how Java loads DSOs but I reckon that it must > > >> resolve > > >> explicit dependencies such as libc. > > >> > > >> Thanks, > > >> Sergio > > >> > > >> > > >> > > > >> > BR, > > >> > Newman > > >> > > > >> > > > > > >