appneta / tcpreplay

Pcap editing and replay tools for *NIX and Windows - Users please download source from
http://tcpreplay.appneta.com/wiki/installation.html#downloads
1.17k stars 268 forks source link

[Bug] tcpreplay 4.3.4 build failure on Apple M1 #668

Closed chenrui333 closed 2 years ago

chenrui333 commented 3 years ago

You are opening a bug report against the Tcpreplay project: we use GitHub Issues for tracking bug reports and feature requests.

If you have a question about how to use Tcpreplay, you are at the wrong site. You can ask a question on the tcpreplay-users mailing list or on Stack Overflow with [tcpreplay] tag. General help is available here.

If you have a build issue, consider downloading the latest release

Otherwise, to report a bug, please fill out the reproduction steps (below) and delete these introductory paragraphs. Thanks!

Describe the bug

tcpreplay 4.3.4 failed to build on Apple M1

To Reproduce Try to build on Apple M1

Expected behavior Build success

Screenshots full build log, https://github.com/Homebrew/homebrew-core/runs/2812291345

System (please complete the following information):

Additional context

configure: error: in `/private/tmp/tcpreplay-20210612-22759-zqdznu/tcpreplay-4.3.4':
configure: error: C compiler cannot create executables

relates to Homebrew/homebrew-core#77274

fklassen commented 3 years ago

I have no issues on M1.

fklassen@JLABM14 src % uname -a
Darwin JLABM14 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64
fklassen@JLABM14 src % xcode-select -p                                                                                                    
/Applications/Xcode_12.4.app/Contents/Developer
fklassen@JLABM14 src % curl -OL https://github.com/appneta/tcpreplay/releases/download/v4.3.4/tcpreplay-4.3.4.tar.xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   628  100   628    0     0   1200      0 --:--:-- --:--:-- --:--:--  1200
100  721k  100  721k    0     0   650k      0  0:00:01  0:00:01 --:--:-- 3487k
fklassen@JLABM14 src % tar xf tcpreplay-4.3.4.tar.xz 
fklassen@JLABM14 src % cd tcpreplay-4.3.4
fklassen@JLABM14 tcpreplay-4.3.4 % ./configure 
checking whether to enable maintainer-specific portions of Makefiles... yes
checking if malloc debugging is wanted... no
checking build system type... arm-apple-darwin20.3.0
checking host system type... arm-apple-darwin20.3.0
checking target system type... arm-apple-darwin20.3.0
checking what macOS compiler to use... /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk
checking for cygwin development environment... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk
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 /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk accepts -g... yes
checking for /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk option to accept ISO C89... none needed
checking whether /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk understands -c and -o together... yes
checking dependency style of /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk... gcc3
checking the archiver (/Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar) interface... ar
configure: WARNING: Libtool does not cope well with whitespace in `pwd`
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk... /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm
checking the name lister (/Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786432
checking how to convert arm-apple-darwin20.3.0 file names to arm-apple-darwin20.3.0 format... func_convert_file_noop
checking how to convert arm-apple-darwin20.3.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... no
checking for strip... /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip
checking for ranlib... /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
checking command to parse /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm output from /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -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 for dlfcn.h... yes
checking for objdir... .libs
checking if /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk supports -fno-rtti -fno-exceptions... yes
checking for /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk option to produce PIC... -fno-common -DPIC
checking if /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk PIC flag -fno-common -DPIC works... yes
checking if /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk static flag -static works... no
checking if /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk supports -c -o file.o... yes
checking if /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk supports -c -o file.o... (cached) yes
checking whether the /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk linker (/Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin20.3.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk
checking whether we are using the GNU C compiler... (cached) yes
checking whether /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk accepts -g... (cached) yes
checking for /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk option to accept ISO C89... (cached) none needed
checking whether /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk understands -c and -o together... (cached) yes
checking dependency style of /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk... (cached) gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common -DPIC
checking if g++ PIC flag -fno-common -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin20.3.0 dyld
checking how to hardcode library paths into programs... immediate
checking how to run the C preprocessor... /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -E
checking whether ln -s works... yes
checking for gawk... (cached) awk
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking whether make sets $(MAKE)... (cached) yes
checking for printf... /usr/bin/printf
checking for echo... /bin/echo
checking for cut... /usr/bin/cut
checking for autogen... no
checking for groff... /usr/bin/groff
checking for depmod... /sbin/depmod
checking for insmod... /sbin/insmod
checking for rmmod... /sbin/rmmod
configure: Using included libopts tearoff
checking for egrep... (cached) /usr/bin/grep -E
checking whether sys/types.h defines makedev... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for inline... inline
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for int8_t... yes
checking for off_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for sys/param.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... (cached) 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 for u_int8_t... yes
checking for u_int16_t... yes
checking for u_int32_t... yes
checking for u_int64_t... yes
checking for /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -Wno-macro-redefined... yes
checking for /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -Wno-format... yes
checking for /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -Wextra support... no
checking for /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -Wno-variadic-macros support... yes
checking for /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -Wfatal-errors support... yes
checking for /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -m64 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -Wno-format-contains-nul support... no
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking for sys/time.h... (cached) yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for stdint.h... (cached) yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking netinet/in_systm.h usability... yes
checking netinet/in_systm.h presence... yes
checking for netinet/in_systm.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking for unistd.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for inttypes.h... (cached) yes
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/systeminfo.h usability... no
checking sys/systeminfo.h presence... no
checking for sys/systeminfo.h... no
checking sys/io.h usability... no
checking sys/io.h presence... no
checking for sys/io.h... no
checking architecture/i386/pio.h usability... no
checking architecture/i386/pio.h presence... yes
configure: WARNING: architecture/i386/pio.h: present but cannot be compiled
configure: WARNING: architecture/i386/pio.h:     check for missing prerequisite headers?
configure: WARNING: architecture/i386/pio.h: see the Autoconf documentation
configure: WARNING: architecture/i386/pio.h:     section "Present But Cannot Be Compiled"
configure: WARNING: architecture/i386/pio.h: proceeding with the compiler's result
configure: WARNING:     ## ---------------------------------------------------------- ##
configure: WARNING:     ## Report this to https://github.com/appneta/tcpreplay/issues ##
configure: WARNING:     ## ---------------------------------------------------------- ##
checking for architecture/i386/pio.h... no
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking for stdbool.h that conforms to C99... (cached) yes
checking for _Bool... (cached) yes
checking for sys/sysctl.h... yes
checking for net/route.h... yes
checking for socket in -lsocket... no
checking for gethostbyname in -lnsl... no
checking for nanosleep in -lrt... no
checking for resolv in -lresolv... no
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking whether lstat correctly handles trailing slash... no
checking for working memcmp... yes
checking for vprintf... yes
checking for _doprnt... no
checking whether time.h and sys/time.h may both be included... yes
checking for alarm... yes
checking for working mktime... no
checking for getpagesize... yes
checking for working mmap... yes
checking for struct timeval.tv_sec... yes
checking for alarm... (cached) yes
checking for atexit... yes
checking for bzero... yes
checking for dup2... yes
checking for gethostbyname... yes
checking for getpagesize... (cached) yes
checking for gettimeofday... yes
checking for ctime... yes
checking for inet_ntoa... yes
checking for memmove... yes
checking for memset... yes
checking for munmap... yes
checking for pow... yes
checking for putenv... yes
checking for realpath... yes
checking for regcomp... yes
checking for strdup... yes
checking for select... yes
checking for socket... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strcspn... yes
checking for strdup... (cached) yes
checking for strerror... yes
checking for strtol... yes
checking for strncpy... yes
checking for strtoull... yes
checking for poll... yes
checking for ntohll... no
checking for mmap... yes
checking for snprintf... yes
checking for vsnprintf... yes
checking for strsignal... yes
checking for strpbrk... yes
checking for strrchr... yes
checking for strspn... yes
checking for strstr... yes
checking for strtoul... yes
checking for ioperm... no
checking for strlcpy... yes
checking whether byte ordering is bigendian... no
configure: Bypassing libpcap discovery via pcap_config
configure: Using u_int64_t for packet counters
checking for inet_aton... yes
checking for inet_pton... yes
checking for inet_ntop... yes
checking for inet_addr... yes
checking net/if_tun.h usability... no
checking net/if_tun.h presence... no
checking for net/if_tun.h... no
checking for libpcap... /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr
checking for library containing nl_handle_alloc... no
checking for nl_cache_alloc in -lnl... no
checking for genl_connect in -lnl-genl-3... no
checking for nl_cache_alloc in -lnl-3... no
checking for dbus_malloc in -ldbus-1... no
checking for numa_available in -lnuma... no
checking for pthread_create in -lpthread... yes
checking for library containing pcap_get_pfring_id... no
checking for library containing pcap_close... none required
checking for libpcap version... >= 0.8.0
checking for pcap_setnonblock... yes
checking for pcap_datalink_val_to_description... yes
checking for pcap_get_selectable_fd... yes
checking for pcap_dump_fopen... yes
checking for pcap_inject sending support... yes
checking for pcap_sendpacket sending support... yes
checking for pcap_breakloop... no
checking for pcap_version... yes
checking for pcap_snapshot... yes
configure: Building tcpbridge
configure: WARNING: Unable to build tcpliveplay.  This tool is only enabled on linux environments.
checking for netmap socket sending support... no
checking for PF_PACKET socket sending support... no
checking for TX_RING socket sending support... no
checking net/bpf.h usability... yes
checking net/bpf.h presence... yes
checking for net/bpf.h... yes
checking for libdnet... no
configure: WARNING: libdnet not found, disabling fragroute feature
checking for DLT_LINUX_SLL in libpcap... yes
checking for DLT_C_HDLC in libpcap... yes
checking for /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/pcap-bpf.h... no
checking for libpcap bpf header... no
checking for netmap libpcap... no
checking for pcapnav-config... no 
checking for requires strict byte alignment... yes
checking for tcpdump... /usr/sbin/tcpdump
checking for 'make test' profile... yes
checking for OS version... Apple macOS
configure: Using en0 for 1st test network interface card
configure: Using en0 for 2nd test network interface card
checking if it's ok to use pcap_findalldevs()... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for sys/param.h... (cached) yes
checking for sys/poll.h... (cached) yes
checking sys/procset.h usability... no
checking sys/procset.h presence... no
checking for sys/procset.h... no
checking for sys/select.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking sys/stropts.h usability... no
checking sys/stropts.h presence... no
checking for sys/stropts.h... no
checking for sys/time.h... (cached) yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking for dlfcn.h... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for fcntl.h... (cached) yes
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking for libintl.h... (cached) no
checking for memory.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking setjmp.h usability... yes
checking setjmp.h presence... yes
checking for setjmp.h... yes
checking for stdbool.h... (cached) yes
checking sysexits.h usability... yes
checking sysexits.h presence... yes
checking for sysexits.h... yes
checking for unistd.h... (cached) yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking for string.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for inttypes.h... (cached) yes
checking for working stdnoreturn.h... yes
checking for runetype.h... yes
checking for wchar.h... yes
checking for wchar_t... yes
checking for wint_t... yes
checking for int8_t... yes
checking for uint8_t... yes
checking for int16_t... yes
checking for uint16_t... yes
checking for int32_t... yes
checking for uint32_t... yes
checking for intptr_t... yes
checking for uintptr_t... yes
checking for uint_t... no
checking for pid_t... (cached) yes
checking for size_t... (cached) yes
checking for ptrdiff_t... yes
checking size of char *... 8
checking size of int... 4
checking size of long... 8
checking size of short... 2
checking for pathfind in -lgen... no
checking for gettext in -lintl... no
checking for vprintf... (cached) yes
checking for _doprnt... (cached) no
checking for vfork.h... (cached) no
checking for fork... (cached) yes
checking for vfork... (cached) yes
checking for working fork... (cached) yes
checking for working vfork... (cached) yes
checking for mmap... (cached) yes
checking for canonicalize_file_name... no
checking for snprintf... (cached) yes
checking for strdup... (cached) yes
checking for strchr... (cached) yes
checking for strrchr... (cached) yes
checking for strsignal... (cached) yes
checking for fchmod... yes
checking for fstat... yes
checking for chmod... yes
checking for a sed that does not truncate output... (cached) /usr/bin/sed
configure: Using supplied libopts tearoff
checking whether a reg expr header is specified... no
checking whether with-libregex was specified... no
checking whether with-libregex-cflags was specified... no
checking whether with-libregex-libs was specified... no
checking whether libregex functions properly... yes
checking whether pathfind(3) works... no
checking whether /dev/zero is readable device... crw-rw-rw- 1 root wheel 3, 3 Jun 14 13:58 /dev/zero
checking whether we have a functional realpath(3C)... yes
checking whether strftime() works... yes
checking whether fopen accepts "b" mode... yes
checking whether fopen accepts "t" mode... yes
checking whether not wanting optional option args... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating libopts/Makefile
config.status: creating Makefile
config.status: creating doxygen.cfg
config.status: creating lib/Makefile
config.status: creating docs/Makefile
config.status: creating src/Makefile
config.status: creating src/tcpedit/Makefile
config.status: creating src/fragroute/Makefile
config.status: creating src/common/Makefile
config.status: creating src/defines.h
config.status: creating test/Makefile
config.status: creating test/config
config.status: creating scripts/Makefile
config.status: creating src/config.h
config.status: executing depfiles commands
config.status: executing libtool commands

##########################################################################
             TCPREPLAY Suite Configuration Results (4.3.4)
##########################################################################
libpcap:                    /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr (>= 0.9.6)
PF_RING libpcap             no   
libdnet:                    no   
autogen:                     (unknown - man pages will not be built)
Use libopts tearoff:        yes
64bit counter support:      yes
tcpdump binary path:        /usr/sbin/tcpdump
fragroute support:          no
tcpbridge support:          yes
tcpliveplay support:        no

Supported Packet Injection Methods (*):
Linux TX_RING:              no
Linux PF_PACKET:            no
BSD BPF:                    yes
libdnet:                    no
pcap_inject:                yes
pcap_sendpacket:            yes **
pcap_netmap                 no
Linux/BSD netmap:           no
Tuntap device support:      no

* In order of preference; see configure --help to override
** Required for tcpbridge

fklassen@JLABM14 tcpreplay-4.3.4 % make
Making all in scripts
make[1]: Nothing to be done for `all'.
Making all in lib
make[1]: Nothing to be done for `all'.
Making all in libopts
/Applications/Xcode_12.4.app/Contents/Developer/usr/bin/make  all-am
  CC       libopts_la-libopts.lo
  CCLD     libopts.la
Making all in src
/Applications/Xcode_12.4.app/Contents/Developer/usr/bin/make  all-recursive
Making all in common
/Applications/Xcode_12.4.app/Contents/Developer/usr/bin/make  all-am
  CC       cidr.o
  CC       err.o
  CC       list.o
  CC       cache.o
  CC       services.o
  CC       get.o
  CC       fakepcap.o
  CC       fakepcapnav.o
  CC       fakepoll.o
  CC       xX.o
  CC       utils.o
  CC       timer.o
  CC       git_version.o
  CC       sendpacket.o
  CC       dlt_names.o
  CC       mac.o
  CC       interface.o
  CC       flows.o
  CC       txring.o
  CC       tcpdump.o
  AR       libcommon.a
Making all in tcpedit
/Applications/Xcode_12.4.app/Contents/Developer/usr/bin/make  all-am
  CC       tcpedit.o
  CC       parse_args.o
  CC       edit_packet.o
  CC       portmap.o
  CC       dlt.o
  CC       checksum.o
  CC       incremental_checksum.o
  CC       tcpedit_api.o
  CC       fuzzing.o
  CC       rewrite_sequence.o
  CC       plugins/dlt_plugins.o
  CC       plugins/ethernet.o
  CC       plugins/dlt_utils.o
  CC       plugins/dlt_en10mb/en10mb.o
  CC       plugins/dlt_en10mb/en10mb_api.o
  CC       plugins/dlt_hdlc/hdlc.o
  CC       plugins/dlt_hdlc/hdlc_api.o
  CC       plugins/dlt_user/user.o
  CC       plugins/dlt_user/user_api.o
  CC       plugins/dlt_raw/raw.o
  CC       plugins/dlt_null/null.o
  CC       plugins/dlt_loop/loop.o
  CC       plugins/dlt_linuxsll/linuxsll.o
  CC       plugins/dlt_ieee80211/ieee80211.o
  CC       plugins/dlt_ieee80211/ieee80211_hdr.o
  CC       plugins/dlt_radiotap/radiotap.o
  CC       plugins/dlt_jnpr_ether/jnpr_ether.o
  CC       plugins/dlt_pppserial/pppserial.o
  AR       libtcpedit.a
  CC       tcpreplay-tcpreplay_opts.o
  CC       tcpreplay-send_packets.o
  CC       tcpreplay-signal_handler.o
  CC       tcpreplay-tcpreplay.o
  CC       tcpreplay-tcpreplay_api.o
  CC       tcpreplay-sleep.o
  CC       tcpreplay-replay.o
  CCLD     tcpreplay
  CC       tcpprep-tcpprep_opts.o
  CC       tcpprep-tcpprep.o
  CC       tcpprep-tree.o
  CC       tcpprep-tcpprep_api.o
  CCLD     tcpprep
  CC       tcprewrite-tcprewrite_opts.o
  CC       tcprewrite-tcprewrite.o
  CCLD     tcprewrite
  CC       tcpreplay_edit-tcpreplay_edit_opts.o
  CC       tcpreplay_edit-send_packets.o
  CC       tcpreplay_edit-signal_handler.o
  CC       tcpreplay_edit-tcpreplay.o
  CC       tcpreplay_edit-tcpreplay_api.o
  CC       tcpreplay_edit-sleep.o
  CC       tcpreplay_edit-replay.o
  CCLD     tcpreplay-edit
  CC       tcpcapinfo-tcpcapinfo_opts.o
  CC       tcpcapinfo-tcpcapinfo.o
  CCLD     tcpcapinfo
  CC       tcpbridge-tcpbridge_opts.o
  CC       tcpbridge-tcpbridge.o
  CC       tcpbridge-bridge.o
  CCLD     tcpbridge
make[1]: Nothing to be done for `all-am'.
fklassen@JLABM14 tcpreplay-4.3.4 % sudo make test 
echo Making test in ./test
Making test in ./test
cd ./test && make test
rm: test.log: No such file or directory
NOTICE: Tests must be run as root
Sending traffic on 'en0' and 'en0'
[tcpprep] Auto/Router mode test:        OK
[tcpprep] Auto/Bridge mode test:        OK
[tcpprep] Auto/Client mode test:        OK
[tcpprep] Auto/Server mode test:        OK
[tcpprep] Auto/First mode test:         OK
[tcpprep] CIDR mode test:           OK
[tcpprep] Regex mode test:          OK
[tcpprep] Port mode test:           OK
[tcpprep] MAC mode test:            OK
[tcpprep] Comment mode test:            OK
[tcpprep] Print info mode test:         OK
[tcpprep] Print comment mode test:      OK
[tcpprep] Config mode test:             OK
[tcpprep] MAC reverse mode test:        OK
[tcpprep] CIDR reverse mode test:       OK
[tcpprep] Regex reverse mode test:      OK
[tcpprep] exclude packets test:         OK
[tcpprep] include packets test:         OK
[tcpprep] include source test:          OK
[tcpprep] include destination test:         OK
[tcpreplay] Basic test:             OK
[tcpreplay] Cache test:             OK
[tcpreplay] Packets/sec test:           OK
[tcpreplay] Mbps test:              OK
[tcpreplay] Topspeed test:          OK
[tcpreplay] Config file/VLAN add test:      OK
[tcpreplay] Multiplier test:            OK
[tcpreplay] Packets/sec Multiplier test:    OK
[tcpreplay] Precache test:          OK
[tcpreplay] Statistics test:            OK
[tcpreplay] Dual file test:             OK
[tcpreplay] Maximum sleep test:         OK
[tcprewrite] Portmap test:          OK
[tcprewrite] Portmap range test:        OK
[tcprewrite] Endpoint test:             OK
[tcprewrite] Pseudo NAT test:           OK
[tcprewrite] Truncate test:             OK
[tcprewrite] Pad test:              OK
[tcprewrite] Seed IP test:          OK
[tcprewrite] Src/Dst MAC test:          OK
[tcprewrite] Layer2 test:           OK
[tcprewrite] Config/VLAN Add test:      OK
[tcprewrite] Skip bcast test:           OK
[tcprewrite] DLT User test:             OK
[tcprewrite] DLT Cisco HDLC test:       OK
[tcprewrite] VLAN Delete test:          OK
[tcprewrite] Remove EFCS:           OK
[tcprewrite] Force TTL:             OK
[tcprewrite] Increase TTL:          OK
[tcprewrite] Reduce TTL:            OK
[tcprewrite] TOS test:              OK
[tcprewrite] MTU Truncate test:         OK
[tcprewrite] Substitute Src/Dst MAC test:   OK
[tcprewrite] Seeded MAC test:           OK
[tcprewrite] Seeded Keep MAC test:      OK
[tcprewrite] L7 fuzzing test:           OK
[tcprewrite] TCP sequence test:         OK
fklassen@JLABM14 tcpreplay-4.3.4 % 
cho-m commented 3 years ago

