From patchwork Wed Oct 25 08:36:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 30847 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 657721B7D4; Wed, 25 Oct 2017 10:36:51 +0200 (CEST) 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) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP; 25 Oct 2017 01:36:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,431,1503385200"; d="scan'208";a="167310367" Received: from silpixa00372839.ir.intel.com (HELO silpixa00372839.ger.corp.intel.com) ([10.237.222.154]) by fmsmga006.fm.intel.com with ESMTP; 25 Oct 2017 01:36:48 -0700 From: Ferruh Yigit To: Sergio Gonzalez Monroy Cc: dev@dpdk.org, Ferruh Yigit Date: Wed, 25 Oct 2017 09:36:45 +0100 Message-Id: <20171025083645.45740-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.13.6 MIME-Version: 1.0 Subject: [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: , 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 Acked-by: Sergio Gonzalez Monroy --- 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