Message ID | 1465583550-21020-7-git-send-email-ferruh.yigit@intel.com (mailing list archive) |
---|---|
State | Rejected, archived |
Delegated to: | Thomas Monjalon |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id C451D2BD7; Fri, 10 Jun 2016 20:33:52 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E645E2BAD for <dev@dpdk.org>; Fri, 10 Jun 2016 20:33:51 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 10 Jun 2016 11:33:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,451,1459839600"; d="scan'208";a="119738518" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga004.fm.intel.com with ESMTP; 10 Jun 2016 11:33:49 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u5AIXmVE004601; Fri, 10 Jun 2016 19:33:48 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id u5AIXmTj022729; Fri, 10 Jun 2016 19:33:48 +0100 Received: (from fyigit@localhost) by sivswdev02.ir.intel.com with id u5AIXmrJ022725; Fri, 10 Jun 2016 19:33:48 +0100 From: Ferruh Yigit <ferruh.yigit@intel.com> To: dev@dpdk.org Cc: Thomas Monjalon <thomas.monjalon@6wind.com>, Panu Matilainen <pmatilai@redhat.com>, Christian Ehrhardt <christian.ehrhardt@canonical.com>, Ferruh Yigit <ferruh.yigit@intel.com> Date: Fri, 10 Jun 2016 19:32:30 +0100 Message-Id: <1465583550-21020-7-git-send-email-ferruh.yigit@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1465583550-21020-1-git-send-email-ferruh.yigit@intel.com> References: <1465564749-1405-1-git-send-email-thomas.monjalon@6wind.com> <1465583550-21020-1-git-send-email-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH v3 6/6] mk: prevent overlinking in applications X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Ferruh Yigit
June 10, 2016, 6:32 p.m. UTC
Replace --no-as-needed linker flag with --as-needed flag, which will only link libraries directly called by application. It can be achieved now that the libraries dependencies are handled properly. Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> --- mk/exec-env/linuxapp/rte.vars.mk | 3 --- mk/rte.app.mk | 8 ++++++++ 2 files changed, 8 insertions(+), 3 deletions(-)
Comments
Hi Ferruh, 2016-06-10 19:32, Ferruh Yigit: > --- a/mk/rte.app.mk > +++ b/mk/rte.app.mk > @@ -50,6 +50,14 @@ ifeq ($(NO_LDSCRIPT),) > LDSCRIPT = $(RTE_LDSCRIPT) > endif > > +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) > +# Workaround to eal <-> mempool cyclic dependency > +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool > +endif > + > +# Link only the libraries used in the application > +_LDLIBS-y += --as-needed I think we do not need this workaround. The dependency of EAL logs on mempool is now removed. We only have the dependency of EAL ivshmem on librte_ivshmem header (which needs mempool and rings headers).
On 6/11/2016 7:34 AM, Thomas Monjalon wrote: > Hi Ferruh, > > 2016-06-10 19:32, Ferruh Yigit: >> --- a/mk/rte.app.mk >> +++ b/mk/rte.app.mk >> @@ -50,6 +50,14 @@ ifeq ($(NO_LDSCRIPT),) >> LDSCRIPT = $(RTE_LDSCRIPT) >> endif >> >> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) >> +# Workaround to eal <-> mempool cyclic dependency >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool >> +endif >> + >> +# Link only the libraries used in the application >> +_LDLIBS-y += --as-needed > > I think we do not need this workaround. > The dependency of EAL logs on mempool is now removed. > We only have the dependency of EAL ivshmem on librte_ivshmem header > (which needs mempool and rings headers). > I missed that dependency removed, this is good, I will send a new version of the patch. Thanks, ferruh
Hi, great work on cleaning that up already. I applied v3 of the series and see already much better results. But I found some more that should be part of this. I don't know how generally available a similar solution is, but usually in our build dpkg-shlibdeps checks for under/overlinking issues. I let that run on a dir built from git plus v3 of the series in discussion here. There are two way of open dependency issues left: 1. some libraries use symbols of other libraries they are not linked with correctly yet 2. the appliactions are still overlinking We need to finalize #1 first before being able to tackle #2 without breaking something. I'll send a patch for the following so it can be part of your v4 $ for binfile in $(find debian/build/shared-root/lib -executable -type f; find debian/build/shared-root/app -executable -type f;); do printf "\n\n\nTesting %s\n" $binfile; dpkg-shlibdeps -e $binfile -ldebian/build/shared-root/lib/ | grep -v "installed in their package's directory"; done Testing debian/build/shared-root/lib/librte_port.so.3 dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: symbol rte_sched_port_dequeue used by debian/build/shared-root/lib/librte_port.so.3 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_sched_port_enqueue used by debian/build/shared-root/lib/librte_port.so.3 found in none of the libraries dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory Testing debian/build/shared-root/lib/librte_pmd_bond.so.1 dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: symbol rte_mempool_create used by debian/build/shared-root/lib/librte_pmd_bond.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_ring_create used by debian/build/shared-root/lib/librte_pmd_bond.so.1 found in none of the libraries Testing debian/build/shared-root/lib/librte_pipeline.so.3 dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: symbol per_lcore__lcore_id used by debian/build/shared-root/lib/librte_pipeline.so.3 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_eal_has_hugepages used by debian/build/shared-root/lib/librte_pipeline.so.3 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_mem_virt2phy used by debian/build/shared-root/lib/librte_pipeline.so.3 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_free used by debian/build/shared-root/lib/librte_pipeline.so.3 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_log used by debian/build/shared-root/lib/librte_pipeline.so.3 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_zmalloc_socket used by debian/build/shared-root/lib/librte_pipeline.so.3 found in none of the libraries Testing debian/build/shared-root/lib/librte_pmd_null_crypto.so.1 dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: symbol rte_ring_create used by debian/build/shared-root/lib/librte_pmd_null_crypto.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_kvargs_parse used by debian/build/shared-root/lib/librte_pmd_null_crypto.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_kvargs_free used by debian/build/shared-root/lib/librte_pmd_null_crypto.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_kvargs_process used by debian/build/shared-root/lib/librte_pmd_null_crypto.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_ring_lookup used by debian/build/shared-root/lib/librte_pmd_null_crypto.so.1 found in none of the libraries dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory Testing debian/build/shared-root/lib/librte_pmd_vhost.so.1 dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: symbol rte_eal_driver_register used by debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_log used by debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol pthread_join used by debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol pthread_cancel used by debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_eal_has_hugepages used by debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_mem_virt2phy used by debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_zmalloc_socket used by debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol pthread_create used by debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol per_lcore__lcore_id used by debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_socket_id used by debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the libraries dpkg-shlibdeps: warning: 2 other similar warnings have been skipped (use -v to see them all) dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory Testing debian/build/shared-root/lib/librte_pmd_fm10k.so.1 dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: symbol rte_kvargs_count used by debian/build/shared-root/lib/librte_pmd_fm10k.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_kvargs_free used by debian/build/shared-root/lib/librte_pmd_fm10k.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_kvargs_parse used by debian/build/shared-root/lib/librte_pmd_fm10k.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_kvargs_process used by debian/build/shared-root/lib/librte_pmd_fm10k.so.1 found in none of the libraries dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory Testing debian/build/shared-root/lib/librte_pmd_pcap.so.1 dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: symbol rte_eal_driver_register used by debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_cycles_vmware_tsc_map used by debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_zmalloc_socket used by debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_get_tsc_hz used by debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_free used by debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_eal_has_hugepages used by debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_socket_id used by debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol eal_timer_source used by debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_mem_virt2phy used by debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_log used by debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the libraries dpkg-shlibdeps: warning: 2 other similar warnings have been skipped (use -v to see them all) dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory Testing debian/build/shared-root/lib/librte_sched.so.1 dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: symbol rte_zmalloc used by debian/build/shared-root/lib/librte_sched.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol __rte_panic used by debian/build/shared-root/lib/librte_sched.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol per_lcore__lcore_id used by debian/build/shared-root/lib/librte_sched.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_free used by debian/build/shared-root/lib/librte_sched.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_eal_has_hugepages used by debian/build/shared-root/lib/librte_sched.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_get_tsc_hz used by debian/build/shared-root/lib/librte_sched.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_mem_virt2phy used by debian/build/shared-root/lib/librte_sched.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_log used by debian/build/shared-root/lib/librte_sched.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_cycles_vmware_tsc_map used by debian/build/shared-root/lib/librte_sched.so.1 found in none of the libraries dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory Testing debian/build/shared-root/lib/librte_pmd_af_packet.so.1 dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: symbol rte_eal_has_hugepages used by debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_zmalloc_socket used by debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_free used by debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_socket_id used by debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_mem_virt2phy used by debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_eal_driver_register used by debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol per_lcore__lcore_id used by debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_log used by debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the libraries Testing debian/build/shared-root/lib/librte_port.so.2 dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: symbol rte_sched_port_enqueue used by debian/build/shared-root/lib/librte_port.so.2 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_sched_port_dequeue used by debian/build/shared-root/lib/librte_port.so.2 found in none of the libraries dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory Testing debian/build/shared-root/lib/librte_pmd_null.so.1 dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: symbol rte_zmalloc_socket used by debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_mem_virt2phy used by debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_socket_id used by debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_cpu_get_flag_enabled used by debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_log used by debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_eal_has_hugepages used by debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_free used by debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol per_lcore__lcore_id used by debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_eal_driver_register used by debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the libraries dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory Testing debian/build/shared-root/lib/librte_ip_frag.so.1 dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory dpkg-shlibdeps: warning: symbol rte_eal_has_hugepages used by debian/build/shared-root/lib/librte_ip_frag.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_log used by debian/build/shared-root/lib/librte_ip_frag.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol per_lcore__lcore_id used by debian/build/shared-root/lib/librte_ip_frag.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_zmalloc_socket used by debian/build/shared-root/lib/librte_ip_frag.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_cpu_get_flag_enabled used by debian/build/shared-root/lib/librte_ip_frag.so.1 found in none of the libraries dpkg-shlibdeps: warning: symbol rte_mem_virt2phy used by debian/build/shared-root/lib/librte_ip_frag.so.1 found in none of the libraries dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd On Mon, Jun 13, 2016 at 11:05 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote: > On 6/11/2016 7:34 AM, Thomas Monjalon wrote: > > Hi Ferruh, > > > > 2016-06-10 19:32, Ferruh Yigit: > >> --- a/mk/rte.app.mk > >> +++ b/mk/rte.app.mk > >> @@ -50,6 +50,14 @@ ifeq ($(NO_LDSCRIPT),) > >> LDSCRIPT = $(RTE_LDSCRIPT) > >> endif > >> > >> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) > >> +# Workaround to eal <-> mempool cyclic dependency > >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool > >> +endif > >> + > >> +# Link only the libraries used in the application > >> +_LDLIBS-y += --as-needed > > > > I think we do not need this workaround. > > The dependency of EAL logs on mempool is now removed. > > We only have the dependency of EAL ivshmem on librte_ivshmem header > > (which needs mempool and rings headers). > > > > I missed that dependency removed, this is good, I will send a new > version of the patch. > > Thanks, > ferruh >
diff --git a/mk/exec-env/linuxapp/rte.vars.mk b/mk/exec-env/linuxapp/rte.vars.mk index d51bd17..a8a1ee4 100644 --- a/mk/exec-env/linuxapp/rte.vars.mk +++ b/mk/exec-env/linuxapp/rte.vars.mk @@ -45,9 +45,6 @@ else EXECENV_CFLAGS = -pthread endif -# Workaround lack of DT_NEEDED entry -EXECENV_LDFLAGS = --no-as-needed - EXECENV_LDLIBS = EXECENV_ASFLAGS = diff --git a/mk/rte.app.mk b/mk/rte.app.mk index f60e5bf..aa794bc 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -50,6 +50,14 @@ ifeq ($(NO_LDSCRIPT),) LDSCRIPT = $(RTE_LDSCRIPT) endif +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) +# Workaround to eal <-> mempool cyclic dependency +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool +endif + +# Link only the libraries used in the application +_LDLIBS-y += --as-needed + # default path for libs _LDLIBS-y += -L$(RTE_SDK_BIN)/lib