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 600CFAFCC for ; Tue, 15 Apr 2014 15:57:21 +0200 (CEST) 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 1Wa3rF-0001N6-BH; Tue, 15 Apr 2014 09:57:20 -0400 Date: Tue, 15 Apr 2014 09:57:04 -0400 From: Neil Horman To: David Marchand Message-ID: <20140415135704.GB3557@hmsreliant.think-freely.org> References: <1397569822-3294-1-git-send-email-david.marchand@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1397569822-3294-1-git-send-email-david.marchand@6wind.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: dev@dpdk.org, Pascal Mazon Subject: Re: [dpdk-dev] [PATCH] eal: do not try to load library with a local pathname 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, 15 Apr 2014 13:57:21 -0000 On Tue, Apr 15, 2014 at 03:50:22PM +0200, David Marchand wrote: > From: Pascal Mazon > > When loading a library "libfoo.so" (depending on "libbar.so", located in an > entirely different folder), with a LD_LIBRARY_PATH=/path/to/libfoo.so", it > returns an error: > > EAL: ./libfoo.so: cannot open shared object file: No such file or directory > > If the first dlopen() fails (here, because it can't find all dependencies), > the code requires for a second dlopen() that looks for "./libfoo.so". It > turns on pathname matching, which does not use LD_LIBRARY_PATH. As a result, > it fails because it cannot find "./libfoo.so". > > The error message matches the error of the second dlopen(), not the first's. > > Do not try to look for a different library ("./"-prefixed) than the one > provided in argument. Let the dynamic library management handle it, just > provide an appropriate LD_LIBRARY_PATH. > > Signed-off-by: Pascal Mazon Acked-by: Neil Horman > --- > lib/librte_eal/linuxapp/eal/eal.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c > index 3ded563..d2753ec 100644 > --- a/lib/librte_eal/linuxapp/eal/eal.c > +++ b/lib/librte_eal/linuxapp/eal/eal.c > @@ -1049,12 +1049,6 @@ rte_eal_init(int argc, char **argv) > TAILQ_FOREACH(solib, &solib_list, next) { > RTE_LOG(INFO, EAL, "open shared lib %s\n", solib->name); > solib->lib_handle = dlopen(solib->name, RTLD_NOW); > - if ((solib->lib_handle == NULL) && (solib->name[0] != '/')) { > - /* relative path: try again with "./" prefix */ > - char sopath[PATH_MAX]; > - snprintf(sopath, sizeof(sopath), "./%s", solib->name); > - solib->lib_handle = dlopen(sopath, RTLD_NOW); > - } > if (solib->lib_handle == NULL) > RTE_LOG(WARNING, EAL, "%s\n", dlerror()); > } > -- > 1.7.10.4 > >