Skip to content

Commit

Permalink
deps: update c-ares to 1.23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nodejs-github-bot authored and lpinca committed Dec 3, 2023
1 parent 2e458d9 commit 4a1b6af
Show file tree
Hide file tree
Showing 262 changed files with 37,777 additions and 24,987 deletions.
1,436 changes: 847 additions & 589 deletions deps/cares/CHANGES

Large diffs are not rendered by default.

99 changes: 84 additions & 15 deletions deps/cares/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright (C) The c-ares project and its contributors
# SPDX-License-Identifier: MIT
CMAKE_MINIMUM_REQUIRED (VERSION 3.1.0)
CMAKE_MINIMUM_REQUIRED (VERSION 3.5.0)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")

INCLUDE (CheckIncludeFiles)
INCLUDE (CheckTypeSize)
Expand All @@ -10,10 +12,10 @@ INCLUDE (CheckCSourceCompiles)
INCLUDE (CheckStructHasMember)
INCLUDE (CheckLibraryExists)

PROJECT (c-ares LANGUAGES C VERSION "1.20.1" )
PROJECT (c-ares LANGUAGES C VERSION "1.23.0" )

# Set this version before release
SET (CARES_VERSION "1.20.1")
SET (CARES_VERSION "1.23.0")

INCLUDE (GNUInstallDirs) # include this *AFTER* PROJECT(), otherwise paths are wrong.

Expand All @@ -28,26 +30,38 @@ INCLUDE (GNUInstallDirs) # include this *AFTER* PROJECT(), otherwise paths are w
# For example, a version of 4:0:2 would generate output such as:
# libname.so -> libname.so.2
# libname.so.2 -> libname.so.2.2.0
SET (CARES_LIB_VERSIONINFO "9:1:7")
SET (CARES_LIB_VERSIONINFO "11:0:9")


OPTION (CARES_STATIC "Build as a static library" OFF)
OPTION (CARES_SHARED "Build as a shared library" ON)
OPTION (CARES_INSTALL "Create installation targets (chain builders may want to disable this)" ON)
OPTION (CARES_STATIC_PIC "Build the static library as PIC (position independent)" OFF)
OPTION (CARES_BUILD_TESTS "Build and run tests" OFF)
OPTION (CARES_STATIC "Build as a static library" OFF)
OPTION (CARES_SHARED "Build as a shared library" ON)
OPTION (CARES_INSTALL "Create installation targets (chain builders may want to disable this)" ON)
OPTION (CARES_STATIC_PIC "Build the static library as PIC (position independent)" OFF)
OPTION (CARES_BUILD_TESTS "Build and run tests" OFF)
OPTION (CARES_BUILD_CONTAINER_TESTS "Build and run container tests (implies CARES_BUILD_TESTS, Linux only)" OFF)
OPTION (CARES_BUILD_TOOLS "Build tools" ON)
OPTION (CARES_BUILD_TOOLS "Build tools" ON)
OPTION (CARES_SYMBOL_HIDING "Hide private symbols in shared libraries" OFF)
OPTION (CARES_THREADS "Build with thread-safety support" ON)
SET (CARES_RANDOM_FILE "/dev/urandom" CACHE STRING "Suitable File / Device Path for entropy, such as /dev/urandom")


# Tests require a C++ compiler
IF (CARES_BUILD_TESTS OR CARES_BUILD_CONTAINER_TESTS)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS FALSE)
enable_language(CXX)
ENDIF ()

# Tests require static to be enabled on Windows to be able to access otherwise hidden symbols
IF (CARES_BUILD_TESTS AND (NOT CARES_STATIC) AND WIN32)
IF ((CARES_BUILD_TESTS OR CARES_BUILD_CONTAINER_TESTS) AND (NOT CARES_STATIC) AND WIN32)
SET (CARES_STATIC ON)
SET (CARES_STATIC_PIC ON)
MESSAGE (WARNING "Static building was requested be disabled, but reenabled to support tests")
MESSAGE (WARNING "Static building was requested be disabled, but re-enabled to support tests")
ENDIF ()

INCLUDE (EnableWarnings)

# allow linking against the static runtime library in msvc
IF (MSVC)
OPTION (CARES_MSVC_STATIC_RUNTIME "Link against the static runtime library" OFF)
Expand All @@ -70,6 +84,21 @@ IF (MSVC)
ENDIF ()
ENDIF ()

