DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: fix build with glibc < 2.12
@ 2017-10-25  8:36 Ferruh Yigit
  2017-10-26 14:05 ` Gonzalez Monroy, Sergio
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2017-10-25  8:36 UTC (permalink / raw)
  To: Sergio Gonzalez Monroy; +Cc: dev, Ferruh Yigit

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 <ferruh.yigit@intel.com>
---
 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix build with glibc < 2.12
  2017-10-25  8:36 [dpdk-dev] [PATCH] eal: fix build with glibc < 2.12 Ferruh Yigit
@ 2017-10-26 14:05 ` Gonzalez Monroy, Sergio
  2017-10-26 21:09   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Gonzalez Monroy, Sergio @ 2017-10-26 14:05 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Thomas Monjalon

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 <ferruh.yigit@intel.com>
> ---
>   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 <sergio.gonzalez.monroy@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix build with glibc < 2.12
  2017-10-26 14:05 ` Gonzalez Monroy, Sergio
@ 2017-10-26 21:09   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2017-10-26 21:09 UTC (permalink / raw)
  To: Gonzalez Monroy, Sergio; +Cc: dev, Ferruh Yigit

26/10/2017 16:05, Gonzalez Monroy, Sergio:
> 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 <ferruh.yigit@intel.com>
> 
> Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-26 21:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-25  8:36 [dpdk-dev] [PATCH] eal: fix build with glibc < 2.12 Ferruh Yigit
2017-10-26 14:05 ` Gonzalez Monroy, Sergio
2017-10-26 21:09   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).