#9909 closed defect (fixed)

MSVC build failure on Windows when using assembly optimizations

Reported by: chocky Owned by: Carl Eugen Hoyos
Priority: important Component: avcodec
Version: git-master Keywords: msvc regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

I am unable to build recent versions of FFmpeg with MSVC on Windows using the msys environment, when using assembly optimizations. Previously I was able to compile FFmpeg when following the MSVC compilation guide.

I have gone back through previous code snapshots on the master branch, and it seems to be the changes on 2022-06-22 which have introduced the issue. Snapshots prior to this build OK with assembly optimisations using MSVC.

I am using Windows 10 Pro (19044.1889) and Microsoft Visual Studio 2022 (v17.3.3).

The steps that I used to reproduce the issue (following the MSVC compilation guide):
Install msys environment.
Launch a Visual Studio Developer Command Prompt and run vcvarsall.bat amd64.
From the developer command prompt, run msys2_shell.
From the msys terminal, install required packages (one time setup):
pacman -S make
pacman -S yasm
pacman -S diffutils
Set up the appropriate tools path in msys terminal (for a 64bit build):
export PATH="/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.33.31629/bin/HostX64/x64":$PATH

When using the following configuration, make hangs:
./configure --target-os=win64 --arch=x86_64 --disable-programs --enable-shared --disable-static --toolchain=msvc

By hang, I mean that compilation reaches this stage but does not progress:
LD libavcodec/avcodec-59.dll

Creating library libavcodec/avcodec.lib and object libavcodec/avcodec.exp

At this point it seems as if link.exe has locked up, and pressing Ctrl+C results in:
make: * Deleting file 'libavcodec/avcodec-59.dll'
make: unlink: libavcodec/avcodec-59.dll: Device or resource busy

Note that if I use a configuration with the --disable-asm flag, make succeeds:
./configure --target-os=win64 --arch=x86_64 --disable-programs --enable-shared --disable-static --toolchain=msvc --disable-asm

Change History (4)

comment:1 by Carl Eugen Hoyos, 20 months ago

Component: build systemavcodec
Keywords: msvc regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen

Regression since bfb28b5ce89f3e950214b67ea95b45e3355c2caf, patch sent.

comment:2 by Balling, 20 months ago

https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20220911/42750024/attachment.obj

This time not even on patchwork. Never send patches in "Re:", bug of patchwork, I think.

comment:3 by Balling, 20 months ago

Owner: set to Carl Eugen Hoyos

When are you going to apply this? You have commit access...

comment:4 by Carl Eugen Hoyos, 19 months ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.