The issue appears to happen due to problem in SDK detection logic when XCode Command Line Tools are used.

For example, on M1 macOS Big Sur 11.4, I currently have:

❯ ls /Library/Developer/CommandLineTools/SDKs/
MacOSX.sdk  MacOSX10.15.sdk  MacOSX11.3.sdk  MacOSX11.sdk

The problem is that SDK is looked up from oldest to newest version: https://github.com/appneta/tcpreplay/blob/1affd0f15e1833bc9c01cb1c9c859b71f978e8ad/configure.ac#L80-L81

This means 10.15 is picked on ARM Big Sur, which isn't correct.

I am currently using a workaround to just remove all 10.x from SDK lookup in Homebrew formula Homebrew/homebrew-core#81056

fklassen commented 3 years ago

Thanks for working through that. Yes, we need to detect SDK 11 for that.

Question. Are you using Xcode 12.4?

Marking as a bug and targeting for version 4.4.

cho-m commented 3 years ago

XCode 12.5.1.

In Homebrew, we would usually depend on the CLT SDKs.

xcrun --sdk command doesn't seem to work with symlinked versions like 11.

❯ sudo xcode-select -s /Library/Developer/CommandLineTools

❯ xcrun --sdk macosx10.15 --show-sdk-path
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk

❯ xcrun --sdk macosx11.3 --show-sdk-path
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

