From a75ed234f79e21853e43b102d32656b7f0bb2747 Mon Sep 17 00:00:00 2001 From: "Sv. Lockal" Date: Wed, 13 May 2026 14:57:31 +0800 Subject: [PATCH] dev-libs/xrt-xdna: fix compilation with gcc-16 and clang * 2.21.75 - backport patch from upstream * 999999 - remove -Werror (causes failures with clang) Closes: https://bugs.gentoo.org/974727 Signed-off-by: Sv. Lockal --- .../files/xrt-xdna-2.21.75-gcc-16.patch | 35 +++++++++++++++++++ dev-libs/xrt-xdna/xrt-xdna-2.21.75-r1.ebuild | 1 + dev-libs/xrt-xdna/xrt-xdna-999999.ebuild | 6 ++-- 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 dev-libs/xrt-xdna/files/xrt-xdna-2.21.75-gcc-16.patch diff --git a/dev-libs/xrt-xdna/files/xrt-xdna-2.21.75-gcc-16.patch b/dev-libs/xrt-xdna/files/xrt-xdna-2.21.75-gcc-16.patch new file mode 100644 index 0000000000..ac62e34226 --- /dev/null +++ b/dev-libs/xrt-xdna/files/xrt-xdna-2.21.75-gcc-16.patch @@ -0,0 +1,35 @@ +From 72ac6dab9f283d9000ae140fc41908fa3393bc21 Mon Sep 17 00:00:00 2001 +From: Max Zhen +Date: Mon, 13 Apr 2026 16:24:04 -0700 +Subject: [PATCH] fix compilation errors with gcc 16 + +Signed-off-by: Max Zhen +--- a/src/shim/umq/dbg_hwq.cpp ++++ b/src/shim/umq/dbg_hwq.cpp +@@ -95,8 +95,8 @@ submit() + *m_dbg_umq_comp_ptr = 0; + + /* Issue mfence instruction to make sure all writes to the slot before is done */ +- std::atomic_thread_fence(std::memory_order::memory_order_seq_cst); +- m_dbg_umq_hdr->write_index++; ++ std::atomic_thread_fence(std::memory_order_seq_cst); ++ m_dbg_umq_hdr->write_index = m_dbg_umq_hdr->write_index + 1; + + shim_debug("dbg umq: submit cmd widx: %lu ridx: %lu", + m_dbg_umq_hdr->write_index, +--- a/src/shim/umq/hwq.cpp ++++ b/src/shim/umq/hwq.cpp +@@ -226,10 +226,11 @@ issue_single_exec_buf(const cmd_buffer *cmd_bo, bool last_of_chain) + // TODO: remove once uC stops looking at and updating this field. + hdr->common_header.type = HOST_QUEUE_PACKET_TYPE_VENDOR_SPECIFIC; + // Issue mfence instruction to make sure all writes to the slot before is done. +- std::atomic_thread_fence(std::memory_order::memory_order_seq_cst); ++ std::atomic_thread_fence(std::memory_order_seq_cst); + // Indicates the slot is ready for processing by uC. + // Must be the last step after pkt is filled up. +- uint64_t wi = m_umq_hdr->write_index++; ++ uint64_t wi = m_umq_hdr->write_index; ++ m_umq_hdr->write_index = wi + 1; + + // Wake up uC in case it is sleeping and waiting. + *m_mapped_doorbell = 0; diff --git a/dev-libs/xrt-xdna/xrt-xdna-2.21.75-r1.ebuild b/dev-libs/xrt-xdna/xrt-xdna-2.21.75-r1.ebuild index 92f791e604..e9e2a3fca2 100644 --- a/dev-libs/xrt-xdna/xrt-xdna-2.21.75-r1.ebuild +++ b/dev-libs/xrt-xdna/xrt-xdna-2.21.75-r1.ebuild @@ -77,6 +77,7 @@ BDEPEND+=" PATCHES=( "${FILESDIR}"/${PN}-0_p20251025-fix-clang.patch + "${FILESDIR}"/${PN}-2.21.75-gcc-16.patch ) CONFIG_CHECK="~AMD_IOMMU ~DRM_ACCEL" diff --git a/dev-libs/xrt-xdna/xrt-xdna-999999.ebuild b/dev-libs/xrt-xdna/xrt-xdna-999999.ebuild index 92f791e604..7fad1086f5 100644 --- a/dev-libs/xrt-xdna/xrt-xdna-999999.ebuild +++ b/dev-libs/xrt-xdna/xrt-xdna-999999.ebuild @@ -75,10 +75,6 @@ BDEPEND+=" ") " -PATCHES=( - "${FILESDIR}"/${PN}-0_p20251025-fix-clang.patch -) - CONFIG_CHECK="~AMD_IOMMU ~DRM_ACCEL" python_check_deps() { @@ -139,6 +135,8 @@ src_prepare() { sed -e "s/set (XRT_UPSTREAM 0)/set (XRT_UPSTREAM 1)/" -i xrt/src/CMake/settings.cmake || die + sed -e 's/"-Werror"//' -i src/shim/CMakeLists.txt || die + cmake_src_prepare }