the-tcpdump-group / tcpdump

the TCPdump network dissector
https://www.tcpdump.org/
Other
2.73k stars 852 forks source link

autotools, cmake: work around an Xcode 15+ issue. #1195

Closed guyharris closed 4 months ago

guyharris commented 4 months ago

There appears to be no way to build tcpdump on macOS Ventura with Xcode 15 with the system libpcap and have the resulting program run without getting an error due to failing to find pcap_open() or pcap_findalldevs_ex() at startup.

In particular, there appears to be no way to use __builtin_available() to protect accesses to the routines that showed up in Sonoma, so that the run-time linker doesn't fail if the routine in question isn't present. Perhaps it requires more compiler command-line arguments.

So, instead, only check for pcap_open() and pcap_findalldevs_ex() if 1) this isn't macOS or 2) we're not building with the system libpcap.