Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 918989 - media-video/ffmpeg-6.1: configure fails with missing spirv_compiler when USE=glslang set
Summary: media-video/ffmpeg-6.1: configure fails with missing spirv_compiler when USE=...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords: PATCH
: 922449 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-12-01 21:05 UTC by B. Gazotti
Modified: 2024-04-12 17:29 UTC (History)
10 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info output (info.txt,8.40 KB, text/plain)
2023-12-01 21:05 UTC, B. Gazotti
Details
emerge log (build.log,6.56 KB, text/plain)
2023-12-02 00:28 UTC, B. Gazotti
Details
config.log (config.log,492.78 KB, text/plain)
2023-12-02 00:28 UTC, B. Gazotti
Details
patch from the ffmpeg ML (ffmpeg.patch,2.81 KB, patch)
2024-02-29 08:40 UTC, Mark
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description B. Gazotti 2023-12-01 21:05:27 UTC
Created attachment 876263 [details]
emerge --info output

Setting the glslang flag causes the merge to fail during the abi_x86_32 configure stage. Build proceeds as usual without errors with USE=-glslang.

Current USE="X alsa cpudetection dav1d doc encode gpl iconv lcms libdrm lv2 mp3 network opencl opengl openssl postproc pulseaudio sdl svg threads truetype vaapi vorbis vulkan x264 x265 xvid zlib" ABI_X86="32 64"

Relevant portion of config.log:

test_cc
BEGIN /tmp/portage/media-video/ffmpeg-6.1/temp/ffconf.OyvtunbL/test.c
    1	#include <glslang/Include/glslang_c_interface.h>
    2	#include <stdint.h>
    3	long check_glslang_initialize_process(void) { return (long) glslang_initialize_process; }
    4	int main(void) { int ret = 0;
    5	ret |= ((intptr_t)check_glslang_initialize_process) & 0xFFFF;
    6	return ret; }
END /tmp/portage/media-video/ffmpeg-6.1/temp/ffconf.OyvtunbL/test.c
gcc -m32 -mfpmath=sse -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -march=bdver2 -O2 -ftree-vectorize -fsched-pressure -march=bdver2 -std=c11 -fPIC -pthread -I/usr/include/lilv-0 -I/usr/include/serd-0 -I/usr/include/sord-0 -I/usr/include/sratom-0 -I/usr/include/libdrm -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -c -o /tmp/portage/media-video/ffmpeg-6.1/temp/ffconf.OyvtunbL/test.o /tmp/portage/media-video/ffmpeg-6.1/temp/ffconf.OyvtunbL/test.c
gcc -m32 -mfpmath=sse -Wl,--as-needed,-O2 -fuse-ld=lld -march=bdver2 -Wl,--as-needed -Wl,-z,noexecstack -o /tmp/portage/media-video/ffmpeg-6.1/temp/ffconf.OyvtunbL/test /tmp/portage/media-video/ffmpeg-6.1/temp/ffconf.OyvtunbL/test.o -lglslang -lMachineIndependent -lOSDependent -lHLSL -lOGLCompiler -lGenericCodeGen -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm
ld.lld: error: unable to find library -lSPIRV-Tools-opt
ld.lld: error: unable to find library -lSPIRV-Tools
collect2: error: ld returned 1 exit status
require spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process -lglslang -lOSDependent -lHLSL -lOGLCompiler -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm
check_lib spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process -lglslang -lOSDependent -lHLSL -lOGLCompiler -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm
check_func_headers glslang/Include/glslang_c_interface.h glslang_initialize_process -lglslang -lOSDependent -lHLSL -lOGLCompiler -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm
test_ld cc -lglslang -lOSDependent -lHLSL -lOGLCompiler -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm
test_cc
BEGIN /tmp/portage/media-video/ffmpeg-6.1/temp/ffconf.OyvtunbL/test.c
    1	#include <glslang/Include/glslang_c_interface.h>
    2	#include <stdint.h>
    3	long check_glslang_initialize_process(void) { return (long) glslang_initialize_process; }
    4	int main(void) { int ret = 0;
    5	ret |= ((intptr_t)check_glslang_initialize_process) & 0xFFFF;
    6	return ret; }
