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 <lockalsash@gmail.com>
This commit is contained in:
Sv. Lockal
2026-05-13 14:57:31 +08:00
parent 9a316291b2
commit a75ed234f7
3 changed files with 38 additions and 4 deletions

View File

@@ -0,0 +1,35 @@
From 72ac6dab9f283d9000ae140fc41908fa3393bc21 Mon Sep 17 00:00:00 2001
From: Max Zhen <max.zhen@amd.com>
Date: Mon, 13 Apr 2026 16:24:04 -0700
Subject: [PATCH] fix compilation errors with gcc 16
Signed-off-by: Max Zhen <max.zhen@amd.com>
--- 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;

View File

@@ -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"

View File

@@ -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
}