From 29ea615195a0d67499d0bee9f0d76d4729ddbc8e Mon Sep 17 00:00:00 2001 From: Sviatoslav Zubar Date: Tue, 17 Nov 2026 20:53:30 +0100 Subject: [PATCH 1/2] vulkan: pass a C string to GFXSTREAM_INFO for the host memory reason getReason() returns a std::string. Passing it through the variadic GFXSTREAM_INFO() is undefined behavior: the log can show incorrect text or the process can stop. The code is in an _WIN32 block. clang-cl rejects it (-Wnon-pod-varargs), so the Windows CMake build fails. Use getReason().c_str(). Test: Windows CMake build with clang-cl (VS 2026, SDK 10.0.26100), target gfxstream_backend. Assisted-by: Claude Code:Claude-Opus-5.5 --- host/vulkan/vk_common_operations.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host/vulkan/vk_common_operations.cpp b/host/vulkan/vk_common_operations.cpp index 71eccae2c..0fd827227 100644 --- a/host/vulkan/vk_common_operations.cpp +++ b/host/vulkan/vk_common_operations.cpp @@ -1945,7 +1945,7 @@ void VkEmulation::setFeatures(const gfxstream::host::FeatureSet& features) { "Ensure host allocations are aligned to " "avoid VMM errors when mapping."); GFXSTREAM_INFO("Enabling VulkanAllocateHostMemory: %s", - mFeatures.VulkanAllocateHostMemory.getReason()); + mFeatures.VulkanAllocateHostMemory.getReason().c_str()); } } #endif From 2fc39caaebf2f58600e7a1e8c59d071c0abaec05 Mon Sep 17 00:00:00 2001 From: Sviatoslav Zubar Date: Tue, 17 Nov 2026 20:53:30 +0100 Subject: [PATCH 2/2] windows: include sys/time.h before Windows.h in time.cpp sys/time.h includes WinSock2.h. When Windows.h comes first, it includes the older winsock.h, and WinSock2.h then redefines its types. With Windows SDK 10.0.26100 and clang-cl, the Windows CMake build fails in time.cpp ("redefinition of 'sockaddr'"). Include sys/time.h first. Test: clean Windows CMake build with clang-cl (VS 2026, SDK 10.0.26100), default flags, target gfxstream_backend. Assisted-by: Claude Code:Claude-Opus-5.5 --- common/base/windows/src/time.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/base/windows/src/time.cpp b/common/base/windows/src/time.cpp index 25412bdae..f25e2714a 100644 --- a/common/base/windows/src/time.cpp +++ b/common/base/windows/src/time.cpp @@ -12,8 +12,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include +// sys/time.h includes WinSock2.h. It must come before Windows.h, which +// otherwise includes the older winsock.h and the two conflict. #include +#include #include #include