END /tmp/portage/media-video/ffmpeg-6.1/temp/ffconf.OyvtunbL/test.c
gcc -m32 -mfpmath=sse -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -march=bdver2 -O2 -ftree-vectorize -fsched-pressure -march=bdver2 -std=c11 -fPIC -pthread -I/usr/include/lilv-0 -I/usr/include/serd-0 -I/usr/include/sord-0 -I/usr/include/sratom-0 -I/usr/include/libdrm -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -c -o /tmp/portage/media-video/ffmpeg-6.1/temp/ffconf.OyvtunbL/test.o /tmp/portage/media-video/ffmpeg-6.1/temp/ffconf.OyvtunbL/test.c
gcc -m32 -mfpmath=sse -Wl,--as-needed,-O2 -fuse-ld=lld -march=bdver2 -Wl,--as-needed -Wl,-z,noexecstack -o /tmp/portage/media-video/ffmpeg-6.1/temp/ffconf.OyvtunbL/test /tmp/portage/media-video/ffmpeg-6.1/temp/ffconf.OyvtunbL/test.o -lglslang -lOSDependent -lHLSL -lOGLCompiler -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm
ld.lld: error: unable to find library -lSPIRV-Tools-opt
ld.lld: error: unable to find library -lSPIRV-Tools
collect2: error: ld returned 1 exit status
ERROR: spirv_compiler not found

Did some digging, dev-util/spirv-tools was installed but only for ABI_X86_64. Rebuilt it for both 32 and 64 bits and merge proceeded normally with USE=glslang. I'm guessing a missing multilib dependency in the ebuild?
Comment 1 Leonardo Hernández Hernández 2023-12-01 23:41:33 UTC
Please include the full build.log and in this case also the full config.log
Comment 2 B. Gazotti 2023-12-02 00:28:13 UTC
Created attachment 876276 [details]
emerge log
Comment 3 B. Gazotti 2023-12-02 00:28:51 UTC
Created attachment 876277 [details]
config.log
Comment 4 Rafael Kitover 2024-01-18 23:34:43 UTC
*** Bug 922449 has been marked as a duplicate of this bug. ***
Comment 5 Mark 2024-01-25 16:49:15 UTC
Maybe it helps, I found this forum entry:
https://www.linuxquestions.org/questions/slackware-14/regression-on-current-with-ffmpeg-4175728462/
And this ffmpeg mailing list entry:
https://ffmpeg.org/pipermail/ffmpeg-devel/2024-January/319892.html

I tried ffmpeg-9999 in hope that the patch is included (I did not check it; the build fails with the same error btw) and I noticed we don't have glslang 14 on gentoo, which is the version the mailing list entry talks about.

So I tried to unmask glslang-9999 and got into a big web of masked vulkan and spirv packages and couldn't untangle it to try out if more recent software solves the problem.

It ffmpeg worked with glslang-1.3.268, but that cannot be installed while simultaneously having llvm-17, because dev-util/spirv-llvm-translator-17.0.0-r2 requires glslang-1.3.275.
An older ebuild of spirv-llvm-translator-17.0.0 (was it -r1?) worked with glslang-1.3.268 but was removed from the portage tree.
Comment 6 Alexander Maltsev 2024-01-27 05:53:55 UTC
Thanks Mark, patch from https://ffmpeg.org/pipermail/ffmpeg-devel/2024-January/319892.html did work for me with ffmpeg-6.1.1-r2
Comment 7 cyrillic 2024-01-28 18:05:11 UTC
That patch does the trick, thank you.
Comment 8 Mark 2024-02-29 08:40:53 UTC
Created attachment 886244 [details, diff]
patch from the ffmpeg ML

please add the patch, it also works with (and is required for) -r4
Comment 9 Gino McCarty 2024-04-08 15:52:08 UTC
had the same issue with ffmppeg-6.6.1-r5 and applied to /etc/portage/patches fixed the issue.

this is pretty old surprised it hasn't been addressed