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 4362A8D3C for ; Wed, 5 Oct 2016 12:17:44 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 05 Oct 2016 03:17:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,448,1473145200"; d="scan'208";a="769070260" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by FMSMGA003.fm.intel.com with ESMTP; 05 Oct 2016 03:17:43 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.196]) by irsmsx110.ger.corp.intel.com ([163.33.3.25]) with mapi id 14.03.0248.002; Wed, 5 Oct 2016 11:17:40 +0100 From: "Ananyev, Konstantin" To: Thomas Monjalon CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] eal: fix c++ compilation issue with rte_delay_us() Thread-Index: AQHSHZuJ2dkWMURa8ECMOkOmkeTXaqCZiDaAgAAbATA= Date: Wed, 5 Oct 2016 10:17:40 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772583F0BE68F@irsmsx105.ger.corp.intel.com> References: <1475515645-24667-1-git-send-email-konstantin.ananyev@intel.com> <1492896.7EzNbMBhFc@xps13> In-Reply-To: <1492896.7EzNbMBhFc@xps13> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] eal: fix c++ compilation issue with rte_delay_us() 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, 05 Oct 2016 10:17:44 -0000 Hi Thomas, >=20 > 2016-10-03 18:27, Konstantin Ananyev: > > When compiling with C++, it treats > > void (*rte_delay_us)(unsigned int us); > > as definition of the global variable. > > So further linking with librte_eal fails. > > > > Fixes: b4d63fb62240 ("eal: customize delay function") >=20 > Applied, thanks >=20 > I don't understand why it was not failing with C compilation? Don't know off hand. Yes, I would expect gcc to fail with same symptoms too. But by some reason it puts it makes it a 'common' symbol: $ cat rttm1.c #include #include #include int main(int argc, char *argv[]) { int ret =3D rte_eal_init(argc, argv); rte_delay_us(1); printf("return code: %d\n", ret); return ret; } $ gcc -m64 -pthread -o rttm1 rttm1.o -ldl -L/${RTE_SDK}/${RTE_TARGET}/lib= -Wl,-lrte_eal $ nm rttm1.o | grep rte_delay_us 0000000000000008 C rte_delay_us Konstantin