the-tcpdump-group / libpcap

the LIBpcap interface to various kernel packet capture mechanism
https://www.tcpdump.org/
Other
2.65k stars 843 forks source link

don't know how to make bpf_filter.c (prerequisite of: bpf_filter.o) #724

Closed jungle-boogie closed 6 years ago

jungle-boogie commented 6 years ago

Hi All,

OpenBSD -current via snapsot and I cannot successfully build libpcap. tcpdump and libpcap git repos reside in ~/bin/. tcpdump has no issues building, but libpcap fails here:

./fmtutils.c
gcc -std=gnu99 -fvisibility=hidden -fpic -I.  -I/usr/local/include -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -DBUILDING_PCAP -Dpcap_EXPORTS -DHAVE_CONFIG_H  -g -O2    -c ./savefile.c
gcc -std=gnu99 -fvisibility=hidden -fpic -I.  -I/usr/local/include -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -DBUILDING_PCAP -Dpcap_EXPORTS -DHAVE_CONFIG_H  -g -O2    -c ./sf-pcap.c
gcc -std=gnu99 -fvisibility=hidden -fpic -I.  -I/usr/local/include -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -DBUILDING_PCAP -Dpcap_EXPORTS -DHAVE_CONFIG_H  -g -O2    -c ./sf-pcapng.c
gcc -std=gnu99 -fvisibility=hidden -fpic -I.  -I/usr/local/include -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -DBUILDING_PCAP -Dpcap_EXPORTS -DHAVE_CONFIG_H  -g -O2    -c ./pcap-common.c
gcc -std=gnu99 -fvisibility=hidden -fpic -I.  -I/usr/local/include -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -DBUILDING_PCAP -Dpcap_EXPORTS -DHAVE_CONFIG_H  -g -O2    -c ./bpf_image.c
make: don't know how to make bpf_filter.c (prerequisite of: bpf_filter.o)
Stop in /home/jungle/bin/libpcap
jungle-boogie commented 6 years ago
 /usr/local/sbin/tcpdump --version
tcpdump version 4.10.0-PRE-GIT
libpcap version 1.9.0-PRE-GIT
LibreSSL 2.8.0
jungle-boogie commented 6 years ago

No special configure or build flags were specified.

