From 90fb08dfffe6bcb27afb4c3527a5e046f336e442 Mon Sep 17 00:00:00 2001 From: s Date: Tue, 31 Oct 2023 08:46:37 +0800 Subject: [PATCH] fix clang build error: _Atomic --- bind-dyndb-ldap-fix-clang-atomic.patch | 69 ++++++++++++++++++++++++++ bind-dyndb-ldap.spec | 11 +++- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 bind-dyndb-ldap-fix-clang-atomic.patch diff --git a/bind-dyndb-ldap-fix-clang-atomic.patch b/bind-dyndb-ldap-fix-clang-atomic.patch new file mode 100644 index 0000000..a5408ff --- /dev/null +++ b/bind-dyndb-ldap-fix-clang-atomic.patch @@ -0,0 +1,69 @@ +From 1216b4dc222ac584822128bf89bbcee1c1c6dc61 Mon Sep 17 00:00:00 2001 +From: hleft +Date: Tue, 31 Oct 2023 08:39:39 +0800 +Subject: [PATCH] fix clang build error: _Atomic + +error: address argument to atomic operation must be a pointer to _Atomic type ('isc_refcount_t *' (aka 'unsigned long *') invalid) + +--- + src/ldap_driver.c | 2 +- + src/ldap_helper.c | 2 +- + src/mldap.c | 2 +- + src/syncrepl.c | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/ldap_driver.c b/src/ldap_driver.c +index e4aeeb2..3a6618b 100644 +--- a/src/ldap_driver.c ++++ b/src/ldap_driver.c +@@ -69,7 +69,7 @@ ldapdb_associate(isc_mem_t *mctx, node_name_t *name, dns_dbtype_t type, + + struct ldapdb { + dns_db_t common; +- isc_refcount_t refs; ++ _Atomic isc_refcount_t refs; + ldap_instance_t *ldap_inst; + + /** +diff --git a/src/ldap_helper.c b/src/ldap_helper.c +index acabd31..c765ce6 100644 +--- a/src/ldap_helper.c ++++ b/src/ldap_helper.c +@@ -166,7 +166,7 @@ struct ldap_instance { + isc_thread_t watcher; + bool exiting; + /* Non-zero if this instance is 'tainted' by an unrecoverable problem. */ +- isc_refcount_t errors; ++ _Atomic isc_refcount_t errors; + + /* Settings. */ + settings_set_t *local_settings; +diff --git a/src/mldap.c b/src/mldap.c +index 0bc2d33..2e1fe4f 100644 +--- a/src/mldap.c ++++ b/src/mldap.c +@@ -65,7 +65,7 @@ static dns_name_t uuid_rootname = + struct mldapdb { + isc_mem_t *mctx; + metadb_t *mdb; +- isc_refcount_t generation; ++ _Atomic isc_refcount_t generation; + }; + + +diff --git a/src/syncrepl.c b/src/syncrepl.c +index f94379c..ced2491 100644 +--- a/src/syncrepl.c ++++ b/src/syncrepl.c +@@ -87,7 +87,7 @@ static const isc_interval_t shutdown_timeout = { 3, 0 }; + * @see ldap_sync_search_entry() + */ + struct sync_ctx { +- isc_refcount_t task_cnt; /**< provides atomic access */ ++ _Atomic isc_refcount_t task_cnt; /**< provides atomic access */ + isc_mem_t *mctx; + /** limit number of unprocessed LDAP events in queue + * (memory consumption is one of problems) */ +-- +2.42.0 + diff --git a/bind-dyndb-ldap.spec b/bind-dyndb-ldap.spec index dc579b6..b098db9 100644 --- a/bind-dyndb-ldap.spec +++ b/bind-dyndb-ldap.spec @@ -5,7 +5,7 @@ Name: bind-dyndb-ldap Version: 11.10 -Release: 1 +Release: 2 Summary: LDAP back-end plug-in for BIND License: GPLv2+ URL: https://releases.pagure.org/bind-dyndb-ldap @@ -16,6 +16,9 @@ Patch1: bind-dyndb-ldap-bind-9.18.10-db-options.patch Patch2: bind-dyndb-ldap-bind-9.18.10-logs.patch Patch3: bind-dyndb-ldap-bind-9.18.10-staleok.patch Patch4: bind-dyndb-ldap-11.10-bind-9.18.11.patch +%if "%toolchain" == "clang" +Patch5: bind-dyndb-ldap-fix-clang-atomic.patch +%endif BuildRequires: bind-devel >= %{bind_version} BuildRequires: krb5-devel @@ -96,6 +99,12 @@ sed -i.bak -e "$SEDSCRIPT" /etc/named.conf %changelog +* Mon Oct 30 2023 yoo - 11.10-2 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix clang build error: _Atomic + * Sun Jan 29 2023 xinghe - 11.10-1 - Type:requirement - CVE:NA -- Gitee