tcpdump mailing list archives

Re: build failures on Solaris


From: Denis Ovsienko via tcpdump-workers <tcpdump-workers () lists tcpdump org>
Date: Wed, 29 Sep 2021 18:05:09 +0100

--- Begin Message --- From: Denis Ovsienko <denis () ovsienko info>
Date: Wed, 29 Sep 2021 18:05:09 +0100
On Sun, 1 Aug 2021 19:19:14 -0700
Guy Harris <gharris () sonic net> wrote:

At this point, I'm seeing two problems:

1) The pcap-config and libpcap.pc that we generate always include a
-L flag, even if the directory is a system include directory, which
means that it could be wrong in a system with 32-bit and 64-bit
libraries in separate directories.  Debian removes that from
pcap-config to avoid that problem.  We shouldn't add -L in that case.

2) Tcpdump needs to work around that when configuring.

The first is definitely our bug, given that Debian is working around
it.

The second would be helpful; we already work around Apple screwing up
pcap-config by having the one they ship with macOS include
-L/usr/local/lib for no good reason.

For posterity, trying to CI the tcpdump-4.99 branch on illumos-amd64
made it apparent that the same problem used to apply to illumos:

ld: fatal: file /usr/lib/libpcap.so: wrong ELF class: ELFCLASS32

$ find /usr/ -name pcap-config
/usr/bin/pcap-config
/usr/bin/amd64/pcap-config

$ /usr/bin/pcap-config --libs
-L/usr/lib  -lpcap

$ /usr/bin/amd64/pcap-config --libs
-L/usr/lib/amd64 -Wl,-R,/usr/lib/amd64 -lpcap

This broke a number of tests, such as:
-- Looking for pcap_open
-- Looking for pcap_open - not found

Consequently, several HAVE_xxxxx macros were erroneously unset, so
tcpdump compiled its own substitute pcap_xxxxx functions and eventually
clashed trying to link with libpcap.

Cherry-picking a series of intertwined build system fixes from the
master branch, including commit c39d40a ("On Solaris, for 64-bit
builds, use the 64-bit pcap-config."), was sufficient to fix this.

-- 
    Denis Ovsienko

--- End Message ---
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers () lists tcpdump org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers

Current thread: