From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: [PATCH] eal: fix build with glibc < 2.12 Date: Wed, 25 Oct 2017 09:36:45 +0100 Message-ID: <20171025083645.45740-1-ferruh.yigit@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, Ferruh Yigit To: Sergio Gonzalez Monroy Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 515171B7CF for ; Wed, 25 Oct 2017 10:36:50 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 -- 2.13.6