[v6,2/5] build: use dependency() instead of find_library()
Checks
Commit Message
Whenever possible (if the library ships a pkg-config file) use meson's
dependency() function to look for it, as it will automatically add it
to the Requires.private list if needed, to allow for static builds to
succeed for reverse dependencies of DPDK. Otherwise the recursive
dependencies are not parsed, and users doing static builds have to
resolve them manually by themselves.
When using this API avoid additional checks that are superfluous and
take extra time, and avoid adding the linker flag manually which causes
it to be duplicated.
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
v2: split libbsd change in a separate commit, remove CC to stable
as a meson bump will be required
v4: update comment in drivers/meson.build to clarify role of
pkgconfig_extra_libs
v5: remove -lz from drivers/compress/zlib
drivers/compress/zlib/meson.build | 1 -
drivers/crypto/ccp/meson.build | 1 -
drivers/crypto/openssl/meson.build | 1 -
drivers/crypto/qat/meson.build | 1 -
drivers/meson.build | 9 +++++----
drivers/net/bnx2x/meson.build | 2 +-
drivers/net/mlx4/meson.build | 6 +++---
drivers/net/mlx5/meson.build | 6 +++---
drivers/net/pcap/meson.build | 5 ++---
lib/librte_bpf/meson.build | 4 ++--
lib/librte_telemetry/meson.build | 2 +-
11 files changed, 17 insertions(+), 21 deletions(-)
Comments
06/02/2019 18:08, Luca Boccassi:
> Whenever possible (if the library ships a pkg-config file) use meson's
> dependency() function to look for it, as it will automatically add it
> to the Requires.private list if needed, to allow for static builds to
> succeed for reverse dependencies of DPDK. Otherwise the recursive
> dependencies are not parsed, and users doing static builds have to
> resolve them manually by themselves.
> When using this API avoid additional checks that are superfluous and
> take extra time, and avoid adding the linker flag manually which causes
> it to be duplicated.
>
> Signed-off-by: Luca Boccassi <bluca@debian.org>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
This patch breaks compilation on my machine with a lot of strange errors:
from drivers/net/pcap/rte_eth_pcap.c
/usr/include/stdint.h:109: error: "__INT64_C" redefined
/usr/include/bits/stdlib-bsearch.h:32:13: error: cast discards 'const' qualifier from pointer target type
/usr/include/pthread.h:682:6: error: 'regparm' attribute directive ignored
etc
On Tue, Feb 12, 2019 at 12:15:43PM +0100, Thomas Monjalon wrote:
> 06/02/2019 18:08, Luca Boccassi:
> > Whenever possible (if the library ships a pkg-config file) use meson's
> > dependency() function to look for it, as it will automatically add it
> > to the Requires.private list if needed, to allow for static builds to
> > succeed for reverse dependencies of DPDK. Otherwise the recursive
> > dependencies are not parsed, and users doing static builds have to
> > resolve them manually by themselves.
> > When using this API avoid additional checks that are superfluous and
> > take extra time, and avoid adding the linker flag manually which causes
> > it to be duplicated.
> >
> > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
>
> This patch breaks compilation on my machine with a lot of strange errors:
>
> from drivers/net/pcap/rte_eth_pcap.c
>
> /usr/include/stdint.h:109: error: "__INT64_C" redefined
> /usr/include/bits/stdlib-bsearch.h:32:13: error: cast discards 'const' qualifier from pointer target type
> /usr/include/pthread.h:682:6: error: 'regparm' attribute directive ignored
> etc
>
Is this on Arch linux again? I just reverified these first two patches and
they work fine for me on Fedora (I assume Luca probably tested them already on
Debian)
Anything unusual about your setup?
/Bruce
12/02/2019 12:31, Bruce Richardson:
> On Tue, Feb 12, 2019 at 12:15:43PM +0100, Thomas Monjalon wrote:
> > 06/02/2019 18:08, Luca Boccassi:
> > > Whenever possible (if the library ships a pkg-config file) use meson's
> > > dependency() function to look for it, as it will automatically add it
> > > to the Requires.private list if needed, to allow for static builds to
> > > succeed for reverse dependencies of DPDK. Otherwise the recursive
> > > dependencies are not parsed, and users doing static builds have to
> > > resolve them manually by themselves.
> > > When using this API avoid additional checks that are superfluous and
> > > take extra time, and avoid adding the linker flag manually which causes
> > > it to be duplicated.
> > >
> > > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> >
> > This patch breaks compilation on my machine with a lot of strange errors:
> >
> > from drivers/net/pcap/rte_eth_pcap.c
> >
> > /usr/include/stdint.h:109: error: "__INT64_C" redefined
> > /usr/include/bits/stdlib-bsearch.h:32:13: error: cast discards 'const' qualifier from pointer target type
> > /usr/include/pthread.h:682:6: error: 'regparm' attribute directive ignored
> > etc
> >
> Is this on Arch linux again? I just reverified these first two patches and
> they work fine for me on Fedora (I assume Luca probably tested them already on
> Debian)
>
> Anything unusual about your setup?
Nothing unusual. Just using the best environment ever ;)
I will try to debug it.
On Tue, Feb 12, 2019 at 12:36:17PM +0100, Thomas Monjalon wrote:
> 12/02/2019 12:31, Bruce Richardson:
> > On Tue, Feb 12, 2019 at 12:15:43PM +0100, Thomas Monjalon wrote:
> > > 06/02/2019 18:08, Luca Boccassi:
> > > > Whenever possible (if the library ships a pkg-config file) use meson's
> > > > dependency() function to look for it, as it will automatically add it
> > > > to the Requires.private list if needed, to allow for static builds to
> > > > succeed for reverse dependencies of DPDK. Otherwise the recursive
> > > > dependencies are not parsed, and users doing static builds have to
> > > > resolve them manually by themselves.
> > > > When using this API avoid additional checks that are superfluous and
> > > > take extra time, and avoid adding the linker flag manually which causes
> > > > it to be duplicated.
> > > >
> > > > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > >
> > > This patch breaks compilation on my machine with a lot of strange errors:
> > >
> > > from drivers/net/pcap/rte_eth_pcap.c
> > >
> > > /usr/include/stdint.h:109: error: "__INT64_C" redefined
> > > /usr/include/bits/stdlib-bsearch.h:32:13: error: cast discards 'const' qualifier from pointer target type
> > > /usr/include/pthread.h:682:6: error: 'regparm' attribute directive ignored
> > > etc
> > >
> > Is this on Arch linux again? I just reverified these first two patches and
> > they work fine for me on Fedora (I assume Luca probably tested them already on
> > Debian)
> >
> > Anything unusual about your setup?
>
> Nothing unusual. Just using the best environment ever ;)
> I will try to debug it.
>
It may be something pcap-specific, since pcap has to have it's own special
query mechanims outside the normal pkg-config one. If you remove the
pcap-driver changes, does the rest of the patch work for you?
/Bruce
12/02/2019 12:43, Bruce Richardson:
> On Tue, Feb 12, 2019 at 12:36:17PM +0100, Thomas Monjalon wrote:
> > 12/02/2019 12:31, Bruce Richardson:
> > > On Tue, Feb 12, 2019 at 12:15:43PM +0100, Thomas Monjalon wrote:
> > > > 06/02/2019 18:08, Luca Boccassi:
> > > > > Whenever possible (if the library ships a pkg-config file) use meson's
> > > > > dependency() function to look for it, as it will automatically add it
> > > > > to the Requires.private list if needed, to allow for static builds to
> > > > > succeed for reverse dependencies of DPDK. Otherwise the recursive
> > > > > dependencies are not parsed, and users doing static builds have to
> > > > > resolve them manually by themselves.
> > > > > When using this API avoid additional checks that are superfluous and
> > > > > take extra time, and avoid adding the linker flag manually which causes
> > > > > it to be duplicated.
> > > > >
> > > > > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > >
> > > > This patch breaks compilation on my machine with a lot of strange errors:
> > > >
> > > > from drivers/net/pcap/rte_eth_pcap.c
> > > >
> > > > /usr/include/stdint.h:109: error: "__INT64_C" redefined
> > > > /usr/include/bits/stdlib-bsearch.h:32:13: error: cast discards 'const' qualifier from pointer target type
> > > > /usr/include/pthread.h:682:6: error: 'regparm' attribute directive ignored
> > > > etc
> > > >
> > > Is this on Arch linux again? I just reverified these first two patches and
> > > they work fine for me on Fedora (I assume Luca probably tested them already on
> > > Debian)
> > >
> > > Anything unusual about your setup?
> >
> > Nothing unusual. Just using the best environment ever ;)
> > I will try to debug it.
> >
> It may be something pcap-specific, since pcap has to have it's own special
> query mechanims outside the normal pkg-config one. If you remove the
> pcap-driver changes, does the rest of the patch work for you?
Yes, the issue happens only with pcap on Arm.
Reverting the pcap related changes, it builds fine.
More infos about my setup:
meson-0.49.1
aarch64-linux-gnu-gcc-8.2.0
libpcap-1.9.0 (32 and 64-bit) for x86
I think there is a mix between libcap for x86 and Arm compilation.
Probably a meson bug?
On Tue, Feb 12, 2019 at 03:47:56PM +0100, Thomas Monjalon wrote:
> 12/02/2019 12:43, Bruce Richardson:
> > On Tue, Feb 12, 2019 at 12:36:17PM +0100, Thomas Monjalon wrote:
> > > 12/02/2019 12:31, Bruce Richardson:
> > > > On Tue, Feb 12, 2019 at 12:15:43PM +0100, Thomas Monjalon wrote:
> > > > > 06/02/2019 18:08, Luca Boccassi:
> > > > > > Whenever possible (if the library ships a pkg-config file) use meson's
> > > > > > dependency() function to look for it, as it will automatically add it
> > > > > > to the Requires.private list if needed, to allow for static builds to
> > > > > > succeed for reverse dependencies of DPDK. Otherwise the recursive
> > > > > > dependencies are not parsed, and users doing static builds have to
> > > > > > resolve them manually by themselves.
> > > > > > When using this API avoid additional checks that are superfluous and
> > > > > > take extra time, and avoid adding the linker flag manually which causes
> > > > > > it to be duplicated.
> > > > > >
> > > > > > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > > > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > > >
> > > > > This patch breaks compilation on my machine with a lot of strange errors:
> > > > >
> > > > > from drivers/net/pcap/rte_eth_pcap.c
> > > > >
> > > > > /usr/include/stdint.h:109: error: "__INT64_C" redefined
> > > > > /usr/include/bits/stdlib-bsearch.h:32:13: error: cast discards 'const' qualifier from pointer target type
> > > > > /usr/include/pthread.h:682:6: error: 'regparm' attribute directive ignored
> > > > > etc
> > > > >
> > > > Is this on Arch linux again? I just reverified these first two patches and
> > > > they work fine for me on Fedora (I assume Luca probably tested them already on
> > > > Debian)
> > > >
> > > > Anything unusual about your setup?
> > >
> > > Nothing unusual. Just using the best environment ever ;)
> > > I will try to debug it.
> > >
> > It may be something pcap-specific, since pcap has to have it's own special
> > query mechanims outside the normal pkg-config one. If you remove the
> > pcap-driver changes, does the rest of the patch work for you?
>
> Yes, the issue happens only with pcap on Arm.
> Reverting the pcap related changes, it builds fine.
>
> More infos about my setup:
> meson-0.49.1
> aarch64-linux-gnu-gcc-8.2.0
> libpcap-1.9.0 (32 and 64-bit) for x86
>
> I think there is a mix between libcap for x86 and Arm compilation.
> Probably a meson bug?
>
Could well be a meson issue. It may be using the local pcap-config rather
than the cross-compilation version [assuming cross-compilation here, though
I don't see the issue with my setup].
Thomas, can you apply this set with the pcap driver change dropped,
or is it better if Luca does a new version of this set?
/Bruce
12/02/2019 16:03, Bruce Richardson:
> On Tue, Feb 12, 2019 at 03:47:56PM +0100, Thomas Monjalon wrote:
> > 12/02/2019 12:43, Bruce Richardson:
> > > On Tue, Feb 12, 2019 at 12:36:17PM +0100, Thomas Monjalon wrote:
> > > > 12/02/2019 12:31, Bruce Richardson:
> > > > > On Tue, Feb 12, 2019 at 12:15:43PM +0100, Thomas Monjalon wrote:
> > > > > > 06/02/2019 18:08, Luca Boccassi:
> > > > > > > Whenever possible (if the library ships a pkg-config file) use meson's
> > > > > > > dependency() function to look for it, as it will automatically add it
> > > > > > > to the Requires.private list if needed, to allow for static builds to
> > > > > > > succeed for reverse dependencies of DPDK. Otherwise the recursive
> > > > > > > dependencies are not parsed, and users doing static builds have to
> > > > > > > resolve them manually by themselves.
> > > > > > > When using this API avoid additional checks that are superfluous and
> > > > > > > take extra time, and avoid adding the linker flag manually which causes
> > > > > > > it to be duplicated.
> > > > > > >
> > > > > > > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > > > > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > > > >
> > > > > > This patch breaks compilation on my machine with a lot of strange errors:
> > > > > >
> > > > > > from drivers/net/pcap/rte_eth_pcap.c
> > > > > >
> > > > > > /usr/include/stdint.h:109: error: "__INT64_C" redefined
> > > > > > /usr/include/bits/stdlib-bsearch.h:32:13: error: cast discards 'const' qualifier from pointer target type
> > > > > > /usr/include/pthread.h:682:6: error: 'regparm' attribute directive ignored
> > > > > > etc
> > > > > >
> > > > > Is this on Arch linux again? I just reverified these first two patches and
> > > > > they work fine for me on Fedora (I assume Luca probably tested them already on
> > > > > Debian)
> > > > >
> > > > > Anything unusual about your setup?
> > > >
> > > > Nothing unusual. Just using the best environment ever ;)
> > > > I will try to debug it.
> > > >
> > > It may be something pcap-specific, since pcap has to have it's own special
> > > query mechanims outside the normal pkg-config one. If you remove the
> > > pcap-driver changes, does the rest of the patch work for you?
> >
> > Yes, the issue happens only with pcap on Arm.
> > Reverting the pcap related changes, it builds fine.
> >
> > More infos about my setup:
> > meson-0.49.1
> > aarch64-linux-gnu-gcc-8.2.0
> > libpcap-1.9.0 (32 and 64-bit) for x86
> >
> > I think there is a mix between libcap for x86 and Arm compilation.
> > Probably a meson bug?
> >
> Could well be a meson issue. It may be using the local pcap-config rather
> than the cross-compilation version [assuming cross-compilation here, though
> I don't see the issue with my setup].
>
> Thomas, can you apply this set with the pcap driver change dropped,
> or is it better if Luca does a new version of this set?
I think we need a comment about the pcap miss.
Probably better to do a new version.
Luca, please could you test cross-compilation?
On Tue, 2019-02-12 at 17:21 +0100, Thomas Monjalon wrote:
> 12/02/2019 16:03, Bruce Richardson:
> > On Tue, Feb 12, 2019 at 03:47:56PM +0100, Thomas Monjalon wrote:
> > > 12/02/2019 12:43, Bruce Richardson:
> > > > On Tue, Feb 12, 2019 at 12:36:17PM +0100, Thomas Monjalon
> > > > wrote:
> > > > > 12/02/2019 12:31, Bruce Richardson:
> > > > > > On Tue, Feb 12, 2019 at 12:15:43PM +0100, Thomas Monjalon
> > > > > > wrote:
> > > > > > > 06/02/2019 18:08, Luca Boccassi:
> > > > > > > > Whenever possible (if the library ships a pkg-config
> > > > > > > > file) use meson's
> > > > > > > > dependency() function to look for it, as it will
> > > > > > > > automatically add it
> > > > > > > > to the Requires.private list if needed, to allow for
> > > > > > > > static builds to
> > > > > > > > succeed for reverse dependencies of DPDK. Otherwise the
> > > > > > > > recursive
> > > > > > > > dependencies are not parsed, and users doing static
> > > > > > > > builds have to
> > > > > > > > resolve them manually by themselves.
> > > > > > > > When using this API avoid additional checks that are
> > > > > > > > superfluous and
> > > > > > > > take extra time, and avoid adding the linker flag
> > > > > > > > manually which causes
> > > > > > > > it to be duplicated.
> > > > > > > >
> > > > > > > > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > > > > > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > > > > >
> > > > > > > This patch breaks compilation on my machine with a lot of
> > > > > > > strange errors:
> > > > > > >
> > > > > > > from drivers/net/pcap/rte_eth_pcap.c
> > > > > > >
> > > > > > > /usr/include/stdint.h:109: error: "__INT64_C" redefined
> > > > > > > /usr/include/bits/stdlib-bsearch.h:32:13: error: cast
> > > > > > > discards 'const' qualifier from pointer target type
> > > > > > > /usr/include/pthread.h:682:6: error: 'regparm' attribute
> > > > > > > directive ignored
> > > > > > > etc
> > > > > > >
> > > > > >
> > > > > > Is this on Arch linux again? I just reverified these first
> > > > > > two patches and
> > > > > > they work fine for me on Fedora (I assume Luca probably
> > > > > > tested them already on
> > > > > > Debian)
> > > > > >
> > > > > > Anything unusual about your setup?
> > > > >
> > > > > Nothing unusual. Just using the best environment ever ;)
> > > > > I will try to debug it.
> > > > >
> > > >
> > > > It may be something pcap-specific, since pcap has to have it's
> > > > own special
> > > > query mechanims outside the normal pkg-config one. If you
> > > > remove the
> > > > pcap-driver changes, does the rest of the patch work for you?
> > >
> > > Yes, the issue happens only with pcap on Arm.
> > > Reverting the pcap related changes, it builds fine.
> > >
> > > More infos about my setup:
> > > meson-0.49.1
> > > aarch64-linux-gnu-gcc-8.2.0
> > > libpcap-1.9.0 (32 and 64-bit) for x86
> > >
> > > I think there is a mix between libcap for x86 and Arm
> > > compilation.
> > > Probably a meson bug?
> > >
> >
> > Could well be a meson issue. It may be using the local pcap-config
> > rather
> > than the cross-compilation version [assuming cross-compilation
> > here, though
> > I don't see the issue with my setup].
> >
> > Thomas, can you apply this set with the pcap driver change dropped,
> > or is it better if Luca does a new version of this set?
>
> I think we need a comment about the pcap miss.
> Probably better to do a new version.
>
> Luca, please could you test cross-compilation?
Hi,
I would, except downloading the toolchain from Linaro fails with 403
forbidden...
https://releases.linaro.org/components/toolchain/binaries/latest/aarch64-linux-gnu/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu.tar.xz
I'll try with Debian's cross compiler
13/02/2019 11:49, Luca Boccassi:
> On Tue, 2019-02-12 at 17:21 +0100, Thomas Monjalon wrote:
> > Luca, please could you test cross-compilation?
>
> Hi,
>
> I would, except downloading the toolchain from Linaro fails with 403
> forbidden...
>
> https://releases.linaro.org/components/toolchain/binaries/latest/aarch64-linux-gnu/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu.tar.xz
>
> I'll try with Debian's cross compiler
You can also test this one: https://toolchains.bootlin.com/
On Wed, 2019-02-13 at 10:49 +0000, Luca Boccassi wrote:
> On Tue, 2019-02-12 at 17:21 +0100, Thomas Monjalon wrote:
> > 12/02/2019 16:03, Bruce Richardson:
> > > On Tue, Feb 12, 2019 at 03:47:56PM +0100, Thomas Monjalon wrote:
> > > > 12/02/2019 12:43, Bruce Richardson:
> > > > > On Tue, Feb 12, 2019 at 12:36:17PM +0100, Thomas Monjalon
> > > > > wrote:
> > > > > > 12/02/2019 12:31, Bruce Richardson:
> > > > > > > On Tue, Feb 12, 2019 at 12:15:43PM +0100, Thomas Monjalon
> > > > > > > wrote:
> > > > > > > > 06/02/2019 18:08, Luca Boccassi:
> > > > > > > > > Whenever possible (if the library ships a pkg-config
> > > > > > > > > file) use meson's
> > > > > > > > > dependency() function to look for it, as it will
> > > > > > > > > automatically add it
> > > > > > > > > to the Requires.private list if needed, to allow for
> > > > > > > > > static builds to
> > > > > > > > > succeed for reverse dependencies of DPDK. Otherwise
> > > > > > > > > the
> > > > > > > > > recursive
> > > > > > > > > dependencies are not parsed, and users doing static
> > > > > > > > > builds have to
> > > > > > > > > resolve them manually by themselves.
> > > > > > > > > When using this API avoid additional checks that are
> > > > > > > > > superfluous and
> > > > > > > > > take extra time, and avoid adding the linker flag
> > > > > > > > > manually which causes
> > > > > > > > > it to be duplicated.
> > > > > > > > >
> > > > > > > > > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > > > > > > > > Acked-by: Bruce Richardson <bruce.richardson@intel.co
> > > > > > > > > m>
> > > > > > > >
> > > > > > > > This patch breaks compilation on my machine with a lot
> > > > > > > > of
> > > > > > > > strange errors:
> > > > > > > >
> > > > > > > > from drivers/net/pcap/rte_eth_pcap.c
> > > > > > > >
> > > > > > > > /usr/include/stdint.h:109: error: "__INT64_C" redefined
> > > > > > > > /usr/include/bits/stdlib-bsearch.h:32:13: error: cast
> > > > > > > > discards 'const' qualifier from pointer target type
> > > > > > > > /usr/include/pthread.h:682:6: error: 'regparm'
> > > > > > > > attribute
> > > > > > > > directive ignored
> > > > > > > > etc
> > > > > > > >
> > > > > > >
> > > > > > > Is this on Arch linux again? I just reverified these
> > > > > > > first
> > > > > > > two patches and
> > > > > > > they work fine for me on Fedora (I assume Luca probably
> > > > > > > tested them already on
> > > > > > > Debian)
> > > > > > >
> > > > > > > Anything unusual about your setup?
> > > > > >
> > > > > > Nothing unusual. Just using the best environment ever ;)
> > > > > > I will try to debug it.
> > > > > >
> > > > >
> > > > > It may be something pcap-specific, since pcap has to have
> > > > > it's
> > > > > own special
> > > > > query mechanims outside the normal pkg-config one. If you
> > > > > remove the
> > > > > pcap-driver changes, does the rest of the patch work for you?
> > > >
> > > > Yes, the issue happens only with pcap on Arm.
> > > > Reverting the pcap related changes, it builds fine.
> > > >
> > > > More infos about my setup:
> > > > meson-0.49.1
> > > > aarch64-linux-gnu-gcc-8.2.0
> > > > libpcap-1.9.0 (32 and 64-bit) for x86
> > > >
> > > > I think there is a mix between libcap for x86 and Arm
> > > > compilation.
> > > > Probably a meson bug?
> > > >
> > >
> > > Could well be a meson issue. It may be using the local pcap-
> > > config
> > > rather
> > > than the cross-compilation version [assuming cross-compilation
> > > here, though
> > > I don't see the issue with my setup].
> > >
> > > Thomas, can you apply this set with the pcap driver change
> > > dropped,
> > > or is it better if Luca does a new version of this set?
> >
> > I think we need a comment about the pcap miss.
> > Probably better to do a new version.
> >
> > Luca, please could you test cross-compilation?
>
> Hi,
>
> I would, except downloading the toolchain from Linaro fails with 403
> forbidden...
>
> https://releases.linaro.org/components/toolchain/binaries/latest/aarc
> h64-linux-gnu/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-
> gnu.tar.xz
>
> I'll try with Debian's cross compiler
I think the issue is that I'm going in circles:
https://git.dpdk.org/dpdk/commit/?id=d1e4a5b7320905f025e7caea685708b5eea37456
https://git.dpdk.org/dpdk/commit/?id=6930c0403a1754eb5cab89577565eefa5a9995a1
As Bruce said, the root cause is libpcap's lack of a pkg-config file
and usage of a custom tool, which is a known bane for cross compilers.
The good news is that 1.9.0 finally added a pkg-config file in
addition:
https://github.com/the-tcpdump-group/libpcap/commit/a7deb6a241f8c71ca261adc45ac07c8427074792
Given cross-compilation doesn't work at all for me, I'll do a v7 without that snippet.
On Wed, 2019-02-13 at 12:10 +0100, Thomas Monjalon wrote:
> 13/02/2019 11:49, Luca Boccassi:
> > On Tue, 2019-02-12 at 17:21 +0100, Thomas Monjalon wrote:
> > > Luca, please could you test cross-compilation?
> >
> > Hi,
> >
> > I would, except downloading the toolchain from Linaro fails with
> > 403
> > forbidden...
> >
> > https://releases.linaro.org/components/toolchain/binaries/latest/aa
> > rch64-linux-gnu/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-
> > gnu.tar.xz
> >
> > I'll try with Debian's cross compiler
>
> You can also test this one: https://toolchains.bootlin.com/
That one works - the pcap-config issue can be patched over by setting
pcap-config = '' in the cross-build config files in config/arm/ - but
the dependency finder needs to fallback to find_library. This series
has seen enough revisions already and it's not a critical path, so I'll
do it separately another time.
@@ -9,6 +9,5 @@ endif
deps += 'bus_vdev'
sources = files('zlib_pmd.c', 'zlib_pmd_ops.c')
ext_deps += dep
-pkgconfig_extra_libs += '-lz'
allow_experimental_apis = true
@@ -18,4 +18,3 @@ sources = files('rte_ccp_pmd.c',
'ccp_pmd_ops.c')
ext_deps += dep
-pkgconfig_extra_libs += '-lcrypto'
@@ -9,4 +9,3 @@ allow_experimental_apis = true
deps += 'bus_vdev'
sources = files('rte_openssl_pmd.c', 'rte_openssl_pmd_ops.c')
ext_deps += dep
-pkgconfig_extra_libs += '-lcrypto'
@@ -13,6 +13,5 @@ if dep.found()
'qat_sym.c',
'qat_sym_session.c')
qat_ext_deps += dep
- pkgconfig_extra_libs += '-lcrypto'
qat_cflags += '-DBUILD_QAT_SYM'
endif
@@ -46,10 +46,11 @@ foreach class:driver_classes
# set up internal deps. Drivers can append/override as necessary
deps = std_deps
# ext_deps: Stores external library dependency got
- # using dependency() or cc.find_library(). For most cases, we
- # probably also need to specify the "-l" flags in
- # pkgconfig_extra_libs variable too, so that it can be reflected
- # in the pkgconfig output for static builds
+ # using dependency() (preferred) or find_library().
+ # For the find_library() case (but not with dependency()) we also
+ # need to specify the "-l" flags in pkgconfig_extra_libs variable
+ # too, so that it can be reflected in the pkgconfig output for
+ # static builds.
ext_deps = []
pkgconfig_extra_libs = []
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2018 Intel Corporation
-dep = cc.find_library('z', required: false)
+dep = dependency('zlib', required: false)
build = dep.found()
ext_deps += dep
cflags += '-DZLIB_CONST'
@@ -14,9 +14,9 @@ if pmd_dlopen
]
endif
libs = [
- cc.find_library('mnl', required:false),
- cc.find_library('mlx4', required:false),
- cc.find_library('ibverbs', required:false),
+ dependency('libmnl', required:false),
+ dependency('libmlx4', required:false),
+ dependency('libibverbs', required:false),
]
build = true
foreach lib:libs
@@ -14,9 +14,9 @@ if pmd_dlopen
]
endif
libs = [
- cc.find_library('mnl', required:false),
- cc.find_library('mlx5', required:false),
- cc.find_library('ibverbs', required:false),
+ dependency('libmnl', required:false),
+ dependency('libmlx5', required:false),
+ dependency('libibverbs', required:false),
]
build = true
foreach lib:libs
@@ -1,12 +1,11 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation
-pcap_dep = cc.find_library('pcap', required: false)
-if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)
+pcap_dep = dependency('pcap', required: false)
+if pcap_dep.found()
build = true
else
build = false
endif
sources = files('rte_eth_pcap.c')
ext_deps += pcap_dep
-pkgconfig_extra_libs += '-lpcap'
@@ -18,8 +18,8 @@ install_headers = files('bpf_def.h',
deps += ['mbuf', 'net', 'ethdev']
-dep = cc.find_library('elf', required: false)
-if dep.found() == true and cc.has_header('libelf.h', dependencies: dep)
+dep = dependency('libelf', required: false)
+if dep.found()
sources += files('bpf_load_elf.c')
ext_deps += dep
endif
@@ -6,7 +6,7 @@ headers = files('rte_telemetry.h', 'rte_telemetry_internal.h', 'rte_telemetry_pa
deps += ['metrics', 'ethdev']
cflags += '-DALLOW_EXPERIMENTAL_API'
-jansson = cc.find_library('jansson', required: false)
+jansson = dependency('jansson', required: false)
if jansson.found()
ext_deps += jansson
dpdk_app_link_libraries += ['telemetry']