From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 8E5F6558D for ; Mon, 13 Jun 2016 12:04:54 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 13 Jun 2016 03:04:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,466,1459839600"; d="scan'208";a="718188254" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.87]) ([10.237.220.87]) by FMSMGA003.fm.intel.com with ESMTP; 13 Jun 2016 03:04:51 -0700 To: Thomas Monjalon References: <1465564749-1405-1-git-send-email-thomas.monjalon@6wind.com> <1465583550-21020-1-git-send-email-ferruh.yigit@intel.com> <1465583550-21020-4-git-send-email-ferruh.yigit@intel.com> <3213594.AWeSi4j5H8@xps13> Cc: dev@dpdk.org, Panu Matilainen , Christian Ehrhardt From: Ferruh Yigit Message-ID: <575E8543.2080504@intel.com> Date: Mon, 13 Jun 2016 11:04:51 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <3213594.AWeSi4j5H8@xps13> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v3 3/6] mk: sort libraries when linking, move pmd libs to higher level 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: Mon, 13 Jun 2016 10:04:55 -0000 On 6/13/2016 10:29 AM, Thomas Monjalon wrote: > 2016-06-10 19:32, Ferruh Yigit: >> As stated in the comment: >> Order is important: from higher level to lower level >> >> This is an attempt to make the layering order better respected. >> >> Limit scope of --whole-archive to pmd libraries > > Compared to the link order in the v2, you did two things: > 1/ move PMDs to the first position > 2/ restrict --whole-archive to PMDs only > > Having the PMDs first, helps the linker to get all the PMD dependencies > in the static binary. Thus it seems we do not need --whole-archive > for the PMD dependencies (ethdev, mbuf, etc). > But, if an external PMD is loaded via dlopen, it is possible that it > needs a symbol which was not used by the internal PMDs. So it will not > be found in the statically linked binary. > Let's take another example: if we disable the internal PMDs with their > config options from the static build, and we decide to build them > separately as DSOs. We won't be able to load them as plugins because > they depend on symbols which won't be found in the static binary. So you want to keep all objects in final binary (used or unused) because of the possibility that any plugin may use them. But what is the list to include here, whole dpdk?, -since we may not know what API will plugin call. What I am confused is --whole-archive only used when dpdk compiled as static, if dpdk compiled as shared, each PMD should have proper dependencies [1], and if external PMD compiled properly there shouldn't be a problem. So do we have a case that dpdk compiled statically into final binary but we still want to load some plugins dynamically? > > To make it short, the PMDs must be considered as plugins. Therefore, we > must not rely on their availability to link the required symbols in > a static binary. > To make sure the plugin loading will be always well achieved, we must > link the static PMDs at the last position. I think this is not the issue of linking PMD's first or last, but expanding --whole-archive to cover other libraries other than PMDs. > > If you agree, I vote for the v2 of this patchset. If this is breaking something and best way to fix is not in external PMD but in here, please feel free to go with v2. [1] Like all has mbuf.so dependency: # ldd build/lib/librte_pmd_ring.so linux-vdso.so.1 (0x00007ffe3d78a000) librte_eal.so.2.1 => not found librte_ring.so.1.1 => not found librte_mbuf.so.2.1 => not found libethdev.so.4.1 => not found librte_kvargs.so.1.1 => not found libc.so.6 => /lib64/libc.so.6 (0x00007f8ab5ae1000) /lib64/ld-linux-x86-64.so.2 (0x0000556616488000) # ldd build/lib/librte_pmd_af_packet.so linux-vdso.so.1 (0x00007ffcb0572000) librte_mbuf.so.2.1 => not found libethdev.so.4.1 => not found librte_kvargs.so.1.1 => not found libc.so.6 => /lib64/libc.so.6 (0x00007f7fbd4aa000) /lib64/ld-linux-x86-64.so.2 (0x00005604556d2000) # ldd build/lib/librte_pmd_null.so linux-vdso.so.1 (0x00007ffdf08cf000) librte_mbuf.so.2.1 => not found libethdev.so.4.1 => not found librte_kvargs.so.1.1 => not found libc.so.6 => /lib64/libc.so.6 (0x00007fca6fbfc000) /lib64/ld-linux-x86-64.so.2 (0x000055fe7dd4a000) Thanks, ferruh