❯ xcrun --sdk macosx11 --show-sdk-path
xcrun: error: SDK "macosx11" cannot be located
xcrun: error: SDK "macosx11" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'macosx11'

There is a command to get the version, but I don't know how consistent it is.

❯ xcrun --show-sdk-version
11.3

❯ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

❯ xcrun --show-sdk-version
11.3
fklassen commented 3 years ago

I see. We don't use CLT. Maybe that has something to do with why we don't see any build issues on M1.

We keep several versions on Xcode on our machines and let the directory names help us sort things out. We use xcode-select -s to select and xcdoe-select -p to query, e.g.

$ xcode-select -p
/Applications/Xcode_12.4.app/Contents/Developer

Custom libraries are stored in and selected with$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/usr/local/lib. This allows us to build custom libraries on a per Xcode version basis. So simply running xcode-select -s gives us the build environment we want.

We set -mmacosx-version-min=10.9 for x86_64 and and -mmacosx-version-min=11 for arm64. Currently we use Xcode 12.4 because it is the best version that can build arm64 and run on Catalina x86 build machines.

cho-m commented 3 years ago

Whether issue occurs should be related to CLT vs XCode. I don't know exact reason, but CLT will install 10.15 SDK on path.

I am also able to see no issue if I build source directly and leave default XCode (though it may misbehave if you install another SDK within XCode? Not familiar with this).

