From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by dpdk.org (Postfix) with ESMTP id 3AA18AE99 for ; Tue, 15 Apr 2014 15:50:34 +0200 (CEST) Received: by mail-wi0-f174.google.com with SMTP id d1so5703019wiv.13 for ; Tue, 15 Apr 2014 06:50:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=A0Q4OvkTbOeZJ9lLjw/iO1GRDCMTV6FKNDkFqj0jSGA=; b=gvD9WBJ1wa5IsxRJxhft5ctGBUz7qgsaDY7txiynqymGYeIAntbsZtcyde8pMJMI0g B7CpvmHoR0ZFi+o8oQ9VFS1ctzHn9RLlcpM5c1p0CgFtTx/o9E5GOvJEMvl+6y31HfQW rIgIGyX0Gb1pxhhgwoe8Br7BMjs/sFdVL072zN26L6h1zRe+mbgo0Wv7lqrN8f9e83kZ NDcANErra+pwrsKdGRkp8say1V42LcTHhEMvmZYEnPut6cZXRLi5xyhhR4GJrY2A7jGk 8wFoaYLzfrclj/HdeHBA7QsBMBbqqjB+Uk0rfkYACR+F5/AuOuR8GGtZPJVrpxAPNR8O XLBg== X-Gm-Message-State: ALoCoQlK4QSSZLpVURxofK8c+JS/DRL9YRh2qtkW/7OWKx44b1H/Q5vew31yMCh0zggIWrgfPI97 X-Received: by 10.180.36.101 with SMTP id p5mr2653594wij.8.1397569834488; Tue, 15 Apr 2014 06:50:34 -0700 (PDT) Received: from alcyon.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id h19sm29773165wiw.17.2014.04.15.06.50.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Apr 2014 06:50:33 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Tue, 15 Apr 2014 15:50:22 +0200 Message-Id: <1397569822-3294-1-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 Cc: Pascal Mazon Subject: [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:50:34 -0000 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 --- 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