Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 643750 - media-video/ffmpeg fails with USE=chromium on the first install
Summary: media-video/ffmpeg fails with USE=chromium on the first install
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: James Le Cuirot
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-07 00:23 UTC by Rafal Lalik
Modified: 2018-01-18 22:01 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafal Lalik 2018-01-07 00:23:44 UTC
When compiling ffmpeg with USE=chromum for the first time, it fails at compiling chromium support:

make -j2 --quiet V=1 libffmpeg
x86_64-pc-linux-gnu-gcc -shared -Wl,-soname,libffmpeg.so -Wl,-Bsymbolic -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--gc-sections -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,-O1 -Wl,--as-needed  -march=core-avx2 -Wl,--as-needed -Wl,-z,noexecstack -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample  -o libffmpeg.so -Wl,--whole-archive libavcodec/libavcodec.a libavformat/libavformat.a libavutil/libavutil.a libswresample/libswresample.a -Wl,--no-whole-archive -lavdevice -lavfilter -lavformat -lavcodec -lavresample -lpostproc -lswresample -lswscale -lavutil -lXv -lX11 -lXext -lSDL2 -lpulse -lgnutls -lSDL2 -lvdpau -lX11 -lxcb -lxcb-shm -lxcb-xfixes -lxcb-shape -lasound -lSDL2 -lGL -lxvidcore -lx264 -lvpx -lm -lvpx -lm -lvpx -lm -lvpx -lm -lvorbisenc -lvorbis -ltheoraenc -ltheoradec -logg -lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lcairo -lpulse -lopenh264 -lmp3lame -lfreetype -lgnutls -lgmp -lm -ldl -lbz2 -lz -pthread -pthread 
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lavdevice
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lavfilter
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lavresample
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lpostproc
/usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lswscale

Apparently, there are no linking paths to missing libraries, and since 'make' is called with 'libffmpeg', no missing libraries are created before. I believe it was difficult to find the problem because most of the people most likely first installed ffmpeg without support for chromium, and when recompiling with chromium support, there were appropriate libraries in the system location, and linking was working.

One solution would be to call
  make -j2 --quiet V=1
instead of
  make -j2 --quiet V=1 libffmpeg
in chromium/ which will compile all again,

or, to include proper LDFLAGS in chromium/Makefile, e.g.

include /var/tmp/portage/media-video/ffmpeg-3.4.1/work/ffmpeg-3.4.1/Makefile
LDFLAGS += -L../ffmpeg-3.4.1-abi_x86_64.amd64/libavdevice/
LDFLAGS += -L../ffmpeg-3.4.1-abi_x86_64.amd64/libavfilter/
LDFLAGS += -L../ffmpeg-3.4.1-abi_x86_64.amd64/libavresample/
LDFLAGS += -L../ffmpeg-3.4.1-abi_x86_64.amd64/libpostproc/
LDFLAGS += -L../ffmpeg-3.4.1-abi_x86_64.amd64/libswscale/

I guess "../ffmpeg-3.4.1-abi_x86_64.amd64/" cannot be hardcoded and must be created by ebuild, but I don't know which variable/function is responsible for creating this path.

I tried both solutions and both worked fine. Versions I tested were 3.3.5 and 3.4.1, I guess all versions supporting chromium are affected.
Comment 1 James Le Cuirot gentoo-dev 2018-01-18 21:31:24 UTC
Okay, I accidentally broke this in 31be70b4de8dc1f3627765a4a35a4b5cf90a170f while dealing with another issue that appeared in 9999. Changing FF_EXTRALIBS back to FFEXTRALIBS fixes it but that leaves 9999 broken again and 9999 also suffers from this issue. I'll see what I can do.
Comment 2 Larry the Git Cow gentoo-dev 2018-01-18 22:01:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ee1f92d3a83a75687e14feb178eb5748d9a0957

commit 4ee1f92d3a83a75687e14feb178eb5748d9a0957
Author:     James Le Cuirot <chewi@gentoo.org>
AuthorDate: 2018-01-18 22:00:00 +0000
Commit:     James Le Cuirot <chewi@gentoo.org>
CommitDate: 2018-01-18 22:01:05 +0000

    media-video/ffmpeg: Revert chromium.patch change and add -r1 for 9999
    
    My change to fix 9999 in 31be70b4de8dc1f3627765a4a35a4b5cf90a170f
    broke all versions when ffmpeg is not already installed. I have
    reverted this change for earlier versions and introduced a new patch
    with a different approach for 9999.
    
    Closes: https://bugs.gentoo.org/643750
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 media-video/ffmpeg/ffmpeg-9999.ebuild      |  2 +-
 media-video/ffmpeg/files/chromium-r1.patch | 36 ++++++++++++++++++++++++++++++
 media-video/ffmpeg/files/chromium.patch    |  2 +-
 3 files changed, 38 insertions(+), 2 deletions(-)