[FFmpeg-devel] [PATCH] configure: don't use dangling temp file state

Kacper Michajłow kasper93 at gmail.com
Tue Jul 22 01:11:59 EEST 2025


There was implicit assumption that the $TMPC file is empty when doing
--cpu=host checks. This breaks if any check is done before that.

Since this is only for GCC/Clang instead of clearing the temp file, just
use pipe input.

Signed-off-by: Kacper Michajłow <kasper93 at gmail.com>
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index ed6430ea32..adf95be630 100755
--- a/configure
+++ b/configure
@@ -5297,7 +5297,7 @@ if test "$cpu" = host; then
     case "$cc_type" in
         gcc|llvm_gcc)
             check_native(){
-                $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
+                $cc $1=native -v -c -o $TMPO -x c -pipe - >$TMPE 2>&1 < /dev/null || return
                 sed -n "/cc1.*$1=/{
                             s/.*$1=\\([^ ]*\\).*/\\1/
                             p
@@ -5308,7 +5308,7 @@ if test "$cpu" = host; then
         ;;
         clang)
             check_native(){
-                $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
+                $cc $1=native -v -c -o $TMPO -x c -pipe - >$TMPE 2>&1 < /dev/null || return
                 sed -n "/cc1.*-target-cpu /{
                             s/.*-target-cpu \\([^ ]*\\).*/\\1/
                             p
-- 
2.50.1



More information about the ffmpeg-devel mailing list