IF (CARES_SYMBOL_HIDING)
IF (CMAKE_VERSION VERSION_LESS 3.12)
MESSAGE (FATAL_ERROR "Hiding symbols requires CMake 3.12")
ENDIF ()
CMAKE_POLICY (SET CMP0063 NEW)
SET (CARES_SYMBOL_SCOPE_EXTERN [=[__attribute__ ((visibility("default")))]=])
CHECK_C_SOURCE_COMPILES ("
${CARES_SYMBOL_SCOPE_EXTERN} int somefunc() { return 0; }
int main() { return somefunc(); }
" HAVE_VISIBILITY_ATTRIBUTE)
IF (NOT HAVE_VISIBILITY_ATTRIBUTE)
MESSAGE (FATAL_ERROR "C compiler does not accept visibility attribute")
ENDIF ()
ENDIF ()

# Keep build organized.
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
Expand Down Expand Up @@ -199,7 +228,6 @@ CHECK_INCLUDE_FILES (sys/uio.h HAVE_SYS_UIO_H)
CHECK_INCLUDE_FILES (time.h HAVE_TIME_H)
CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H)
CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H)

# On OpenBSD, you must include sys/types.h before netinet/tcp.h
IF (HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES ("sys/types.h;netinet/tcp.h" HAVE_NETINET_TCP_H)
Expand All @@ -213,6 +241,8 @@ ENDIF ()
IF (WIN32)
CHECK_INCLUDE_FILES ("winsock2.h;windows.h" HAVE_WINSOCK2_H)
CHECK_INCLUDE_FILES ("winsock2.h;ws2tcpip.h;windows.h" HAVE_WS2TCPIP_H)
CHECK_INCLUDE_FILES ("winsock2.h;iphlpapi.h;windows.h" HAVE_IPHLPAPI_H)
CHECK_INCLUDE_FILES ("winsock2.h;netioapi.h;windows.h" HAVE_NETIOAPI_H)
CHECK_INCLUDE_FILES ("winsock.h;windows.h" HAVE_WINSOCK_H)
CHECK_INCLUDE_FILES (windows.h HAVE_WINDOWS_H)
ENDIF ()
Expand All @@ -229,7 +259,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "AIX")
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
# Don't define _XOPEN_SOURCE on FreeBSD, it actually reduces visibility instead of increasing it
ELSEIF (WIN32)
LIST (APPEND SYSFLAGS -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_WIN32_WINNT=0x0600)
LIST (APPEND SYSFLAGS -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_WIN32_WINNT=0x0602)
ENDIF ()
ADD_DEFINITIONS(${SYSFLAGS})

Expand Down Expand Up @@ -289,12 +319,14 @@ CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_SELECT_H sys/select.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_SOCKET_H sys/socket.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_SOCKIO_H sys/sockio.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_TIME_H sys/time.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_STAT_H sys/stat.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_SYS_UIO_H sys/uio.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_TIME_H time.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_FCNTL_H fcntl.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_UNISTD_H unistd.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_WINSOCK2_H winsock2.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_WS2TCPIP_H ws2tcpip.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_IPHLPAPI_H iphlpapi.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_WINDOWS_H windows.h)

