[dpdk-dev] [PATCH v2 2/3] meson: use threads dependency as provided by meson
Dmitry Kozlyuk
dmitry.kozliuk at gmail.com
Tue Mar 23 22:21:48 CET 2021
2021-03-23 13:35 (UTC+0000), Nick Connolly:
[...]
> 2. Adding -lpthread to libdpdk.pc is more problematic. The application
> is almost
> certain to be using a threads library. If this is a 3rd party
> library, then the link
> command will potentially include two libraries defining the same
> exports.
> Which one takes precedence will depend upon the ordering in the
> application's
> build system which seems somewhat arbitrary given that the DPDK
> introduced
> dependency is not required.
Agreed. In my tests it's "-pthread", not "-lpthread", but still.
See also comments here:
https://github.com/mesonbuild/meson/issues/553
Summary: dependency('threads') meaning is vague on Windows.
As a exotic case, I'm using NixOS which provides MinGW-w64 built with
mcfgthread (https://github.com/lhmouse/mcfgthread) and it doesn't even
recognize -pthread compiler flag, so this patch breaks cross-build for me.
> I'd still advocate for:
>
> if not is_windows
> threads_dep = dependency('threads')
> endif
It's more like, in lib/librte_telemetry/meson.build:
if not is_windows
ext_deps += threads_dep
endif
Gabriel, by the way, why is it needed for librte_metrics?
Isn't librte_telemetry enough since it's a dependency to EAL?
More information about the dev
mailing list