From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id C5DAE91AA for ; Fri, 4 Dec 2015 18:31:33 +0100 (CET) Received: by wmuu63 with SMTP id u63so70967596wmu.0 for ; Fri, 04 Dec 2015 09:31:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to; bh=4dTaGSIS1Cu08grUst23bV+9FPLfPJxpm9DBl1gPTuI=; b=d7UqTR6e2CYEc3UfKSb3rw97Ah/2NUtS7iUhSmLMMc1l1rvmczWRmgFeF47L7tBEIn ss0m3g+lc+OaIx6Atxg3a207DXjDZmKrc6PlFkeZ+s7h+wPZ1vD73VcpJRg0R0Toa2l4 1dzwUAGEtVEW+YF2ZggKLuymZUpnrFb4JqN4C33eB0tmuCPx1tPaq+aRU79ZXKk3eODl 6QN2TbLRELKMaX6dUdYI8e8nj4Pzuo2ajp68jliMo9c2sMRV9ThPAT0Sn6zFiP4SwdC7 CkTzebKpbdke0F2+N15e7F75VuBNYPq85+zDbEvrVR/AmRYSuuRPqAVdC+blcle//9ty 5tMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to; bh=4dTaGSIS1Cu08grUst23bV+9FPLfPJxpm9DBl1gPTuI=; b=fqFCxnjEP+H9mKVwuXus3bXHHl9SO9eg9o7IAozUnPAgQvEpIdFJ0rk0ATtUBeRpHO +W4ZNvaEnha/HFYrcHwNbhtB0QG8po7o5y4lhFv6muXHffG5vxsedpnhSmeDyWx9Jvwq ww1ItRgdpNbVI6C1t54d8Efwuzqbkuzc1B8zUtLf6lWdY7rAy0w5leps1d4XEDsWcmgt ASWse9fgjrm0/DEsH+UnhZ2GFrwY4HppFZgXUmYumRXL9Rwu1jpfQM0avdA/n6Pa80Wl 6HT0XUDaBWSruvuu3PR2qlUKhoT62LG0Z9gAsoIKhJ1/62RJZu0OpTNpDnaaMNy3lsdV P77g== X-Gm-Message-State: ALoCoQmCme6/v8GIhr+bUh6ppikFSb/0KPK7D6P2+bennvY50XP/7+pYb51HYY23VQm3yMMxRSW/ X-Received: by 10.28.60.84 with SMTP id j81mr6259891wma.15.1449250293607; Fri, 04 Dec 2015 09:31:33 -0800 (PST) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id a76sm4371916wma.19.2015.12.04.09.31.31 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Dec 2015 09:31:32 -0800 (PST) Date: Fri, 4 Dec 2015 18:31:14 +0100 From: Adrien Mazarguil To: David Marchand Message-ID: <20151204173114.GH5048@6wind.com> Mail-Followup-To: David Marchand , dev@dpdk.org References: <1449239893-4012-1-git-send-email-david.marchand@6wind.com> <1449249063-9792-1-git-send-email-david.marchand@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1449249063-9792-1-git-send-email-david.marchand@6wind.com> Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] mk: fix objects/library order when linking 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: Fri, 04 Dec 2015 17:31:33 -0000 On Fri, Dec 04, 2015 at 06:11:03PM +0100, David Marchand wrote: > The initial problem has been seen while building mlx4 pmd as a shared library > on Ubuntu 14.04 (gcc 4.8.4-2ubuntu1~14.04). > > Resulting .so will lack the DT_NEEDED entry for libibverbs: > > marchand@ubuntu1404:~/dpdk$ ldd ./build/lib/librte_pmd_mlx4.so > linux-vdso.so.1 => (0x00007fff87ebb000) > libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2ced21a000) > /lib64/ld-linux-x86-64.so.2 (0x00007f2ced821000) > > And trying to load it in testpmd triggers this error: > > [...] > EAL: librte_pmd_mlx4.so: undefined symbol: ibv_query_port > [...] > > After some strace, the problem comes from the --as-needed option passed to the > linker. > > It is safer to specify libraries we depend on after the objects we are linking > into a shared library, especially when the linker is invoked with options like > --as-needed. > > Fixes: bef06a8a0655 ("mk: set library dependencies in shared object file") > > Signed-off-by: David Marchand > --- > > Changes since v1: > - added some details in commitlog since Thomas does not like "safer" > argument :-) Obvious issue that did not show up in our tests under Debian. Acked-by: Adrien Mazarguil -- Adrien Mazarguil 6WIND