PR #23312 opened by Diego de Souza (ddesouza)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23312
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23312.patch

The device-only compilation path of vf_scale_cuda.h pulled in <stdint.h>
solely to obtain uint8_t for the CUdeviceptr typedef. On Windows-on-ARM
(aarch64 mingw) this drags in _mingw.h, whose ARM __prefetch intrinsic is
guarded by !__has_builtin(__prefetch). During clang's --cuda-device-only
pass __has_builtin has deferred/inconsistent semantics on the auxiliary
(host) target, so the guard mis-fires, the inline __prefetch definition is
emitted, and clang rejects it:

    _mingw.h: error: definition of builtin function '__prefetch'

This broke the msys2-clangarm64 FATE slot once ffnvcodec (and thus the
nvcc-compiled CUDA filters) was enabled for aarch64 Windows.

uint8_t is unsigned char, so use that directly and drop the <stdint.h>
include. Device-only code should not depend on the host C runtime headers.
No functional or ABI change.

Signed-off-by: Diego de Souza <[email protected]>


>From 8b2992fdddffd7f6cccb85a6bc9186a793d263c8 Mon Sep 17 00:00:00 2001
From: Diego de Souza <[email protected]>
Date: Tue, 2 Jun 2026 15:52:27 +0200
Subject: [PATCH] avfilter/vf_scale_cuda: avoid <stdint.h> in CUDA device
 compilation

The device-only compilation path of vf_scale_cuda.h pulled in <stdint.h>
solely to obtain uint8_t for the CUdeviceptr typedef. On Windows-on-ARM
(aarch64 mingw) this drags in _mingw.h, whose ARM __prefetch intrinsic is
guarded by !__has_builtin(__prefetch). During clang's --cuda-device-only
pass __has_builtin has deferred/inconsistent semantics on the auxiliary
(host) target, so the guard mis-fires, the inline __prefetch definition is
emitted, and clang rejects it:

    _mingw.h: error: definition of builtin function '__prefetch'

This broke the msys2-clangarm64 FATE slot once ffnvcodec (and thus the
nvcc-compiled CUDA filters) was enabled for aarch64 Windows.

uint8_t is unsigned char, so use that directly and drop the <stdint.h>
include. Device-only code should not depend on the host C runtime headers.
No functional or ABI change.

Signed-off-by: Diego de Souza <[email protected]>
---
 libavfilter/vf_scale_cuda.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavfilter/vf_scale_cuda.h b/libavfilter/vf_scale_cuda.h
index 81fd8061e3..d685f73072 100644
--- a/libavfilter/vf_scale_cuda.h
+++ b/libavfilter/vf_scale_cuda.h
@@ -24,9 +24,8 @@
 #define AVFILTER_SCALE_CUDA_H
 
 #if defined(__CUDACC__) || defined(__CUDA__)
-#include <stdint.h>
 typedef cudaTextureObject_t CUtexObject;
-typedef uint8_t* CUdeviceptr;
+typedef unsigned char* CUdeviceptr;
 #else
 #include <ffnvcodec/dynlink_cuda.h>
 #endif
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to