Summary: | media-video/ffmpeg-6.1: configure fails with missing spirv_compiler when USE=glslang set | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | B. Gazotti <bgazotti> |
Component: | Current packages | Assignee: | Gentoo Media-video project <media-video> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | AprilGrimoire, bugzilla, cyrilmaley, de.techno, ionen, johannesp, k2k, keltar.gw, leohdz172, leonchik1976, luke5083, mark.j, mark.morschhaeuser, onigino, perfect007gentleman, psal, rkitover, the.paraw, ykonotopov |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=922333 https://bugs.gentoo.org/show_bug.cgi?id=933130 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
emerge --info output
emerge log config.log patch from the ffmpeg ML Ebuild for ffmpeg-6.1.1-r8 including the call to the patch (see comment 12) Patch called by the ebuild for ffmpeg-6.1.1-r8 |
Please include the full build.log and in this case also the full config.log Created attachment 876276 [details]
emerge log
Created attachment 876277 [details]
config.log
*** Bug 922449 has been marked as a duplicate of this bug. *** 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. Thanks Mark, patch from https://ffmpeg.org/pipermail/ffmpeg-devel/2024-January/319892.html did work for me with ffmpeg-6.1.1-r2 That patch does the trick, thank you. Created attachment 886244 [details, diff]
patch from the ffmpeg ML
please add the patch, it also works with (and is required for) -r4
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 ...and media-video/ffmpeg-6.1.1-r5 was somehow stabilized despite this...:sigh:... You could add bug 922333 to duplicates. The relevant upstream commit (only on 7.0 branch and later) is https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/e43615fc2ab27d562ed7e087803f4a364a7d1175. ...however that commit is still incorrect, at least for Gentoo. MachineIndependent and GenericCodeGen are only built as separate libs when glslang isn't built as a shared library. ffmpeg upstream should be notified about this, if they're not aware yet (I don't see any more recent commits on this topic). So, first of all, I can confirm the bug. Next, the bug persisted also with ffmpeg-6.1.1-r5, r6 and now r8. Finally, I fixed it by creating a patch (glslang.patch), putting it in the files dir, and adding a line in the ebuild to call it. With the patch, all versions compile and, so far, work quite well for me. Created attachment 898462 [details] Ebuild for ffmpeg-6.1.1-r8 including the call to the patch (see comment 12) Created attachment 898463 [details, diff]
Patch called by the ebuild for ffmpeg-6.1.1-r8
I just noticed my patch is almost identical to the one first uploaded by Mark in January! Oops... :) Kudos to Mark, I guess. Confirmed. shaderc is a reasonable substitute. *** Bug 948874 has been marked as a duplicate of this bug. *** (In reply to dE from comment #16) > Confirmed. shaderc is a reasonable substitute. On that note, in libplacebo been thinking to drop USE=glslang entirely (see bug #945783, albeit I haven't followed up on that yet) in favour of shaderc given glslang breaks things too often and had about enough of it (shaderc is also preferred upstream, using glslang directly was only a fallback). Arguably dropping it here too or masking could be an option to reduce maintenance burden, esp. for older ffmpeg branches which aren't keeping up. I faced the same bug with media-video/ffmpeg-6.1.2. Still not fixed. (In reply to Karlson2k from comment #19) > I faced the same bug with media-video/ffmpeg-6.1.2. > Still not fixed. I've heard rumors that shaderc is now favored upstream for stability (sorry don't have link). I have since switched over without issue. But yes IMHO this ticket should still be addressed media-video/ffmpeg -glslang shaderc (In reply to Gino McCarty from comment #20) > (In reply to Karlson2k from comment #19) > > I faced the same bug with media-video/ffmpeg-6.1.2. > > Still not fixed. > > I've heard rumors that shaderc is now favored upstream for stability (sorry > don't have link). Don't know if there was a proper discussion somewhere, but when asked to pick or the other, ffmpeg's ./configure tells you to disable libglslang: if enabled_all libglslang libshaderc; then die "ERROR: libshaderc and libglslang are mutually exclusive, if in doubt, disable libglslang" fi Either way will be dropping USE=glslang soon now. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00eddc65d7bd9ecaa9973fd46e544bbbfe5c9479 commit 00eddc65d7bd9ecaa9973fd46e544bbbfe5c9479 Author: Ionen Wolkens <ionen@gentoo.org> AuthorDate: 2025-03-07 13:02:23 +0000 Commit: Ionen Wolkens <ionen@gentoo.org> CommitDate: 2025-03-11 09:03:17 +0000 media-video/ffmpeg: rewrite live ebuild This does not list all changes compared to original due to being essentially a rewrite (not much sense in looking at the diff given almost no lines in common), but to list or explain notable ones: * Cleanup a lot of obsolete logic, like mirror://gentoo snapshots, SCM type, <openssl-3 handling, etc... * Re-arrange IUSE=soc handling to drop the IUSE when FFMPEG_SOC_PATCH is empty until maintainer of the patch has time to look at that (easier to bump without it and removes the need to mask in 9999) * Drop some IUSE, ffmpeg has a bit too many often confusing users and, while debatable, some are not really useful to control bare at most for expert user that could use EXTRA_ECONF if *really* wanted: - debug (disabled): does very little beside override users' -g*, albeit if want nasm debug symbols will need to set X86ASMFLAGS. - encode (enabled): debated keeping it for disabling encoders without their own USE for bit of size/build time reduction despite no dependencies, but feel it is not really worth it as it complicates the ebuild and can break expectations for a lot of revdeps (many likely lack the [encode] that they need) -- removal also handles bug #770439 - fftools_* (disabled): almost no distros install these, many have rather generic names, we were missing installing new ones, upstream ffmpeg does not even have an install target for them, and a global USE_EXPAND for this feels wasteful (*could* consider adding a all-in-one IUSE=tools if some are wanted by users anyway but let us try without and see if anyone complains) - glslang (disabled): redundant with USE=shaderc and is a pain to use directly given glslang often breaks things, esp. worse for packages with a slow release cycle and old LTS versions like ffmpeg (bug #918989, bug #920283, bug #922333, bug #922433) -- upstream also seems to favour shaderc: "libshaderc and libglslang are mutually exclusive, if in doubt, disable libglslang" (from ./configure) - harcoded-tables (disabled): off by default upstream and listed as a "experts only" option that seemingly provide little gains for a notable size increase, do not believe it is worth exposing as a USE - iconv (enabled): virtual/libiconv is essentially free anywhere but prefix and disabling iconv can be rather broken for a few things - network (enabled): no dependencies, fairly small, and many revdeps likely expect it to be enabled and just missing the [network] (tempting to do the same with USE=postproc but it would still be conditional through USE=gpl and be more confusing, and then forcing GPL also has its own issues) - oss (auto): does not have a dedicated option and just checks linux-headers and is very small, hardly anyone need this but that argument could be applied to a *ton* of in/outdevs, filters, de/encoders, and such and we would never see the end of it - pic (enabled): makes little sense not to enable nowadays and handles bug #903754 + bug #916067 -- USE had the secondary effect of disabling x86-32 asm which still doing given it is difficult to support either way due to textrels and >=binutils-2.41's enforcing (bug #916067, bug #920808), and it is possibly broken for older hardware (bug #733556) -- as a minor bonus, this should also let LTO work with abi_x86_32 (bug #654118) - static-libs (disabled): cannot think of much of a use for this esp. given how massive these libraries are and it would still require to link with all its shared-only dependencies - test (irrelevant): tests are not gone but there is no dependencies (bc and wget are not needed) nor REQUIRED_USE to handle anymore, thus USE is useless - threads (auto): no real sense in disabling (bug #868471), and leaving it auto let ffmpeg figure out the right implementation to use which in most cases means default --enable-pthreads - cpu_flags_* + cpudetection (enabled): tentatively anyway, just let ffmpeg do its thing normally -- simplifies the ebuild a lot, "should" fix bug #915384, and also handles whatever ebuild was doing wrong wrt bug #752507 + bug #778035 (one minor "issue" however is that all these flags being removed will leave users confused as to what happened, if reading this and worried about optimizations.. then no they are *not* disabled, and it is fine for other machines thanks to detection at runtime) * New IUSE: - openmpt: requested in bug #921313 - npp: requested in bug #695210 -- note have not tested the arm64 (sbsa) support, but it should work in theory as cuda toolkit does install npp prebuilt arm64 libraries - rabbitmq: trivial, may as well add support (meant to add more but others did not fare as well and will leave for later rather than during big changes, kept some minor notes in the ebuild about things still not supported) * Renamed IUSE: - mp3->lame: this is only for encoding but it made it "sound" needed for decoding (not the only case like this but this one felt too generic), may surprise those that had it actually enabled for encoding - libxml2->xml and libdrm->drm: given newly enabling these by default (see below), it's a good occasion to rename to the more commonly used USE without causing issues - libv4l->v4l: to be precise IUSE=v4l was removed and it gained the meaning that IUSE=libv4l had -- old v4l is always enabled (if linux) due to the hard dependency on linux-headers (see below) -- given the old REQUIRED_USE with libv4l? ( v4l ), all users of libv4l will have the new USE enabled already - libdvdnav+libdvdread->dvd(combined): similar to mpv, simpler for users when they just want dvds to work than worry about each library (dvd support is new in ffmpeg-7, so this only ever been masked) * Enable a few extra IUSE by default that, while not everyone needs, are useful and have dependencies that many users will already have. - libass,truetype,fontconfig: for proper text/subtitles drawing (kdenlive also wants [libass]), albeit video players tend to have their own handling (that pull the same depdencies) - drm: used in various pieces of code and little reason to disable when mesa depends on libdrm either way - xml: needed for DASH-type streams, notably used by youtube, and about everyone has libxml2 (one downside of new defaults is MULTILIB_USEDEP, users that only selectively enable abi_x86_32 rather than globally may be faced with conflicts when updating) * Always depend on linux-headers if linux, not *required* (except for v4l) but this prevents a lot of automagic and going through alternate code paths if missing (also go with >=6 which is needed for v4l2m2m and I believe also USE=soc for v4l2request) * Add missing vulkan-headers dependency wrt bug #865201, and also opencl-headers wrt bug #941506 (not 100% sure that this is what happened for the latter, but given binhost is setup it is likely). * Bump nv-codec-headers min req to 12.1.14.0, while not *required* it spares us for setting up ranges and 11.x is due for cleanup. * Add missing x11-base/xorg-proto wrt bug #934196 -- technically was longer an issue given libX11 RDEPENDs on it "now", but would still rather keep these for now. * Depend on >=librsvg-2.52 wrt bug #918613, USE=svg is not essential for arches without rust and upstream bug been went 1.5 years without activity. * Update REQUIRED_USE a bit, cuda does not *need* nvenc (just get one filter in less), libplacebo does nothing without sdl(ffplay) or vulkan, and few others like these (likely still missing some). * Drop musl HAVE_POSIX_IOCTL workaround, this is automatically set by ./configure since ffmpeg-7.1. However, note that there is another related issue with libv4l (not v4l) that is not fixed (bug #911499). * No longer ignore ffmpeg-spec-disposition test, fixed in 7.1.1. * Fix verify-sig paths on prefix wrt bug #947253 (untested) * No longer pass e.g. --disable-indev=alsa when already doing --disable-alsa, ./configure seem to figure this out just fine. * No longer pass --cpu, this expects the -march=<exact> reported by the compiler or probes compiler with =native if =host), however it does not account for -mno-* both passed or implied by =native and could enable things it shouldn't. Furthermore, it adds -march=<exact> after the users' -march=native (which is more correct, can enable or disable additional features). This option only seem like trouble and likely does not get tested much. Removing also handles bug #830165 albeit ffmpeg-chromium is still affected. * Replace EXTRA_FFMPEG_CONF by EXTRA_ECONF, while it is not using econf nor autoconf, the latter is more widely known while the former needs users to look at the ebuild -- also die if old variable is set so users know about this change. * Skip installing doc/*.txt, that seems mostly oriented at ffmpeg devs, and feels noisy in the docdir, but do keep doc/APIChanges * Replace all *GPL* by the + version given ./configure always output with "or later" when listing the final license. * Maybe not best way to go about this, but when doing incompatible --enable-gpl --enable-nonfree, on top of the RESTRICT="bindist" also add "all-rights-reserved" so a typical freedom ACCEPT_LICENSE can block it. * Rearrange chromium patch a bit to need less ebuild logic, and make it unused for ffmpeg-compat. * Drop EGIT_MIN_CLONE_TYPE, shallow clones seem fine now? If not, could consider just using the official github mirror by default. List of closed bugs may not be complete, plans are to recheck still-open bugs after this is merged. Bug: https://bugs.gentoo.org/830165 Closes: https://bugs.gentoo.org/654118 Closes: https://bugs.gentoo.org/695210 Closes: https://bugs.gentoo.org/733556 Closes: https://bugs.gentoo.org/752507 Closes: https://bugs.gentoo.org/770439 Closes: https://bugs.gentoo.org/778035 Closes: https://bugs.gentoo.org/865201 Closes: https://bugs.gentoo.org/868471 Closes: https://bugs.gentoo.org/903754 Closes: https://bugs.gentoo.org/915384 Closes: https://bugs.gentoo.org/916067 Closes: https://bugs.gentoo.org/918613 Closes: https://bugs.gentoo.org/918989 Closes: https://bugs.gentoo.org/920283 Closes: https://bugs.gentoo.org/920808 Closes: https://bugs.gentoo.org/921313 Closes: https://bugs.gentoo.org/922333 Closes: https://bugs.gentoo.org/922433 Closes: https://bugs.gentoo.org/934196 Closes: https://bugs.gentoo.org/941506 Closes: https://bugs.gentoo.org/947253 Signed-off-by: Ionen Wolkens <ionen@gentoo.org> media-video/ffmpeg/ffmpeg-9999.ebuild | 1014 +++++++++++++--------------- media-video/ffmpeg/files/chromium-r3.patch | 53 ++ media-video/ffmpeg/metadata.xml | 8 + 3 files changed, 538 insertions(+), 537 deletions(-) |
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?