From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 0428AFFA for ; Wed, 9 Dec 2015 13:09:28 +0100 (CET) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 347A78F268; Wed, 9 Dec 2015 12:09:26 +0000 (UTC) Received: from sopuli.koti.laiskiainen.org (vpn1-5-27.ams2.redhat.com [10.36.5.27]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB9C9OE2031906; Wed, 9 Dec 2015 07:09:24 -0500 To: Sergio Gonzalez Monroy References: <56670516.7050701@intel.com> From: Panu Matilainen Message-ID: <566819F3.8030501@redhat.com> Date: Wed, 9 Dec 2015 14:09:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <56670516.7050701@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] mk: fix external shared library dependencies of libraries 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: Wed, 09 Dec 2015 12:09:28 -0000 On 12/08/2015 06:28 PM, Sergio Gonzalez Monroy wrote: > On 08/12/2015 11:47, Panu Matilainen wrote: >> Similar to commit 5f9115e58cc6f304ff4ade694cf5823d32887d1a etc, but >> for libraries. Clean up librte_vhost CFLAGS/LDFLAGS/LDLIBS confusion >> while at it. >> >> Requiring applications to know about library internal details like >> dependencies to external helper libraries is a limitation of >> static linkage, shared libraries should always know their own >> dependencies for sane operation. >> >> Linking with the combined library (whether shared or not) still >> requires knowing the internal dependencies, and intra-dpdk >> dependencies are also not currently recorded. >> >> Signed-off-by: Panu Matilainen >> --- >> >> v2: >> - clean up librte_vhost CFLAGS/LDFLAGS/LDLIBS confusion while at it >> >> > Hi Panu, > > Patch itself looks good but there is a small side effect on BSD that > results > in app/test not linking because of missing -lm. > Linuxapp links with -lm by default (EXECENV_LDLIBS), but BSD does not. Oh, those LIBRTE_SCHED entries were in a different if-block from the others... Hmm, interesting. Without this patch, on Linux -lm gets added twice which actually causes a build failure on Fedora rawhide (related to some libmvec related changes it seems). > Should we just add -lm to EXECENV_LDLIBS for BSD too instead of > adding it on each app/example that uses librte_sched ? Linking should be based on usage, not convenience or such... but there's no explanation why -lm is added everywhere in Linux: commit 6da94b7a92d9706c1a4fb23a9cf54f49e6019af2 Author: Intel Date: Wed Sep 18 12:00:00 2013 +0200 mk: link with libm Signed-off-by: Intel Certainly librte_sched should link to -lm and in static builds, all its users, but beyond that I suppose it needs closer investigation of what (if anything else) actually needs it. I think we better leave it alone for 2.2, but the librte_vhost part should be safe. I can send another version with just that if it has a chance to make it to 2.2, otherwise lets postpone it to 2.3. - Panu - - Panu - - Panu -