<pre style='margin:0'>
Daniel J. Luke (danielluke) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/8e7082b0bc30528a4e255874eac484ffe2765099">https://github.com/macports/macports-ports/commit/8e7082b0bc30528a4e255874eac484ffe2765099</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 8e7082b0bc30528a4e255874eac484ffe2765099
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Sat Feb 19 02:28:03 2022 +1100
<span style='display:block; white-space:pre;color:#404040;'> bind9: fix build on older systems
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Make sure a compiler with atomic builtins is used, and fix issues with
</span><span style='display:block; white-space:pre;color:#404040;'> detecting and using them.
</span>---
net/bind9/Portfile | 8 ++++++--
net/bind9/files/atomics.patch | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 2 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/net/bind9/Portfile b/net/bind9/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 4128012fde2..c4a056987ee 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/net/bind9/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/net/bind9/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2,6 +2,7 @@
</span>
PortSystem 1.0
PortGroup legacysupport 1.0
<span style='display:block; white-space:pre;background:#e0ffe0;'>+PortGroup compiler_blacklist_versions 1.0
</span>
name bind9
version 9.18.0
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -49,10 +50,13 @@ depends_lib path:lib/libssl.dylib:openssl \
</span> universal_variant \
no
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# Needs working __atomic_* builtins
</span> compiler.blacklist \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- gcc-4.2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ gcc-4.2 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {clang < 500}
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles configure.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles atomics.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.patch
</span>
# tests require `sudo bin/tests/system/ifconfig.sh up`
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/net/bind9/files/atomics.patch b/net/bind9/files/atomics.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..8a53d4d8636
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/net/bind9/files/atomics.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,40 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Allow use of gcc-style __atomic* builtins in older clang versions.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Avoid use of const pointers with atomic_load because strictly C11
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+compliant compilers error on this. Using const became allowed in C17:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2244.htm#dr_459
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib/isc/include/isc/stdatomic.h.orig 2022-01-24 19:28:57.000000000 +1100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib/isc/include/isc/stdatomic.h 2022-02-19 00:40:48.000000000 +1100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -21,7 +21,9 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif /* HAVE_UCHAR_H */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* GCC 4.7.0 introduced __atomic builtins, but not the __GNUC_ATOMICS define */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if !defined(__GNUC_ATOMICS) && __GNUC__ == 4 && __GNUC_MINOR__ >= 7
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* Clang 3.1 and later have the builtins but none define __GNUC_ATOMICS */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !defined(__GNUC_ATOMICS) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 7) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ || defined(__clang__))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define __GNUC_ATOMICS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- ./lib/isc/netmgr/netmgr-int.h.orig 2022-01-24 19:28:57.000000000 +1100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./lib/isc/netmgr/netmgr-int.h 2022-02-19 02:03:23.000000000 +1100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -233,7 +233,7 @@ typedef struct isc__networker {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define NMHANDLE_MAGIC ISC_MAGIC('N', 'M', 'H', 'D')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define VALID_NMHANDLE(t) \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (ISC_MAGIC_VALID(t, NMHANDLE_MAGIC) && \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- atomic_load(&(t)->references) > 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ atomic_load((isc_refcount_t *)&(t)->references) > 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ typedef void (*isc__nm_closecb)(isc_nmhandle_t *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ typedef struct isc_nm_http_session isc_nm_http_session_t;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib/isc/netmgr/http.c.orig 2022-01-24 19:28:57.000000000 +1100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib/isc/netmgr/http.c 2022-02-19 02:13:12.000000000 +1100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1651,7 +1651,7 @@ find_server_request_handler(const char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ REQUIRE(VALID_NMSOCK(serversocket));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (atomic_load(&serversocket->listening)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (atomic_load((atomic_bool *)&serversocket->listening)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ handler = http_endpoints_find(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ request_path, serversocket->h2.listener_endpoints);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span></pre><pre style='margin:0'>
</pre>