From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 329633989 for ; Thu, 14 Jul 2016 13:30:16 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id i5so109273089wmg.0 for ; Thu, 14 Jul 2016 04:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=blkqsqXJSgW8PirqvLQuCynpFwQN2L92i44ZQvl20aY=; b=fIPphSqCUEW8Jb1sqSImadh197yZ0OKWAW6Z0rvxLrFAXTUiC3pG1uaavWWyxBtaKq kguzl1iGrNXCOLwWSP3znMoXkHwdqtm49Ar4mgw0kt0QdOEsQFZt8bPZsL+IziMxKjTc 3VhAKcNXAJdxrGQZQ57J1QDqc/hhsr4EG3+TjSIxcq+0efHGF43Cn//WUgzWFEQe0edN 2MTtl3L6pp60lRxnjFK2eTdyNyBdigkCweR6q9NKGZ7vi2BXZw8CeFRyC0oBGJl0PDTU PXsa9g39ttR2nSmmCxas/0o3dshAOhfNnx/3rHb7rhibslAJyDscKM6VD7WIMMsfwSOJ cyqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=blkqsqXJSgW8PirqvLQuCynpFwQN2L92i44ZQvl20aY=; b=mpL/hlogJhF11CNF4okvzqOfCNSponqrayvfuUUm0mObzKQ4Ba1MCB/DU+0nKT4/os CYPsN6S5FOu5GxTaJCNXA81//3vDH0jToPqn45IteEtoxTKJBeCODQGkHrM8A/kYIGBn S3r+jTf/KSiTMTzEwqAy2VurpeLbnFuUvd7csg3g0sBwj+bAIlQpZeMpQzfjFuDMvvK+ //NgLPVMbBnq1GvakZ8zEM54QiQKoiq4ej4t6Bf+j+fNyKvzl9TjBbbT1YCCtrL2UUFY i1Pc69YigZa6mRDzZ1v2CvvYbz/MNCkzZFOKx8FnHxz37fXGcj5HqU3vVDW9MrkB7rDz /GAg== X-Gm-Message-State: ALyK8tKPUY5jHxW56btNWOQ5ZCniDP75/GLHnnjtlnUTmH4CiP4spXmBZu5ehZUGghLAIe9g X-Received: by 10.28.135.69 with SMTP id j66mr33549388wmd.10.1468495815963; Thu, 14 Jul 2016 04:30:15 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id p6sm25942910wme.19.2016.07.14.04.30.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jul 2016 04:30:15 -0700 (PDT) From: Thomas Monjalon To: "Damjan Marion (damarion)" Cc: dev@dpdk.org Date: Thu, 14 Jul 2016 13:30:14 +0200 Message-ID: <8960687.gEONPgFZ8H@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: <2746154.p2WhExbrR9@xps13> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Subject: Re: [dpdk-dev] 16.07-rc2 issue with rte_rtm_init(void) constructor 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, 14 Jul 2016 11:30:16 -0000 2016-07-14 09:36, Damjan Marion: >=20 > > On 14 Jul 2016, at 10:20, Thomas Monjalon wrote: > >=20 > > 2016-07-13 22:58, Damjan Marion: > >> I have issues with linking application to 16.07-rc2. > >>=20 > >> Looks like reason is constructor function in include file, > >> so our unit test apps are failing to link as they are not linked w= ith dpdk libs. > >> (and they should not be as they are not calling any dpdk function)= . > >=20 > > I don't understand: > > Why are you linking DPDK if you do not use any DPDK function? >=20 > If i simplify it, i have 4 components: >=20 > 1. libdpdk > 2. libXXX > 3. app-A > 4. app-B >=20 > libXXX includes some dpdk headers, mainly because of data structures = like rte_mbuf, and some functions are calling > functions form libdpdk. >=20 > app-A links against libdpdk and libXXX > app-B links against libXXX only and only uses functions from libXXX w= hich doesn=E2=80=99t have dpdk dependency >=20 > This is working fine in 14.04. In 14.07 rte_rtm_init() implants himse= lf into libXXX as it is defined > in header file, and that causes linking to fail due to missing rte_cp= u_get_flag_enabled(). OK I better understand :) > >> static inline void __attribute__((constructor)) > >> rte_rtm_init(void) > >> { > >> rtm_supported =3D rte_cpu_get_flag_enabled(RTE_CPUFLAG_RTM)= ; > >> } > >>=20 > >> linking fails with: > >> dpdk/include/rte_spinlock.h:103: undefined reference to `rte_cpu_g= et_flag_enabled=E2=80=99 > >>=20 > >> Is there any chance that this one is moved to some .c file, so it = is loaded > >> only when it is really needed? > >=20 > > Yes it could be moved to lib/librte_eal/common/arch/x86/. >=20 > Any chance to get this in 16.07 ? Yes maybe if you submit a patch quickly and it is clean enough.