torsocks compilation fails on macOS
/Users/rex/torsocks on branch master rex@MacBook-Pro-2018% ./autogen.sh && ./configure && make -j12
+ '[' '!' -e config ']'
+ autoreconf -i
checking build system type... x86_64-apple-darwin20.2.0
checking host system type... x86_64-apple-darwin20.2.0
checking target system type... x86_64-apple-darwin20.2.0
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 whether gcc understands -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /opt/local/bin/ggrep
checking for egrep... /opt/local/bin/ggrep -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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a BSD-compatible install... /opt/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking whether make supports nested variables... (cached) yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking whether ln -s works... yes
checking if the C compiler accepts -Wall... yes
checking for ANSI C header files... (cached) yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking sys/syscall.h usability... yes
checking sys/syscall.h presence... yes
checking for sys/syscall.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 assert.h usability... yes
checking assert.h presence... yes
checking for assert.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for strcspn... yes
checking for strdup... yes
checking for strerror... yes
checking for strcasecmp... yes
checking for strncasecmp... yes
checking for mmap... yes
checking for munmap... yes
checking for socket... yes
checking for connect... yes
checking for close... yes
checking for syscall... yes
checking for recv... yes
checking for send... yes
checking for memset... yes
checking for memcpy... yes
checking for strlen... yes
checking for strncpy... yes
checking for strcmp... yes
checking for malloc... yes
checking for calloc... yes
checking for strstr... yes
checking for strtoul... yes
checking for free... yes
checking for inet_aton... yes
checking for gethostbyname... yes
checking for library containing dlopen... none required
checking file name of the C library... libSystem.dylib
checking if the linker accepts -dynamiclib... yes
checking if the linker accepts -single_module... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking how to print strings... printf
checking for a sed that does not truncate output... /opt/local/bin/gsed
checking for fgrep... /opt/local/bin/ggrep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /opt/local/bin/nm -B
checking the name lister (/opt/local/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 786432
checking how to convert x86_64-apple-darwin20.2.0 file names to x86_64-apple-darwin20.2.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin20.2.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.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 ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /opt/local/bin/nm -B output from gcc 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 for dlfcn.h... (cached) yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin20.2.0 dyld
checking how to hardcode library paths into programs... immediate
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
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 whether C compiler accepts -fPIE... yes
checking whether C compiler accepts -fwrapv... yes
checking whether C compiler accepts --param ssp-buffer-size=1... yes
checking whether C compiler accepts -fstack-protector-all... yes
checking whether the linker accepts -pie... yes
checking whether the linker accepts -z relro... no
checking whether the linker accepts -z now... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating extras/Makefile
config.status: creating src/Makefile
config.status: creating src/bin/Makefile
config.status: creating src/bin/torsocks
config.status: creating src/common/Makefile
config.status: creating src/lib/Makefile
config.status: creating tests/Makefile
config.status: creating tests/unit/Makefile
config.status: creating tests/utils/Makefile
config.status: creating tests/utils/tap/Makefile
config.status: creating doc/Makefile
config.status: creating include/config.h
config.status: executing depfiles commands
config.status: executing libtool commands
Making all in src
Making all in common
CC log.lo
CC config-file.lo
CC utils.lo
CC compat.lo
CC socks5.lo
CC onion.lo
CC connection.lo
CCLD libcommon.la
Making all in lib
CC torsocks.lo
CC connect.lo
CC gethostbyname.lo
CC getaddrinfo.lo
CC close.lo
CC getpeername.lo
CC socket.lo
CC syscall.lo
CC socketpair.lo
CC recv.lo
CC exit.lo
CC accept.lo
torsocks.c:237:2: error: use of undeclared identifier 'tsocks_libc_accept4'; did you mean 'tsocks_libc_accept'?
tsocks_libc_accept4 = dlsym(libc_ptr, LIBC_ACCEPT4_NAME_STR);
^~~~~~~~~~~~~~~~~~~
tsocks_libc_accept
./torsocks.h:411:8: note: 'tsocks_libc_accept' declared here
extern TSOCKS_LIBC_DECL(accept, LIBC_ACCEPT_RET_TYPE, LIBC_ACCEPT_SIG)
^
./torsocks.h:34:9: note: expanded from macro 'TSOCKS_LIBC_DECL'
type (*tsocks_libc_##name)(sig);
^
<scratch space>:97:1: note: expanded from here
tsocks_libc_accept
^
torsocks.c:237:40: error: use of undeclared identifier 'LIBC_ACCEPT4_NAME_STR'
tsocks_libc_accept4 = dlsym(libc_ptr, LIBC_ACCEPT4_NAME_STR);
^
torsocks.c:239:53: error: use of undeclared identifier 'tsocks_libc_accept4'; did you mean 'tsocks_libc_accept'?
!tsocks_libc_syscall || !tsocks_libc_execve || ! tsocks_libc_accept4) {
^~~~~~~~~~~~~~~~~~~
tsocks_libc_accept
./torsocks.h:411:8: note: 'tsocks_libc_accept' declared here
extern TSOCKS_LIBC_DECL(accept, LIBC_ACCEPT_RET_TYPE, LIBC_ACCEPT_SIG)
^
./torsocks.h:34:9: note: expanded from macro 'TSOCKS_LIBC_DECL'
type (*tsocks_libc_##name)(sig);
^
<scratch space>:97:1: note: expanded from here
tsocks_libc_accept
^
3 errors generated.
make[2]: *** [torsocks.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
Edited by Dimitris Apostolou