Opened 2 months ago

Closed 2 months ago

#10900 closed defect (wontfix)

unable to build v6.1.1 without pthreads.

Reported by: glennmcc Owned by:
Priority: normal Component: undetermined
Version: 6.1 Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Gyan)

root@glennmcc-i7:~/build/ffmpeg-6.1.1# ./configure --disable-pthreads

root@glennmcc-i7:~/build/ffmpeg-6.1.1# time make

Even tho I disabled pthreads.... it still got these errors and it did not build ffmpeg, ffprobe, ffplay for Linux.

In file included from libavcodec/vulkan.c:19:
./libavutil/vulkan.c: In function 'ff_vk_exec_pool_free':
./libavutil/vulkan.c:267:9: error: implicit declaration of function 'pthread_mutex_destroy'; did you mean 'ff_mutex_destroy'? [-Werror=implicit-function-declaration]
267 | pthread_mutex_destroy(&e->lock);
|
| ff_mutex_destroy
./libavutil/vulkan.c: In function 'ff_vk_exec_pool_init':
./libavutil/vulkan.c:410:15: error: implicit declaration of function 'pthread_mutex_init' [-Werror=implicit-function-declaration]
410 | err = pthread_mutex_init(&e->lock, NULL);
|
~
./libavutil/vulkan.c: In function 'ff_vk_exec_wait':
./libavutil/vulkan.c:507:5: error: implicit declaration of function 'pthread_mutex_lock' [-Werror=implicit-function-declaration]
507 | pthread_mutex_lock(&e->lock);
| ~
./libavutil/vulkan.c:510:5: error: implicit declaration of function 'pthread_mutex_unlock'; did you mean 'ff_mutex_unlock'? [-Werror=implicit-function-declaration]
510 | pthread_mutex_unlock(&e->lock);
|
~
| ff_mutex_unlock
cc1: some warnings being treated as errors
make: * [ffbuild/common.mak:81: libavcodec/vulkan.o] Error 1

Change History (3)

comment:1 by Gyan, 2 months ago

Description: modified (diff)
Status: newopen

ffmpeg has required threading support since 760ce4bc0bd11f74f0851c0a662dd5cae888df83 (Jul 2022)

The vulkan make failure looks to be an oversight in the configure script but threading is required for vulkan as well.

comment:2 by glennmcc, 2 months ago

For those questioning why I'm trying to build without threads.

This all came about while building newer versions of
both FFMPEG.EXE & FFPROBE.EXE for DOS using the DJGPP cross compiler
running on slackware Linux 64bit.

The following build script works perfectly for all the way up to v5.1.4

--- build-ffmpeg.sh ---

#!/bin/bash

# Set the DJGPP_PREFIX variable to the root directory of the DJGPP cross-compiler toolchain
export DJGPP_PREFIX="/archives-a/build/djgpp"
export PATH="$DJGPP_PREFIX/bin:$PATH"
export LIB="$DJGPP_PREFIX/lib/"
export GCC_EXEC_PREFIX="$DJGPP_PREFIX/lib/gcc/"
export INCLUDE="$DJGPP_PREFIX/include/"

# Define the target architecture by appending "/bin/i586-pc-msdosdjgpp" to the DJGPP_PREFIX
TARGET_ARCH="${DJGPP_PREFIX}/i586-pc-msdosdjgpp/bin/"

# Add the DJGPP_PREFIX/bin directory to the beginning of the PATH environment variable
export PATH="${DJGPP_PREFIX}/bin:$PATH"

# Define the version of FFmpeg to download
FFMPEG_VERSION="$1"

# Define the URL of the FFmpeg archive to download
FFMPEG_ARCHIVE="https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz"

# Define the directory name where FFmpeg source will be extracted
FFMPEG_SOURCE_DIR="ffmpeg-${FFMPEG_VERSION}"

# Download the FFmpeg archive
wget -c "$FFMPEG_ARCHIVE"

# Remove any existing directory with the same name as FFMPEG_SOURCE_DIR
rm -rf "$FFMPEG_SOURCE_DIR"

# Extract the FFmpeg source from the downloaded archive
tar -xf "ffmpeg-${FFMPEG_VERSION}.tar.gz"

# Change the current directory to the FFmpeg source directory
cd $FFMPEG_SOURCE_DIR

# Run the configure script with specific options to prepare FFmpeg for cross-compilation
./configure \

--enable-cross-compile \
--cc="${TARGET_ARCH}gcc" \
--cxx="${TARGET_ARCH}g++" \
--ar="${TARGET_ARCH}ar" \
--as="${TARGET_ARCH}as" \
--ranlib="${TARGET_ARCH}ranlib" \
--sysroot="${DJGPP_PREFIX}" \
--disable-debug \
--arch=i486 \
--cpu=i486 \
--target-os=ms-dos \
--disable-doc \
--enable-gpl \
--disable-txtpages \
--extra-cflags="-w" \
--disable-pthreads \
--disable-vulkan

# Compile FFmpeg with multiple jobs, using the number of available processors
make -j$(nproc) 2>../1errors.txt

_

However, in the v6.x branch, even with that addition of --disable-vulkan,
as a result of Gyan pointing-out that vulkan requires threads,
only FFPROBE.EXE gets built and not FFMPEG.EXE

Therefore, there seem to be a whole bunch of items in the 6.x branch
that now require threads.

So for now, we old DOS diehards seem to be 'frozen' at v5.1.4

comment:3 by Gyan, 2 months ago

Resolution: wontfix
Status: openclosed

Vulkan threads dep check added in 9e8be937fc4933ade00a18578f8c1420006d4291

ffmpeg threads dep won't be reverted.

Note: See TracTickets for help on using tickets.