However, in Homebrew, we want to avoid dependency on full XCode whenever possible.


At least for Homebrew formula, one possible method to fix would be to allow user to directly specify the path. We do this for a couple formulae since we have this value available inside the framework, i.e. MacOS.sdk_path, e.g. /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

For example, allowing user to specify path and skipping detection logic if set. Either with


However, this would not help someone who compiles code with CLT and auto-detection logic (maybe like #676).

In this case, I think there needs to be a better lookup solution.

Another workaround I tried, which may be possible to use for detection, is

  1. Get <version> from xcrun --show-sdk-version (remove whitespace)
  2. ./configure --prefix=<path> --enable-dynamic-link --with-macosx-sdk=<version>

I think other projects will have ways to solve this issue too.

fklassen commented 3 years ago

The decision as to whether to use Xcode vs. CommandLine Tools on build machines comes down to whether you need multi-platform builds. If you are only building for macOS, CLT is fine.

I plan to rework configure.ac in regards to build settings for macOS. At the top level Developer toolset is selected via xcode-select -s. Then configure.ac needs to be updated to use xcode-select -p to determine top-level directories. That would help determine wether to use CLT or Xcode, and which SDK's versions are available.

For example for CLT you may see these SDK's.

$ xcode-select -p
 /Library/Developer/
$ ls -l $(xcode-select -p)/CommandLineTools/SDKs/
total 0
lrwxr-xr-x  1 root  wheel   14 30 Apr 15:03 MacOSX.sdk -> MacOSX11.1.sdk
drwxr-xr-x  8 root  wheel  256  9 Jul  2020 MacOSX10.15.sdk
drwxr-xr-x  7 root  wheel  224 30 Nov  2020 MacOSX11.1.sdk

In this case the ./configure --with-macos-sdk=10.15 would select MacOSX10.15.sdk, otherwise the default MacOSX11.1 would be used. Note that version 11 is the minimum for M1.

... and if Xcode is selected you may see:

$ xcode-select -p
/Applications/Xcode_12.4.app/Contents/Developer
$ ls -l $(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/
total 0
drwxr-xr-x  5 fklassen  Users  160 30 Nov  2020 DriverKit20.2.sdk
drwxr-xr-x  7 fklassen  Users  224 30 Nov  2020 MacOSX.sdk
lrwxr-xr-x  1 fklassen  Users   10  1 May 11:44 MacOSX11.1.sdk -> MacOSX.sdk

In this example there is only one SDK available, but in other installations you may see more version avaialble.

At this point it should be noted that we install custom libraries in the SDK's directory tree, allowing us to quickly change build environments with simple call to xcode-select. For example, here are several multi-arch libraries that we custom build.

$ ls $(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/lib/
arm64               libACEXML_Parser.dylib      libdum.dylib            libpcre.1.dylib         libresip-1.12.dylib     libssl.1.1.dylib        libz.1.dylib
libACE-6.5.10.dylib     libACE_SSL-6.5.10.dylib     libjsoncpp.1.7.4.dylib      libpcre.dylib           libresip.dylib          libssl.dylib            libz.dylib
libACE.dylib            libACE_SSL.dylib        libjsoncpp.1.dylib      libpcrecpp.0.dylib      libresipares-1.12.dylib     libtidy.5deb1.6.0.dylib     x86_64
libACEXML-6.5.10.dylib      libcrypto.1.1.dylib     libjsoncpp.dylib        libpcrecpp.dylib        libresipares.dylib      libtidy.5deb1.dylib
libACEXML.dylib         libcrypto.dylib         libminizip.1.dylib      libpcreposix.0.dylib        librutil-1.12.dylib     libtidy.dylib
libACEXML_Parser-6.5.10.dylib   libdum-1.12.dylib       libminizip.dylib        libpcreposix.dylib      librutil.dylib          libz.1.2.11.dylib

Back to configure.ac I would like to see a couple extra options, e.g. --with-macos-archs and --with-macos-min-version. The first option would allow either -arch arm64 and/or -arch x86_64 build options. The second option would add something like -mmacosx-version-min=10.9 which in this case would make executables built for OS's that will be supported on macOS version 10.9 through 11.1 (x86_64 only since arm64 requires at least version 11).

These options would give lots of flexibility. If no configure options are specified, you get an executable builds with Xcode or CLT installed, and works on the local machine and current OS. With extra options you can build multi-arch builds that support multiple OS versions.

fklassen commented 2 years ago

Make it easier to get access to the newest SDK

fixed in PR #694