From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (unknown [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 673821B2C3 for ; Thu, 26 Oct 2017 16:05:45 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Oct 2017 07:05:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,434,1503385200"; d="scan'208,217";a="1210405266" Received: from irdmzpr02.ir.intel.com (HELO [163.33.54.143]) ([163.33.54.143]) by fmsmga001.fm.intel.com with ESMTP; 26 Oct 2017 07:05:26 -0700 To: Ferruh Yigit Cc: dev@dpdk.org, Thomas Monjalon References: <20171025083645.45740-1-ferruh.yigit@intel.com> From: "Gonzalez Monroy, Sergio" Message-ID: <7f85550c-f992-16eb-2e41-9aae1e6813b2@intel.com> Date: Thu, 26 Oct 2017 15:05:26 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171025083645.45740-1-ferruh.yigit@intel.com> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] eal: fix build with glibc < 2.12 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Oct 2017 14:05:45 -0000 On 25/10/2017 09:36, Ferruh Yigit wrote: > build error: > CC rte_cycles.o > cc1: warnings being treated as errors > ...dpdk/lib/librte_eal/common/arch/x86/rte_cycles.c: In function > ‘rdmsr’: > ...dpdk/lib/librte_eal/common/arch/x86/rte_cycles.c:67:2: error: > implicit declaration of function ‘pread’ > ...dpdk/lib/librte_eal/common/arch/x86/rte_cycles.c:67:2: error: > nested extern declaration of ‘pread’ > > from pread man page: > pread(), pwrite(): > _XOPEN_SOURCE >= 500 > || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L > > For glibc < 2.12 _XOPEN_SOURCE >= 500 is required. > > Adding _GNU_SOURCE define to the file which implies _XOPEN_SOURCE=700 > > Fixes: ad3516bb4ae1 ("eal/x86: implement arch-specific TSC freq query") > Cc: sergio.gonzalez.monroy@intel.com > > Signed-off-by: Ferruh Yigit > --- > lib/librte_eal/linuxapp/eal/Makefile | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile > index 965da6e30..edfb8ff03 100644 > --- a/lib/librte_eal/linuxapp/eal/Makefile > +++ b/lib/librte_eal/linuxapp/eal/Makefile > @@ -139,6 +139,7 @@ CFLAGS_eal_common_whitelist.o := -D_GNU_SOURCE > CFLAGS_eal_common_options.o := -D_GNU_SOURCE > CFLAGS_eal_common_thread.o := -D_GNU_SOURCE > CFLAGS_eal_common_lcore.o := -D_GNU_SOURCE > +CFLAGS_rte_cycles.o := -D_GNU_SOURCE > > # workaround for a gcc bug with noreturn attribute > # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 Acked-by: Sergio Gonzalez Monroy