From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 27685A055D for ; Sun, 28 Feb 2021 13:53:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 47CC022A240; Sun, 28 Feb 2021 13:53:51 +0100 (CET) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by mails.dpdk.org (Postfix) with ESMTP id D6CFC4069E; Sun, 28 Feb 2021 13:53:48 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 2DDD35800D9; Sun, 28 Feb 2021 07:53:48 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:53:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm3; bh= MjnggoX90vg9C2rPF0/00RWPF3IRv43kv7Oavb9DVxw=; b=01HWIavp2ctnLzZr s3ROFfFCMXDEdEgATR2lpRv8At+9eQLq/euIQM4U3fZB7K2N8Qb4FBEdXb2luc+Z ELPzJxqetES5zhXPYVaCTjOoA4zczHvnyjADdjy+9tv8jkTZkM57DvjsGW1UWAF5 Hc+sYEC17FzEofU57Kygwmjb+VB+ovVJCL16/4ANUR99IOllo5d+oPRxgQcjIIjH k09Y8/zOvOEwyDjT8iq2wDKywgcxzurnrdT0CNpL15ZjRPqba1ge7qSsyquUkOki AawE8zFngN0yebtyXF3b5mjIhyyqNg6/uGYPDjsRifpEouB0Cy3qwlUjXO0LTAo1 pTfaKw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=MjnggoX90vg9C2rPF0/00RWPF3IRv43kv7Oavb9DV xw=; b=uv2ZCPIIYsrncXeNUYA3CrbyH1sEdIqWvJF8M2V6CKYZOB0InlJvEQAcY 0KzQu5Ps4Hbhh3cIko04ygsmeDshywk8UyMSW3EW2ZA5b+8qtR15ahLLxvFZKH7J yaGubZ5BeBbSQh0+xDqcpnmNd3QwdEKJQ+jTLPFeJZawTxNpejxWp6mGEAhoo/RC KK7ixuj+2byx9KeLI6YyM50Zw/1KjLfoFY5L9rqZ+jyAD9ODXl1IhQjEew6gO+Pe kmRUh3WsS6yPpiasVrb+IY2SrLavfEiuXxETuBvBi2AadoBU2kB2wkmqttT3QgP9 BnH4WtMpGp/l3ZNyD8l1V11gbKwSw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 5E230240054; Sun, 28 Feb 2021 07:53:45 -0500 (EST) From: Thomas Monjalon To: Bruce Richardson Cc: dev@dpdk.org, ncopa@alpinelinux.org, stable@dpdk.org, Hemant Agrawal , Sachin Saxena , Jakub Grajciar , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Cristian Dumitrescu , John McNamara , Maxime Coquelin , Chenbo Xia , Anatoly Burakov , Konstantin Ananyev , Marcin Smoczynski Date: Sun, 28 Feb 2021 13:53:43 +0100 Message-ID: <9174563.jNpO6MIbjI@thomas> In-Reply-To: <2086874.LCvNQC0ieA@thomas> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210226094656.GD1308@bricha3-MOBL.ger.corp.intel.com> <2086874.LCvNQC0ieA@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v5 04/17] build: define _GNU_SOURCE globally X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 26/02/2021 11:04, Thomas Monjalon: > 26/02/2021 10:46, Bruce Richardson: > > On Fri, Feb 26, 2021 at 10:40:32AM +0100, Thomas Monjalon wrote: > > > 26/02/2021 10:08, Bruce Richardson: > > > > On Thu, Feb 25, 2021 at 07:22:37PM +0100, Thomas Monjalon wrote: > > > > > There was an intent to define _GNU_SOURCE globally, > > > > > but it was not set in pkg-config for external applications. > > > > > > > > > Is this something that we really want to do, to force all external apps to > > > > use _GNU_SOURCE when compiling? Do some of our header files rely on > > > > definitions only available with _GNU_SOURCE? If so, we should probably look > > > > to remove that dependency rather than mandating the define. > > > > > > From patch 5: > > > In musl libc, cpu_set_t is defined only if _GNU_SOURCE is defined. > > > > > > If we avoid mandating _GNU_SOURCE, > > > we must #ifdef functions relying on rte_cpuset_t in the headers: > > > - rte_lcore_cpuset > > > - rte_thread_set_affinity > > > - rte_thread_get_affinity > > > - rte_telemetry_init (internal) > > > Or a different trick in linux/include/rte_os.h could be: > > > typedef void rte_cpuset_t; > > > so it allows including files, but not using above functions of course. > > > > > Can we just define _GNU_SOURCE in the header file with rte_cpuset_t? > > That would be the simplest solution yes :) > I don't really like defining such flag in a header file because > it impacts all code coming after the include. > It would mean all includes done after DPDK ones behave differently. > > I vote for the trick: > #ifdef _GNU_SOURCE > typedef cpu_set_t rte_cpuset_t; > #else > typedef void rte_cpuset_t; > #endif > > Opinions? I changed my mind, I think it is saner to not export functions which use rte_cpuset_t, if the type is not defined. The type definition is detected thanks to CPU_SETSIZE and a new definition is used inside DPDK: RTE_HAS_CPUSET. I think it is more elegant and easier to debug. I am sending a v6.