From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id A77727E0B for ; Thu, 30 Oct 2014 17:12:24 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 30 Oct 2014 09:19:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,286,1413270000"; d="scan'208";a="599143054" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga001.jf.intel.com with ESMTP; 30 Oct 2014 09:21:19 -0700 Received: from irsmsx106.ger.corp.intel.com (163.33.3.31) by IRSMSX103.ger.corp.intel.com (163.33.3.157) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 30 Oct 2014 16:20:18 +0000 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.82]) by IRSMSX106.ger.corp.intel.com ([169.254.8.179]) with mapi id 14.03.0195.001; Thu, 30 Oct 2014 16:20:18 +0000 From: "Gonzalez Monroy, Sergio" To: Neil Horman Thread-Topic: [dpdk-dev] [PATCH] mk: --no-as-needed by default for linux exec-env Thread-Index: AQHP9DBuddw7LeIAtUeKj1hEPMgNGJxIeI6QgAAy+wCAABRaEA== Date: Thu, 30 Oct 2014 16:20:17 +0000 Message-ID: <91383E96CE459D47BCE92EFBF5CE73B004E9A23A@IRSMSX108.ger.corp.intel.com> References: <1414666662-14966-1-git-send-email-sergio.gonzalez.monroy@intel.com> <91383E96CE459D47BCE92EFBF5CE73B004E9A0FB@IRSMSX108.ger.corp.intel.com> <20141030140110.GE24783@hmsreliant.think-freely.org> In-Reply-To: <20141030140110.GE24783@hmsreliant.think-freely.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] mk: --no-as-needed by default for linux exec-env 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: Thu, 30 Oct 2014 16:12:25 -0000 > > Basically, Ubuntu GCC is always passing --as-needed to the linker > > which causes some Linking issues for us. > Can you elaborate here? > Neil >=20 Sorry, probably I could have given more info about the issue. Currently if we build DPDK with shared libs on Ubuntu, build process fails = when it tries to link test apps with following error: /tmp/DPDK-1.8-RC4/x86_64-native-linuxapp-gcc/lib/librte_eal.so: undefined r= eference to `rte_mempool_lookup' /tmp/DPDK-1.8-RC4/x86_64-native-linuxapp-gcc/lib/librte_eal.so: undefined r= eference to `rte_mempool_create' We can work around that error by building with EXTRA_LDFLAGS=3D'--no-as-nee= ded' because as the link about Debian/Ubuntu toolchain mention, they always pass the '--as-needed' flag to= the compiler. I see a couple of issues with this flag in our current build process (this = is from my own testing, I could be missing something here): - We do not set dependencies for DPDK shared libraries. This is the cause o= f the error shown above. As the libs have no dependencies (librte_eal has no dependency on librte= _mempool) and the app itself is not referencing the functions, librte_mempool is 'not needed' and the app fa= ils to link when it tries to resolve librte_eal symbols. - We push PMDs into the binary without being reference with --whole-archive= but that does not seem to be the case if we previously have --as-needed (maybe there is a way around this= ? ) I have posted an RFC about improving the current build process, mostly affe= cting shared lib building. By adding dependencies we could fix the error but not the second issue with= PMDs. I guess now it makes more sense what I mention below about not being sure a= bout this patch, cause is not tackling the real issue here. Hope this helps. Thanks, Sergio > > I'm not entirely sure that we should patch this issue or just add to th= e > release notes. > > Currently we can work around this by setting EXTRA_LDFLAGS=3D'--no-as- > needed' > >