diff --git a/Ports/cmake/patches/0020-libuv-ipv6.patch b/Ports/cmake/patches/0020-libuv-ipv6.patch deleted file mode 100644 index 12626903925..00000000000 --- a/Ports/cmake/patches/0020-libuv-ipv6.patch +++ /dev/null @@ -1,489 +0,0 @@ ---- a/Utilities/cmlibuv/src/unix/udp.c 2021-02-12 22:54:39.835381661 +0330 -+++ b/Utilities/cmlibuv/src/unix/udp.c 2021-02-12 23:06:41.699978199 +0330 -@@ -585,6 +585,7 @@ static int uv__udp_maybe_deferred_bind(u - addrlen = sizeof *addr; - break; - } -+#ifndef __serenity__ - case AF_INET6: - { - struct sockaddr_in6* addr = &taddr.in6; -@@ -594,6 +595,7 @@ static int uv__udp_maybe_deferred_bind(u - addrlen = sizeof *addr; - break; - } -+#endif - default: - assert(0 && "unsupported address family"); - abort(); -@@ -761,6 +763,9 @@ static int uv__udp_set_membership4(uv_ud - const struct sockaddr_in* multicast_addr, - const char* interface_addr, - uv_membership membership) { -+#ifdef __serenity__ -+ return UV_EINVAL; -+#else - struct ip_mreq mreq; - int optname; - int err; -@@ -801,6 +806,7 @@ static int uv__udp_set_membership4(uv_ud - } - - return 0; -+#endif - } - - -@@ -808,6 +814,9 @@ static int uv__udp_set_membership6(uv_ud - const struct sockaddr_in6* multicast_addr, - const char* interface_addr, - uv_membership membership) { -+#ifdef __serenity__ -+ return UV_EINVAL; -+#else - int optname; - struct ipv6_mreq mreq; - struct sockaddr_in6 addr6; -@@ -848,14 +857,16 @@ static int uv__udp_set_membership6(uv_ud - } - - return 0; -+#endif - } - - - #if !defined(__OpenBSD__) && \ - !defined(__NetBSD__) && \ - !defined(__ANDROID__) && \ -- !defined(__DragonFly__) & \ -- !defined(__QNX__) -+ !defined(__DragonFly__) && \ -+ !defined(__QNX__) && \ -+ !defined(__serenity__) - static int uv__udp_set_source_membership4(uv_udp_t* handle, - const struct sockaddr_in* multicast_addr, - const char* interface_addr, -@@ -1089,11 +1100,15 @@ static int uv__setsockopt(uv_udp_t* hand - int r; - - if (handle->flags & UV_HANDLE_IPV6) -+#ifndef __serenity__ - r = setsockopt(handle->io_watcher.fd, - IPPROTO_IPV6, - option6, - val, - size); -+#else -+ r = -1; -+#endif - else - r = setsockopt(handle->io_watcher.fd, - IPPROTO_IP, -@@ -1162,20 +1177,24 @@ int uv_udp_set_ttl(uv_udp_t* handle, int - &ttl, - sizeof(ttl)); - --#else /* !(defined(__sun) || defined(_AIX) || defined (__OpenBSD__) || -+#elif !defined(__serenity__) /* !(defined(__sun) || defined(_AIX) || defined (__OpenBSD__) || - defined(__MVS__) || defined(__QNX__)) */ - - return uv__setsockopt_maybe_char(handle, - IP_TTL, - IPV6_UNICAST_HOPS, - ttl); -- -+#else -+ return -1; - #endif /* defined(__sun) || defined(_AIX) || defined (__OpenBSD__) || - defined(__MVS__) || defined(__QNX__) */ - } - - - int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl) { -+#if defined(__serenity__) -+ return -1; -+#else - /* - * On Solaris and derivatives such as SmartOS, the length of socket options - * is sizeof(int) for IPV6_MULTICAST_HOPS and sizeof(char) for -@@ -1197,10 +1216,14 @@ int uv_udp_set_multicast_ttl(uv_udp_t* h - IP_MULTICAST_TTL, - IPV6_MULTICAST_HOPS, - ttl); -+#endif - } - - - int uv_udp_set_multicast_loop(uv_udp_t* handle, int on) { -+#if defined(__serenity__) -+ return -1; -+#else - /* - * On Solaris and derivatives such as SmartOS, the length of socket options - * is sizeof(int) for IPV6_MULTICAST_LOOP and sizeof(char) for -@@ -1222,9 +1245,13 @@ int uv_udp_set_multicast_loop(uv_udp_t* - IP_MULTICAST_LOOP, - IPV6_MULTICAST_LOOP, - on); -+#endif - } - - int uv_udp_set_multicast_interface(uv_udp_t* handle, const char* interface_addr) { -+#if defined(__serenity__) -+ return -1; -+#else - struct sockaddr_storage addr_st; - struct sockaddr_in* addr4; - struct sockaddr_in6* addr6; -@@ -1271,6 +1298,7 @@ int uv_udp_set_multicast_interface(uv_ud - } - - return 0; -+#endif - } - - int uv_udp_getpeername(const uv_udp_t* handle, -diff --git a/Utilities/cmlibuv/src/unix/udp.c b/Utilities/cmlibuv/src/unix/udp.c -index 0b83652..77468f9 100644 ---- a/Utilities/cmlibuv/src/unix/udp.c -+++ b/Utilities/cmlibuv/src/unix/udp.c -@@ -1058,7 +1058,8 @@ int uv_udp_set_source_membership(uv_udp_t* handle, - !defined(__NetBSD__) && \ - !defined(__ANDROID__) && \ - !defined(__DragonFly__) && \ -- !defined(__QNX__) -+ !defined(__QNX__) \ -+ !defined(__serenity__) - int err; - union uv__sockaddr mcast_addr; - union uv__sockaddr src_addr; -diff --git a/Utilities/cmlibuv/src/inet.c b/Utilities/cmlibuv/src/inet.c -index 58238dc..5b880b0 100644 ---- a/Utilities/cmlibuv/src/inet.c -+++ b/Utilities/cmlibuv/src/inet.c -@@ -41,8 +41,10 @@ int uv_inet_ntop(int af, const void* src, char* dst, size_t size) { - switch (af) { - case AF_INET: - return (inet_ntop4(src, dst, size)); -+#ifndef __serenity__ - case AF_INET6: - return (inet_ntop6(src, dst, size)); -+#endif - default: - return UV_EAFNOSUPPORT; - } -@@ -154,6 +156,7 @@ int uv_inet_pton(int af, const char* src, void* dst) { - switch (af) { - case AF_INET: - return (inet_pton4(src, dst)); -+#ifndef __serenity__ - case AF_INET6: { - int len; - char tmp[UV__INET6_ADDRSTRLEN], *s, *p; -@@ -169,6 +172,7 @@ int uv_inet_pton(int af, const char* src, void* dst) { - } - return inet_pton6(s, dst); - } -+#endif - default: - return UV_EAFNOSUPPORT; - } -diff --git a/Utilities/cmlibuv/src/unix/getnameinfo.c b/Utilities/cmlibuv/src/unix/getnameinfo.c -index b695081..939db31 100644 ---- a/Utilities/cmlibuv/src/unix/getnameinfo.c -+++ b/Utilities/cmlibuv/src/unix/getnameinfo.c -@@ -37,8 +37,10 @@ static void uv__getnameinfo_work(struct uv__work* w) { - - if (req->storage.ss_family == AF_INET) - salen = sizeof(struct sockaddr_in); -+#ifndef __serenity__ - else if (req->storage.ss_family == AF_INET6) - salen = sizeof(struct sockaddr_in6); -+#endif - else - abort(); - -@@ -90,10 +92,12 @@ int uv_getnameinfo(uv_loop_t* loop, - memcpy(&req->storage, - addr, - sizeof(struct sockaddr_in)); -+#ifndef __serenity__ - } else if (addr->sa_family == AF_INET6) { - memcpy(&req->storage, - addr, - sizeof(struct sockaddr_in6)); -+#endif - } else { - return UV_EINVAL; - } -diff --git a/Utilities/cmlibuv/src/unix/tcp.c b/Utilities/cmlibuv/src/unix/tcp.c -index 748d6ff..ff88f3b 100644 ---- a/Utilities/cmlibuv/src/unix/tcp.c -+++ b/Utilities/cmlibuv/src/unix/tcp.c -@@ -89,8 +89,11 @@ static int maybe_new_socket(uv_tcp_t* handle, int domain, unsigned long flags) { - if (getsockname(uv__stream_fd(handle), (struct sockaddr*) &saddr, &slen)) - return UV__ERR(errno); - -- if ((saddr.ss_family == AF_INET6 && -+ if ( -+#ifndef __serenity__ -+ (saddr.ss_family == AF_INET6 && - ((struct sockaddr_in6*) &saddr)->sin6_port != 0) || -+#endif - (saddr.ss_family == AF_INET && - ((struct sockaddr_in*) &saddr)->sin_port != 0)) { - /* Handle is already bound to a port. */ -@@ -116,7 +119,11 @@ int uv_tcp_init_ex(uv_loop_t* loop, uv_tcp_t* tcp, unsigned int flags) { - - /* Use the lower 8 bits for the domain */ - domain = flags & 0xFF; -- if (domain != AF_INET && domain != AF_INET6 && domain != AF_UNSPEC) -+ if (domain != AF_INET -+#ifndef __serenity__ -+ && domain != AF_INET6 -+#endif -+ && domain != AF_UNSPEC) - return UV_EINVAL; - - if (flags & ~0xFF) -@@ -152,9 +159,11 @@ int uv__tcp_bind(uv_tcp_t* tcp, - int err; - int on; - -+#ifndef __serenity__ - /* Cannot set IPv6-only mode on non-IPv6 socket. */ - if ((flags & UV_TCP_IPV6ONLY) && addr->sa_family != AF_INET6) - return UV_EINVAL; -+#endif - - err = maybe_new_socket(tcp, addr->sa_family, 0); - if (err) -@@ -164,7 +173,7 @@ int uv__tcp_bind(uv_tcp_t* tcp, - if (setsockopt(tcp->io_watcher.fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on))) - return UV__ERR(errno); - --#ifndef __OpenBSD__ -+#if !defined(__OpenBSD__) && !defined(__serenity__) - #ifdef IPV6_V6ONLY - if (addr->sa_family == AF_INET6) { - on = (flags & UV_TCP_IPV6ONLY) != 0; -@@ -194,8 +203,10 @@ int uv__tcp_bind(uv_tcp_t* tcp, - tcp->delayed_error = UV__ERR(errno); - - tcp->flags |= UV_HANDLE_BOUND; -+#ifndef __serenity__ - if (addr->sa_family == AF_INET6) - tcp->flags |= UV_HANDLE_IPV6; -+#endif - - return 0; - } -diff --git a/Utilities/cmlibuv/src/unix/tty.c b/Utilities/cmlibuv/src/unix/tty.c -index 82cd723..1d6f7f2 100644 ---- a/Utilities/cmlibuv/src/unix/tty.c -+++ b/Utilities/cmlibuv/src/unix/tty.c -@@ -345,7 +345,11 @@ uv_handle_type uv_guess_handle(uv_file file) { - return UV_UNKNOWN_HANDLE; - - if (type == SOCK_DGRAM) -- if (sa.sa_family == AF_INET || sa.sa_family == AF_INET6) -+ if (sa.sa_family == AF_INET -+#ifndef __serenity__ -+ || sa.sa_family == AF_INET6 -+#endif -+ ) - return UV_UDP; - - if (type == SOCK_STREAM) { -@@ -358,7 +362,11 @@ uv_handle_type uv_guess_handle(uv_file file) { - return UV_NAMED_PIPE; - #endif /* defined(_AIX) || defined(__DragonFly__) */ - -- if (sa.sa_family == AF_INET || sa.sa_family == AF_INET6) -+ if (sa.sa_family == AF_INET -+#ifndef __serenity__ -+ || sa.sa_family == AF_INET6 -+#endif -+ ) - return UV_TCP; - if (sa.sa_family == AF_UNIX) - return UV_NAMED_PIPE; -diff --git a/Utilities/cmlibuv/src/unix/udp.c b/Utilities/cmlibuv/src/unix/udp.c -index 77468f9..2db3dd2 100644 ---- a/Utilities/cmlibuv/src/unix/udp.c -+++ b/Utilities/cmlibuv/src/unix/udp.c -@@ -340,9 +340,12 @@ write_queue_drain: - p->msg_hdr.msg_namelen = 0; - } else { - p->msg_hdr.msg_name = &req->addr; -+#ifndef __serenity__ - if (req->addr.ss_family == AF_INET6) - p->msg_hdr.msg_namelen = sizeof(struct sockaddr_in6); -- else if (req->addr.ss_family == AF_INET) -+ else -+#endif -+ if (req->addr.ss_family == AF_INET) - p->msg_hdr.msg_namelen = sizeof(struct sockaddr_in); - else if (req->addr.ss_family == AF_UNIX) - p->msg_hdr.msg_namelen = sizeof(struct sockaddr_un); -@@ -430,9 +433,12 @@ static void uv__udp_sendmsg(uv_udp_t* handle) { - h.msg_namelen = 0; - } else { - h.msg_name = &req->addr; -+#ifndef __serenity__ - if (req->addr.ss_family == AF_INET6) - h.msg_namelen = sizeof(struct sockaddr_in6); -- else if (req->addr.ss_family == AF_INET) -+ else -+#endif -+ if (req->addr.ss_family == AF_INET) - h.msg_namelen = sizeof(struct sockaddr_in); - else if (req->addr.ss_family == AF_UNIX) - h.msg_namelen = sizeof(struct sockaddr_un); -@@ -518,8 +524,10 @@ int uv__udp_bind(uv_udp_t* handle, - return UV_EINVAL; - - /* Cannot set IPv6-only mode on non-IPv6 socket. */ -+#ifndef __serenity__ - if ((flags & UV_UDP_IPV6ONLY) && addr->sa_family != AF_INET6) - return UV_EINVAL; -+#endif - - fd = handle->io_watcher.fd; - if (fd == -1) { -@@ -558,8 +566,10 @@ int uv__udp_bind(uv_udp_t* handle, - return err; - } - -+#ifndef __serenity__ - if (addr->sa_family == AF_INET6) - handle->flags |= UV_HANDLE_IPV6; -+#endif - - handle->flags |= UV_HANDLE_BOUND; - return 0; -@@ -1038,11 +1048,13 @@ int uv_udp_set_membership(uv_udp_t* handle, - if (err) - return err; - return uv__udp_set_membership4(handle, &addr4, interface_addr, membership); -+#ifndef __serenity__ - } else if (uv_ip6_addr(multicast_addr, 0, &addr6) == 0) { - err = uv__udp_maybe_deferred_bind(handle, AF_INET6, UV_UDP_REUSEADDR); - if (err) - return err; - return uv__udp_set_membership6(handle, &addr6, interface_addr, membership); -+#endif - } else { - return UV_EINVAL; - } -@@ -1058,7 +1070,7 @@ int uv_udp_set_source_membership(uv_udp_t* handle, - !defined(__NetBSD__) && \ - !defined(__ANDROID__) && \ - !defined(__DragonFly__) && \ -- !defined(__QNX__) \ -+ !defined(__QNX__) && \ - !defined(__serenity__) - int err; - union uv__sockaddr mcast_addr; -diff --git a/Utilities/cmlibuv/src/uv-common.c b/Utilities/cmlibuv/src/uv-common.c -index f986d75..f73840e 100644 ---- a/Utilities/cmlibuv/src/uv-common.c -+++ b/Utilities/cmlibuv/src/uv-common.c -@@ -231,6 +231,9 @@ int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr) { - - - int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr) { -+#ifdef __serenity__ -+ return -1; -+#else - char address_part[40]; - size_t address_part_size; - const char* zone_index; -@@ -262,6 +265,7 @@ int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr) { - } - - return uv_inet_pton(AF_INET6, ip, &addr->sin6_addr); -+#endif - } - - -@@ -271,7 +275,11 @@ int uv_ip4_name(const struct sockaddr_in* src, char* dst, size_t size) { - - - int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size) { -+#ifdef __serenity__ -+ return -1; -+#else - return uv_inet_ntop(AF_INET6, &src->sin6_addr, dst, size); -+#endif - } - - -@@ -285,8 +293,10 @@ int uv_tcp_bind(uv_tcp_t* handle, - - if (addr->sa_family == AF_INET) - addrlen = sizeof(struct sockaddr_in); -+#ifndef __serenity__ - else if (addr->sa_family == AF_INET6) - addrlen = sizeof(struct sockaddr_in6); -+#endif - else - return UV_EINVAL; - -@@ -301,7 +311,11 @@ int uv_udp_init_ex(uv_loop_t* loop, uv_udp_t* handle, unsigned flags) { - - /* Use the lower 8 bits for the domain. */ - domain = flags & 0xFF; -- if (domain != AF_INET && domain != AF_INET6 && domain != AF_UNSPEC) -+ if (domain != AF_INET -+#ifndef __serenity__ -+ && domain != AF_INET6 -+#endif -+ && domain != AF_UNSPEC) - return UV_EINVAL; - - /* Use the higher bits for extra flags. */ -@@ -334,8 +348,10 @@ int uv_udp_bind(uv_udp_t* handle, - - if (addr->sa_family == AF_INET) - addrlen = sizeof(struct sockaddr_in); -+#ifndef __serenity__ - else if (addr->sa_family == AF_INET6) - addrlen = sizeof(struct sockaddr_in6); -+#endif - else - return UV_EINVAL; - -@@ -354,8 +370,10 @@ int uv_tcp_connect(uv_connect_t* req, - - if (addr->sa_family == AF_INET) - addrlen = sizeof(struct sockaddr_in); -+#ifndef __serenity__ - else if (addr->sa_family == AF_INET6) - addrlen = sizeof(struct sockaddr_in6); -+#endif - else - return UV_EINVAL; - -@@ -379,8 +397,10 @@ int uv_udp_connect(uv_udp_t* handle, const struct sockaddr* addr) { - - if (addr->sa_family == AF_INET) - addrlen = sizeof(struct sockaddr_in); -+#ifndef __serenity__ - else if (addr->sa_family == AF_INET6) - addrlen = sizeof(struct sockaddr_in6); -+#endif - else - return UV_EINVAL; - -@@ -420,8 +440,10 @@ int uv__udp_check_before_send(uv_udp_t* handle, const struct sockaddr* addr) { - if (addr != NULL) { - if (addr->sa_family == AF_INET) - addrlen = sizeof(struct sockaddr_in); -+#ifndef __serenity__ - else if (addr->sa_family == AF_INET6) - addrlen = sizeof(struct sockaddr_in6); -+#endif - #if defined(AF_UNIX) && !defined(_WIN32) - else if (addr->sa_family == AF_UNIX) - addrlen = sizeof(struct sockaddr_un); diff --git a/Ports/cmake/patches/0021-libcurl-no-ipv6.patch b/Ports/cmake/patches/0021-libcurl-no-ipv6.patch deleted file mode 100644 index 0a1fe87de71..00000000000 --- a/Ports/cmake/patches/0021-libcurl-no-ipv6.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/Utilities/cmcurl/lib/curl_config.h.cmake b/Utilities/cmcurl/lib/curl_config.h.cmake -index c321f4e..7e20d2c 100644 ---- a/Utilities/cmcurl/lib/curl_config.h.cmake -+++ b/Utilities/cmcurl/lib/curl_config.h.cmake -@@ -103,7 +103,7 @@ - #cmakedefine EGD_SOCKET ${EGD_SOCKET} - - /* Define if you want to enable IPv6 support */ --#cmakedefine ENABLE_IPV6 1 -+/* #cmakedefine ENABLE_IPV6 1 */ - - /* Define to the type qualifier of arg 1 for getnameinfo. */ - #cmakedefine GETNAMEINFO_QUAL_ARG1 ${GETNAMEINFO_QUAL_ARG1} -diff --git a/Utilities/cmcurl/lib/connect.c b/Utilities/cmcurl/lib/connect.c -index b000b1b..e373e02 100644 ---- a/Utilities/cmcurl/lib/connect.c -+++ b/Utilities/cmcurl/lib/connect.c -@@ -1336,8 +1336,10 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */ - - conn->tempfamily[0] = conn->tempaddr[0]? - conn->tempaddr[0]->ai_family:0; -+#ifdef ENABLE_IPV6 - conn->tempfamily[1] = conn->tempfamily[0] == AF_INET6 ? - AF_INET : AF_INET6; -+#endif - ainext(conn, 1, FALSE); /* assigns conn->tempaddr[1] accordingly */ - - DEBUGF(infof(data, "family0 == %s, family1 == %s\n", diff --git a/Ports/cmake/patches/ReadMe.md b/Ports/cmake/patches/ReadMe.md index 571c7cf5c2b..071351c37ad 100644 --- a/Ports/cmake/patches/ReadMe.md +++ b/Ports/cmake/patches/ReadMe.md @@ -161,26 +161,6 @@ We don't have `SO_LINGER` or its associated struct. This patch removes them. - [X] Resolves issue(s) with our side of things - [X] Hack -## `0020-libuv-ipv6.patch` - -cmlibuv assumes the platform has definitions for (and supports) IPv6; this patch removes IPv6-specific things from libuv. - -### Status -- [X] Local? -- [ ] Should be merged to upstream? -- [X] Resolves issue(s) with our side of things -- [ ] Hack - -## `0021-libcurl-no-ipv6.patch` - -libcurl has a IPV6 switch, but uses `AF_INET6` unconditionally in one place. this patch disables IPV6 and makes that one use conditional. - -### Status -- [X] Local? Partially. -- [X] Should be merged to upstream? Partially. -- [X] Resolves issue(s) with our side of things -- [ ] Hack - ## `0022-remove-mutex.patch` and `0024-shared-mutex.patch` We don't have mutexes, and out libstdc++ does not define `std::mutex`.