# Check Types
Expand Down Expand Up @@ -399,7 +431,7 @@ CHECK_SYMBOL_EXISTS (strncmpi "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRNCMP
CHECK_SYMBOL_EXISTS (strnicmp "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STRNICMP)
CHECK_SYMBOL_EXISTS (writev "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_WRITEV)
CHECK_SYMBOL_EXISTS (arc4random_buf "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_ARC4RANDOM_BUF)

CHECK_SYMBOL_EXISTS (stat "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_STAT)

# On Android, the system headers may define __system_property_get(), but excluded
# from libc. We need to perform a link test instead of a header/symbol test.
Expand All @@ -411,6 +443,43 @@ SET (CMAKE_REQUIRED_DEFINITIONS)
SET (CMAKE_REQUIRED_LIBRARIES)


################################################################################
# Threading Support
#
IF (CARES_THREADS)
IF (WIN32)
# Do nothing, always has threads
ELSE ()
# Need to prefer pthreads on platforms that may have more threading choices
# (e.g. Solaris)
SET (CMAKE_THREAD_PREFER_PTHREAD TRUE)
FIND_PACKAGE (Threads)

IF (Threads_FOUND)
# Fix solaris9 bug due to libc having pthread_create() stubs that always fail. CMake
# doesn't realize that the real pthread functions aren't in libc, so sets the pthread
# library CAKE_THREAD_LIBS_INIT variable to blank instead of to the correct "-lpthread".
IF (CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND NOT CMAKE_THREAD_LIBS_INIT)
SET (CMAKE_THREAD_LIBS_INIT "-lpthread")
ENDIF ()

# PThread functions.
CHECK_INCLUDE_FILES (pthread.h HAVE_PTHREAD_H)
CHECK_INCLUDE_FILES (pthread_np.h HAVE_PTHREAD_NP_H)
CARES_EXTRAINCLUDE_IFSET (HAVE_PTHREAD_H pthread.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_PTHREAD_NP_H pthread_np.h)
CHECK_SYMBOL_EXISTS (pthread_init "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_PTHREAD_INIT)
# Make sure libcares.pc.cmake knows about thread libraries on static builds
LIST (APPEND CARES_DEPENDENT_LIBS ${CMAKE_THREAD_LIBS_INIT})
ELSE ()
MESSAGE (WARNING "Threading support not found, disabling...")
SET (CARES_THREADS OFF)
ENDIF ()
ENDIF ()
ENDIF ()



################################################################################
# recv, recvfrom, send, getnameinfo, gethostname
# ARGUMENTS AND RETURN VALUES
Expand Down
2 changes: 1 addition & 1 deletion deps/cares/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ Ninja
-----

Ninja is the next-generation build system meant for generators like CMake that
heavily parallize builds. Its use is very similar to the normal build:
heavily parallelize builds. Its use is very similar to the normal build:

```sh
cd /path/to/cmake/source
Expand Down
6 changes: 3 additions & 3 deletions deps/cares/Makefile.Watcom
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ MD = mkdir
RD = rmdir /q /s 2>NUL
CP = copy

CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm -aa &
-wcd=201 -bt=nt -d+ -dWIN32 -dCARES_BUILDING_LIBRARY &
CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm -aa &
-wcd=201 -bt=nt -d+ -dWIN32 -dCARES_BUILDING_LIBRARY &
-dNTDDI_VERSION=0x06000000 -I. -I.\include -I.\src\lib $(SYS_INCL)

LFLAGS = option quiet, map, caseexact, eliminate
Expand All @@ -55,7 +55,7 @@ LFLAGS += debug all
CFLAGS += -d0
!endif

CFLAGS += -d_WIN32_WINNT=0x0600
CFLAGS += -d_WIN32_WINNT=0x0602

#
# Change to suite.
Expand Down
4 changes: 2 additions & 2 deletions deps/cares/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ EXTRA_DIST = AUTHORS CHANGES README.cares $(man_MANS) RELEASE-NOTES \
c-ares-config.cmake.in libcares.pc.cmake libcares.pc.in buildconf get_ver.awk \
maketgz TODO README.msvc $(MSVCFILES) INSTALL.md README.md LICENSE.md \
CMakeLists.txt Makefile.dj Makefile.m32 Makefile.netware Makefile.msvc \
Makefile.Watcom AUTHORS CONTRIBUTING.md SECURITY.md TODO

Makefile.Watcom AUTHORS CONTRIBUTING.md SECURITY.md TODO \
cmake/EnableWarnings.cmake

CLEANFILES = $(PDFPAGES) $(HTMLPAGES)

Expand Down
14 changes: 12 additions & 2 deletions deps/cares/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,15 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_ac_append_to_file.m4 \
$(top_srcdir)/m4/ax_ac_print_to_file.m4 \
$(top_srcdir)/m4/ax_add_am_macro_static.m4 \
$(top_srcdir)/m4/ax_am_macros_static.m4 \
$(top_srcdir)/m4/ax_append_compile_flags.m4 \
$(top_srcdir)/m4/ax_append_flag.m4 \
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
$(top_srcdir)/m4/ax_check_gnu_make.m4 \
$(top_srcdir)/m4/ax_code_coverage.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \
$(top_srcdir)/m4/ax_file_escapes.m4 \
$(top_srcdir)/m4/ax_pthread.m4 \
$(top_srcdir)/m4/ax_require_defined.m4 \
$(top_srcdir)/m4/cares-compilers.m4 \
$(top_srcdir)/m4/cares-confopts.m4 \
Expand Down Expand Up @@ -229,7 +233,7 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libcares.pc.in \
AUTHORS INSTALL.md NEWS README.md TODO compile config.guess \
config.sub depcomp install-sh ltmain.sh missing
config.sub install-sh ltmain.sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
Expand Down Expand Up @@ -357,6 +361,10 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PTHREAD_CC = @PTHREAD_CC@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_CXX = @PTHREAD_CXX@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
Expand All @@ -376,6 +384,7 @@ am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
Expand Down Expand Up @@ -430,7 +439,8 @@ EXTRA_DIST = AUTHORS CHANGES README.cares $(man_MANS) RELEASE-NOTES \
c-ares-config.cmake.in libcares.pc.cmake libcares.pc.in buildconf get_ver.awk \
maketgz TODO README.msvc $(MSVCFILES) INSTALL.md README.md LICENSE.md \
CMakeLists.txt Makefile.dj Makefile.m32 Makefile.netware Makefile.msvc \
Makefile.Watcom AUTHORS CONTRIBUTING.md SECURITY.md TODO
Makefile.Watcom AUTHORS CONTRIBUTING.md SECURITY.md TODO \
cmake/EnableWarnings.cmake

CLEANFILES = $(PDFPAGES) $(HTMLPAGES)
DISTCLEANFILES = include/ares_build.h
Expand Down
3 changes: 2 additions & 1 deletion deps/cares/Makefile.m32
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RANLIB = $(CROSSPREFIX)ranlib
#RM = rm -f
CP = cp -afv

CFLAGS = $(CARES_CFLAG_EXTRAS) -O2 -Wall -I./include -I./src/lib -D_WIN32_WINNT=0x0600
CFLAGS = $(CARES_CFLAG_EXTRAS) -O2 -Wall -I./include -I./src/lib -D_WIN32_WINNT=0x0602
CFLAGS += -DCARES_STATICLIB
LDFLAGS = $(CARES_LDFLAG_EXTRAS) -s
LIBS = -lws2_32 -liphlpapi
Expand Down Expand Up @@ -63,6 +63,7 @@ install:
chmod u-w ${DESTDIR}${libdir}/$(LIB)
${INSTALL} -m 444 ${srcdir}/include/ares.h ${DESTDIR}${includedir}
${INSTALL} -m 444 ${srcdir}/include/ares_build.h ${DESTDIR}${includedir}
${INSTALL} -m 444 ${srcdir}/include/ares_dns_record.h ${DESTDIR}${includedir}
${INSTALL} -m 444 ${srcdir}/include/ares_rules.h ${DESTDIR}${includedir}
${INSTALL} -m 444 ${srcdir}/include/ares_version.h ${DESTDIR}${includedir}
(for man in $(MANPAGES); do \
Expand Down
1 change: 1 addition & 0 deletions deps/cares/Makefile.msvc
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ install:
@copy /y $(SRCDIR)\include\ares_build.h "$(INSTALL_DIR_INC)" >NUL
@copy /y $(SRCDIR)\include\ares_rules.h "$(INSTALL_DIR_INC)" >NUL
@copy /y $(SRCDIR)\include\ares_version.h "$(INSTALL_DIR_INC)" >NUL
@copy /y $(SRCDIR)\include\ares_dns_record.h "$(INSTALL_DIR_INC)" >NUL
@echo Installed c-ares $(CFG)

!ENDIF
Expand Down
4 changes: 2 additions & 2 deletions deps/cares/Makefile.netware
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ ifeq ($(LIBARCH),LIBC)
CFLAGS += -align 4
else
# PRELUDE = $(SDK_CLIB)/imports/clibpre.o
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
# to avoid the __init_* / __deinit_* whose dont use prelude from NDK
PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
# CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
CFLAGS += -align 1
Expand All @@ -114,7 +114,7 @@ ifeq ($(LIBARCH),LIBC)
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
else
# PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
# to avoid the __init_* / __deinit_* whose dont use prelude from NDK
# http://www.gknw.net/development/mk_nlm/gcc_pre.zip
PRELUDE = $(NDK_ROOT)/pre/prelude.o
CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
Expand Down
4 changes: 3 additions & 1 deletion deps/cares/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ c-ares
[![Coverage Status](https://coveralls.io/repos/github/c-ares/c-ares/badge.svg)](https://coveralls.io/github/c-ares/c-ares)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/291/badge)](https://bestpractices.coreinfrastructure.org/projects/291)
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/c-ares.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:c-ares)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=c-ares_c-ares&metric=bugs)](https://sonarcloud.io/summary/new_code?id=c-ares_c-ares)
[![Coverity Scan Status](https://scan.coverity.com/projects/c-ares/badge.svg)](https://scan.coverity.com/projects/c-ares)

This is c-ares, an asynchronous resolver library. It is intended for
applications which need to perform DNS queries without blocking, or need to
Expand All @@ -21,7 +23,7 @@ If you find bugs, correct flaws, have questions or have comments in general in
regard to c-ares (or by all means the original ares too), get in touch with us
on the c-ares mailing list: https://lists.haxx.se/listinfo/c-ares

c-ares is distributed the MIT license.
c-ares is distributed under the MIT license.

You'll find all c-ares details and news here:
https://c-ares.org/
Expand Down
Loading

0 comments on commit 4a1b6af

Please sign in to comment.