[1/2] build: fix libm detection in meson

Message ID 20200109125916.32073-1-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series [1/2] build: fix libm detection in meson |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

David Marchand Jan. 9, 2020, 12:59 p.m. UTC
  Using version 0.47.1, meson is unable to find the math library in Travis
for the 32bits job.
Quite surprisingly, this problem is not seen with the 64bits jobs.

Switching to 0.48.0, the problem disappears.

But we should pass 'm' to find_library instead of 'libm' anyway.

Fixes: 98edcbb5ab2f ("eal/windows: introduce Windows support")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 config/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Bruce Richardson Jan. 9, 2020, 1:09 p.m. UTC | #1
On Thu, Jan 09, 2020 at 01:59:15PM +0100, David Marchand wrote:
> Using version 0.47.1, meson is unable to find the math library in Travis
> for the 32bits job.
> Quite surprisingly, this problem is not seen with the 64bits jobs.
> 
> Switching to 0.48.0, the problem disappears.
> 
> But we should pass 'm' to find_library instead of 'libm' anyway.
> 
> Fixes: 98edcbb5ab2f ("eal/windows: introduce Windows support")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  config/meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/config/meson.build b/config/meson.build
> index 01911ecf9..28a57f56f 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -115,7 +115,7 @@ add_project_link_arguments('-pthread', language: 'c')
>  dpdk_extra_ldflags += '-pthread'
>  
>  # on some OS, maths functions are in a separate library
> -if cc.find_library('libm', required : false).found()
> +if cc.find_library('m', required : false).found()
>  	# some libs depend on maths lib
>  	add_project_link_arguments('-lm', language: 'c')
>  	dpdk_extra_ldflags += '-lm'
> -- 
> 2.23.0
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
David Marchand Jan. 9, 2020, 2:08 p.m. UTC | #2
On Thu, Jan 9, 2020 at 2:09 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Thu, Jan 09, 2020 at 01:59:15PM +0100, David Marchand wrote:
> > Using version 0.47.1, meson is unable to find the math library in Travis
> > for the 32bits job.
> > Quite surprisingly, this problem is not seen with the 64bits jobs.
> >
> > Switching to 0.48.0, the problem disappears.
> >
> > But we should pass 'm' to find_library instead of 'libm' anyway.
> >
> > Fixes: 98edcbb5ab2f ("eal/windows: introduce Windows support")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> >  config/meson.build | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/config/meson.build b/config/meson.build
> > index 01911ecf9..28a57f56f 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -115,7 +115,7 @@ add_project_link_arguments('-pthread', language: 'c')
> >  dpdk_extra_ldflags += '-pthread'
> >
> >  # on some OS, maths functions are in a separate library
> > -if cc.find_library('libm', required : false).found()
> > +if cc.find_library('m', required : false).found()
> >       # some libs depend on maths lib
> >       add_project_link_arguments('-lm', language: 'c')
> >       dpdk_extra_ldflags += '-lm'
> > --
> > 2.23.0
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Series applied.
  
Aaron Conole Jan. 9, 2020, 2:17 p.m. UTC | #3
David Marchand <david.marchand@redhat.com> writes:

> Using version 0.47.1, meson is unable to find the math library in Travis
> for the 32bits job.
> Quite surprisingly, this problem is not seen with the 64bits jobs.
>
> Switching to 0.48.0, the problem disappears.
>
> But we should pass 'm' to find_library instead of 'libm' anyway.
>
> Fixes: 98edcbb5ab2f ("eal/windows: introduce Windows support")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---

Acked-by: Aaron Conole <aconole@redhat.com>
  

Patch

diff --git a/config/meson.build b/config/meson.build
index 01911ecf9..28a57f56f 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -115,7 +115,7 @@  add_project_link_arguments('-pthread', language: 'c')
 dpdk_extra_ldflags += '-pthread'
 
 # on some OS, maths functions are in a separate library
-if cc.find_library('libm', required : false).found()
+if cc.find_library('m', required : false).found()
 	# some libs depend on maths lib
 	add_project_link_arguments('-lm', language: 'c')
 	dpdk_extra_ldflags += '-lm'