$ ./configure
checking build system type... x86_64-unknown-openbsd6.3
checking host system type... x86_64-unknown-openbsd6.3
checking target system type... x86_64-unknown-openbsd6.3
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gcc option to accept ISO C99... -std=gnu99
checking whether the compiler supports the -fvisibility=hidden option... yes
checking for inline... inline
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/ioccom.h usability... yes
checking sys/ioccom.h presence... yes
checking for sys/ioccom.h... yes
checking sys/sockio.h usability... yes
checking sys/sockio.h presence... yes
checking for sys/sockio.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking netpacket/packet.h usability... no
checking netpacket/packet.h presence... no
checking for netpacket/packet.h... no
checking for net/pfvar.h... yes
checking whether net/pfvar.h defines PF_NAT through PF_NORDR... yes
checking for ANSI ioctl definitions... yes
checking for strerror... yes
checking for strerror_r... yes
checking for strerror_s... no
checking for strlcpy... yes
checking for strlcat... yes
checking for vsnprintf... yes
checking for snprintf... yes
checking for strtok_r... yes
checking for ffs... yes
checking whether ffs is declared... yes
checking for getaddrinfo... yes
checking for library containing putmsg... no
checking whether getnetbyname_r is declared... no
checking whether getprotobyname_r is declared... yes
checking for the Linux getprotobyname_r()... no
checking for Solaris/IRIX getprotobyname_r()... no
checking for AIX getprotobyname_r()... yes
checking for ether_hostton... yes
checking whether ether_hostton is declared... no
checking whether ether_hostton is declared... no
checking whether ether_hostton is declared... no
checking whether ether_hostton is declared... no
checking whether ether_hostton is declared... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_create... no
checking for pthread_create in -lpthreads... no
checking for pthread_create in -lpthread... yes
checking if --disable-protochain option is specified... enabled
checking net/bpf.h usability... yes
checking net/bpf.h presence... yes
checking for net/bpf.h... yes
checking if net/bpf.h defines BIOCSETIF... yes
checking net/pfilt.h usability... no
checking net/pfilt.h presence... no
checking for net/pfilt.h... no
checking net/enet.h usability... no
checking net/enet.h presence... no
checking for net/enet.h... no
checking net/nit.h usability... no
checking net/nit.h presence... no
checking for net/nit.h... no
checking sys/net/nit.h usability... no
checking sys/net/nit.h presence... no
checking for sys/net/nit.h... no
checking linux/socket.h usability... no
checking linux/socket.h presence... no
checking for linux/socket.h... no
checking net/raw.h usability... no
checking net/raw.h presence... no
checking for net/raw.h... no
checking sys/dlpi.h usability... no
checking sys/dlpi.h presence... no
checking for sys/dlpi.h... no
checking packet capture type... bpf
checking net/if_media.h usability... yes
checking net/if_media.h presence... yes
checking for net/if_media.h... yes
checking for struct BPF_TIMEVAL... no
checking for getifaddrs... yes
checking ifaddrs.h usability... yes
checking ifaddrs.h presence... yes
checking for ifaddrs.h... yes
configure: no hardware timestamp support implemented for openbsd6.3
checking for socklen_t... yes
checking dagapi.h usability... no
checking dagapi.h presence... no
checking for dagapi.h... no
checking whether we have Septel API headers... no
checking whether we have Myricom Sniffer API... no
checking whether TurboCap is supported... no
checking whether to enable remote packet capture... no
checking whether to build optimizer debugging code... no
checking whether to build parser debugging code... no
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for capable lex... yes
checking for bison... bison -y
checking for capable yacc/bison... yes
checking for ranlib... ranlib
checking for ar... ar
checking whether ln -s works... yes
checking for struct sockaddr.sa_len... yes
checking for struct sockaddr_storage... yes
checking for dl_hp_ppa_info_t.dl_module_id_1... no
checking if unaligned accesses fail... no
checking for USB sniffing support... no
checking whether the platform could support netfilter sniffing... no
checking whether we can compile the netmap support... no
configure: no Bluetooth sniffing support implemented for openbsd6.3
checking for pkg-config... pkg-config
checking for D-Bus... yes
checking whether the D-Bus library defines dbus_connection_read_write... yes
checking for ibv_get_device_list in -libverbs... no
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
config.status: creating pcap-filter.manmisc
config.status: creating pcap-linktype.manmisc
config.status: creating pcap-tstamp.manmisc
config.status: creating pcap-savefile.manfile
config.status: creating pcap.3pcap
config.status: creating pcap_compile.3pcap
config.status: creating pcap_datalink.3pcap
config.status: creating pcap_dump_open.3pcap
config.status: creating pcap_get_tstamp_precision.3pcap
config.status: creating pcap_list_datalinks.3pcap
config.status: creating pcap_list_tstamp_types.3pcap
config.status: creating pcap_open_dead.3pcap
config.status: creating pcap_open_offline.3pcap
config.status: creating pcap_set_tstamp_precision.3pcap
config.status: creating pcap_set_tstamp_type.3pcap
config.status: creating rpcapd/Makefile
config.status: creating rpcapd/rpcapd.manadmin
config.status: creating testprogs/Makefile
config.status: creating config.h
config.status: executing default-1 commands
jungle-boogie commented 6 years ago
$ gcc -v
Reading specs from /usr/lib/gcc-lib/amd64-unknown-openbsd6.3/4.2.1/specs
Target: amd64-unknown-openbsd6.3
Configured with: OpenBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.1 20070719
$ cc -v
OpenBSD clang version 6.0.0 (tags/RELEASE_600/final) (based on LLVM 6.0.0)
Target: amd64-unknown-openbsd6.3
Thread model: posix
InstalledDir: /usr/bin
guyharris commented 6 years ago

So are you trying to build from a clone of the tcpdump.org Git repository or from a source tarball from tcpdump.org?

guyharris commented 6 years ago

If I try to build from a clone of the tcpdump.org Git repository on OpenBSD 6.3, I don't have any problem. Are you certain that 1) you're up to date and 2) git status doesn't report any missing files?

Note that bpf_filter.c was moved from a subdirectory to the top-level directory.

jungle-boogie commented 6 years ago

Hi @guyharris,

I am attempted to build libpcap from the git URL of https://github.com/the-tcpdump-group/libpcap

I did see the history of bpf_filter.c and see it was moved; I'll delete the git repo I have, clone, config and build.

When you compiled libpcap from the git src, did you specify anything for your config options? Which compiler did it use?

guyharris commented 6 years ago

When you compiled libpcap from the git src, did you specify anything for your config options?

I think I specified --enable-remote, but it should work with or without that option.

Which compiler did it use?

GCC, because I didn't specify --without-gcc.

jungle-boogie commented 6 years ago

I'll delete the git repo I have, clone, config and build.

that did the trick! git status did show two deleted files, by the way.

guyharris commented 6 years ago

git status did show two deleted files, by the way.

That's usually a bad sign, unless you plan to delete those files from your repository.