eal: fix build with glibc < 2.12
authorFerruh Yigit <ferruh.yigit@intel.com>
Wed, 25 Oct 2017 08:36:45 +0000 (09:36 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 26 Oct 2017 21:08:13 +0000 (23:08 +0200)
commit65d3ba32641fb5ac4e4f0361d73be343e7c6d173
tree8322e315c5546cd217a3fb0a3c0c713b3e3f450d
parenta57bbb68d47d8699fb69c280d33aeca18f070526
eal: fix build with glibc < 2.12

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")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
lib/librte_eal/linuxapp/eal/Makefile