[dpdk-dev] [PATCH v2] build: skip detecting libpcap via pcap-config

David Marchand david.marchand at redhat.com
Mon Oct 12 14:02:19 CEST 2020


On Fri, Oct 9, 2020 at 4:19 PM Bruce Richardson
<bruce.richardson at intel.com> wrote:
>
> When compiling for a slightly different architecture, e.g. 32-bit on 64-bit
> systems using CFLAGS rather than a cross-file, the pcap-config utility can
> often return parameters that are unusable for the build in question, i.e.
> providing the native 64-bit library paths rather than checking for 32-bit
> equivalent.
>
> Since many distros now include a version of libpcap with a
> pkg-config file, and for those that don't find-library should work ok as a
> fallback, we can explicitly just use pkg-config in the dependency search,
> causing meson to skip trying to use pcap-config.
>
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>

I also hit (this?) issue on a fc32 with both 32-bit and 64-bit pcap installed.
Can you confirm?

If so, we might want to backport this as I get the same problem with v19.11.4.


# rpm -q libpcap
libpcap-1.9.1-3.fc32.x86_64
libpcap-1.9.1-3.fc32.i686
# rpm -q meson
meson-0.55.3-1.fc32.noarch

# meson --reconfigure build
The Meson build system
Version: 0.55.3
Source dir: /root/dpdk
Build dir: /root/dpdk/build
Build type: native build
Program cat found: YES
Project name: DPDK
Project version: 20.11.0-rc0
C compiler for the host machine: cc (gcc 10.2.1 "cc (GCC) 10.2.1
20200723 (Red Hat 10.2.1-1)")
C linker for the host machine: cc ld.bfd 2.34-5
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program pkg-config found: YES
Program gen-pmdinfo-cfile.sh found: YES
Program list-dir-globs.py found: YES
Program check-symbols.sh found: YES
Program options-ibverbs-static.sh found: YES
Program binutils-avx512-check.sh found: YES
Program python3 found: YES (/usr/bin/python3)
Program cat found: YES
Program ../buildtools/symlink-drivers-solibs.sh found: YES (/bin/sh
/root/dpdk/config/../buildtools/symlink-drivers-solibs.sh)
Checking for size of "void *" : 8
Library m found: YES
Library numa found: NO
Library libfdt found: NO
Found pkg-config: /usr/bin/pkg-config (1.6.3)
Found CMake: /usr/bin/cmake (3.17.4)
Run-time dependency libbsd found: NO (tried pkgconfig and cmake)
pcap-config found: YES (/usr/bin/pcap-config)

config/meson.build:166:0: ERROR: Could not get return value of
pcap_lib_version()

A full log can be found at /root/dpdk/build/meson-logs/meson-log.txt


# cat /root/dpdk/build/meson-logs/meson-log.txt
[...]
Determining dependency 'libpcap' with pkg-config executable
'/usr/bin/pkg-config'
PKG_CONFIG_PATH:
Called `/usr/bin/pkg-config --modversion libpcap` -> 1

pcap-config binary missing from cross or native file, or env var undefined.
Trying a default pcap-config fallback at pcap-config
pcap-config found: YES (/usr/bin/pcap-config)
None of 'CC_LD' are defined in the environment, not changing global flags.
Running compile:
Working directory:  /root/dpdk/build/meson-private/tmp15ks2yx6
Command line:  cc
/root/dpdk/build/meson-private/tmp15ks2yx6/testfile.c -o
/root/dpdk/build/meson-private/tmp15ks2yx6/output.exe -pipe
-D_FILE_OFFSET_BITS=64 -O0 -Wl,--start-group -lpcap -Wl,--end-group

Code:
 #include <pcap.h>
        #include <stdio.h>
        int main(void) {
            printf ("%s", (char*) pcap_lib_version());
            return 0;
        }
Compiler stdout:

Compiler stderr:
 /usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-redhat-linux/10/../../../libpcap.so when searching
for -lpcap
/usr/bin/ld: skipping incompatible /lib/libpcap.so when searching for -lpcap
/usr/bin/ld: skipping incompatible /usr/lib/libpcap.so when searching for -lpcap
/usr/bin/ld: cannot find -lpcap
collect2: error: ld returned 1 exit status

Could not compile test file
/root/dpdk/build/meson-private/tmp15ks2yx6/testfile.c: 1


config/meson.build:166:0: ERROR: Could not get return value of
pcap_lib_version()



-- 
David Marchand



More information about the dev mailing list