Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 563318 - media-video/ffmpeg-2.8.1[x265] fails to build due to linking problems in media-libs/x265-1.8-r2
Summary: media-video/ffmpeg-2.8.1[x265] fails to build due to linking problems in medi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-17 13:56 UTC by i.Dark_Templar
Modified: 2015-10-17 14:04 UTC (History)
0 users

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


Attachments
build.log.bz2 (build.log.bz2,1.91 KB, application/x-bzip2)
2015-10-17 13:58 UTC, i.Dark_Templar
Details
environment.bz2 (environment.bz2,26.96 KB, application/x-bzip2)
2015-10-17 14:00 UTC, i.Dark_Templar
Details
config.log.bz2 (config.log.bz2,38.61 KB, application/x-bzip2)
2015-10-17 14:04 UTC, i.Dark_Templar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description i.Dark_Templar 2015-10-17 13:56:33 UTC
Bug is probably in x265 package and caused by default linker flags:

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

Reproducible: Always

Steps to Reproduce:
1. emerge x265
2. emerge ffmpeg (with x265 use-flag)
Actual Results:  
ffmpeg fails to configure

Expected Results:  
ffmpeg should be built successfully

$ emerge --info x265
Portage 2.2.20.1 (python 2.7.10-final-0, default/linux/amd64/13.0/desktop, gcc-4.9.3, glibc-2.20-r2, 4.0.5-gentoo.45 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.0.5-gentoo.45-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q6700_@_2.66GHz-with-gentoo-2.2
KiB Mem:     4050272 total,    824320 free
KiB Swap:    4192252 total,   3927052 free
Timestamp of repository gentoo: Fri, 16 Oct 2015 00:45:01 +0000
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p39::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10::gentoo, 3.4.3::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.18.3::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.18::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: webrsync
    sync-uri: http://mirror.yandex.ru/gentoo-distfiles/
    priority: -1000

calculate
    location: /var/lib/layman/calculate
    sync-type: laymansync
    sync-uri: git://git.calculate.ru/calculate/overlay.git
    masters: gentoo
    priority: 50

rion
    location: /var/lib/layman/rion
    sync-type: laymansync
    sync-uri: git://github.com/rion-overlay/rion-overlay.git
    masters: gentoo
    priority: 50

local-overlay
    location: /usr/local/portage
    masters: gentoo
    priority: 100

Installed sets: @fortune, @kde, @lxqt, @pidgin, @psi, @virtualbox
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --binpkg-respect-use=y --autounmask=n --complete-graph=y --keep-going"
FCFLAGS="-O2 -pipe"
FEATURES="binpkg-logs distlocks ebuild-locks fakeroot fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.yandex.ru/gentoo-distfiles/ http://trumpetti.atm.tut.fi/gentoo/ http://gentoo.bloodhost.ru/ http://mirror.mdfnet.se/gentoo ftp://mirror.mdfnet.se/gentoo http://gentoo.inode.at/ http://ftp.df.lth.se/pub/gentoo/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://ftp.halifax.rwth-aachen.de/gentoo/"
INSTALL_MASK=" /etc/systemd /lib*/systemd /lib*/tmpfiles.d /usr/lib*/systemd /usr/lib*/tmpfiles.d /usr/lib*/python*/test "
LANG="ru_RU.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 amr apm ares bash-completion bidi branding bzip2 c++0x cairo caps cdda cdio cdr cleartype cli consolekit cracklib crypt cue cups custom-cflags custom-optimization cxx dbus dga dirac dri dts dvd dvdr emboss encode exif faad fam fbcon ffmpeg firefox flac fontconfig fontforge freetype fribidi gcrypt gif glamor gme gmp gnutls gpm gtk gtkstyle iconv icu idn imlib inotify ipv6 jadetex jpeg kde lcms libass libdvdcss lzma lzo mad matroska midi mmap mmx mmxext mng modules mp3 mp4 mpeg mpi multilib ncurses network nfs nls nptl offensive ogg openal opengl openmp pango pch pcmcia pcntl pcre pdf pic plasma png policykit posix postproc ppds private-headers projectm qt3support qt4 raw readline schroedinger seccomp session sftp sndfile sockets spell sse sse2 ssl startup-notification svg system-cairo system-icu system-jpeg system-libvpx system-sqlite tcpd tga theora threads tiff truetype udev udisks unicode upower usb utils vaapi vdpau vorbis vpx wavpack wma wxwidgets x264 xattr xcb xcomposite xft xinerama xpm xscreensaver xv xvid zlib" ABI_X86="64 32" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="ru en ru_RU en_US" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby21" SANE_BACKENDS="hp" USERLAND="GNU" VIDEO_CARDS="vesa vga nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7 3.4"
Unset:  CC, CPPFLAGS, CTARGET, CXX, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

media-libs/x265-1.8-r2::gentoo was built with the following:
USE="10bit 12bit pic -numa -test" ABI_X86="32 64 -x32"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -fPIC -fPIC"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -fPIC -fPIC"

# emerge -1av ffmpeg

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U ~] media-video/ffmpeg-2.8.1:0/54.56.56::gentoo [2.7.2:0/54.56.56::gentoo] USE="X aac aacplus alsa amr bzip2 cdio encode faac fontconfig fribidi gme gnutls gpl hardcoded-tables iconv libass lzma mp3 network openal opengl openssl pic postproc schroedinger theora threads truetype vaapi vdpau vorbis vpx wavpack webp x264 x265 xcb xvid zlib (-altivec) -amrenc (-armv5te) (-armv6) (-armv6t2) (-armvfp) -bluray -bs2b -celt -cpudetection -debug -doc -examples -fdk -flite -frei0r -gsm -iec61883 -ieee1394 -jack -jpeg2k -ladspa -libcaca -libressl% -librtmp -libsoxr -libv4l (-mipsdspr1) (-mipsdspr2) (-mipsfpu) -modplug (-neon) -opus -oss -pulseaudio -quvi -samba -sdl -snappy% -speex -ssh -static-libs {-test} -twolame -v4l -zvbi" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3 -3dnow -3dnowext -avx -avx2 -fma3 -fma4 -sse4_1 -sse4_2 -xop" FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex%* trasher" 0 KiB

Total: 1 package (1 upgrade), Size of downloads: 0 KiB
Comment 1 i.Dark_Templar 2015-10-17 13:58:44 UTC
Created attachment 414772 [details]
build.log.bz2

build log (nothing relevant here IMO, just the fact that it fails to configure)
Comment 2 i.Dark_Templar 2015-10-17 14:00:17 UTC
Created attachment 414774 [details]
environment.bz2
Comment 3 Alexis Ballier gentoo-dev 2015-10-17 14:02:42 UTC
this was fixed in x265-1.8-r3
Comment 4 i.Dark_Templar 2015-10-17 14:04:17 UTC
Created attachment 414776 [details]
config.log.bz2

In the end of log:

check_pkg_config x265 x265.h x265_api_get
pkg-config --exists --print-errors x265
check_func_headers x265.h x265_api_get -L/usr/lib32 -lx265
check_ld cc -L/usr/lib32 -lx265
check_cc -L/usr/lib32
BEGIN /var/tmp/portage/media-video/ffmpeg-2.8.1/temp/ffconf.0QhFFwyW.c
    1   #include <x265.h>
    2   long check_x265_api_get(void) { return (long) x265_api_get; }
    3   int main(void) { return 0; }
END /var/tmp/portage/media-video/ffmpeg-2.8.1/temp/ffconf.0QhFFwyW.c
x86_64-pc-linux-gnu-gcc -m32 -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -march=native -O2 -pipe -fomit-frame-pointer -march=core2 -std=c99 -fomit-frame-pointer -fPIC -pthread -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib32/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/freetype2 -I/usr/include/freetype2 -I/usr/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib32/glib-2.0/include -I/usr/include/schroedinger-1.0 -I/usr/include/orc-0.4 -L/usr/lib32 -c -o /var/tmp/portage/media-video/ffmpeg-2.8.1/temp/ffconf.SKX6aqtX.o /var/tmp/portage/media-video/ffmpeg-2.8.1/temp/ffconf.0QhFFwyW.c
x86_64-pc-linux-gnu-gcc -m32 -Wl,-O1 -Wl,--as-needed -Wl,--as-needed -Wl,-z,noexecstack -L/usr/lib32 -o /var/tmp/portage/media-video/ffmpeg-2.8.1/temp/ffconf.lWE44cIF /var/tmp/portage/media-video/ffmpeg-2.8.1/temp/ffconf.SKX6aqtX.o -lx265 -L/usr/lib32 -lx264 -L/usr/lib32 -lwebp -lwavpack -L/usr/lib32 -lvpx -lm -L/usr/lib32 -lvpx -lm -L/usr/lib32 -lvpx -lm -L/usr/lib32 -lvpx -lm -lvorbisenc -lvorbis -logg -lvo-aacenc -ltheoraenc -ltheoradec -logg -L/usr/lib32 -lschroedinger-1.0 -lopencore-amrwb -lopencore-amrnb -lmp3lame -lgme -lstdc++ -L/usr/lib32 -lfribidi -lglib-2.0 -L/usr/lib32 -lfreetype -L/usr/lib32 -lfontconfig -lfreetype -lfaac -L/usr/lib32 -lass -laacplus -L/usr/lib32 -lgnutls -lm -llzma -lbz2 -lz -pthread
/usr/lib32/libx265.so: undefined reference to `dlsym'
/usr/lib32/libx265.so: undefined reference to `dlopen'
collect2: error: ld returned 1 exit status
ERROR: x265 not found using pkg-config

From file /usr/lib/pkgconfig/x265.pc:
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib64
includedir=${prefix}/include

Name: x265
Description: H.265/HEVC video encoder
Version: 0.0
Libs: -L${libdir} -lx265
Libs.private: -lstdc++ -lm -lrt -ldl
Cflags: -I${includedir}

So, it looks like it should be linked to dl.so library.

$ nm -D /usr/lib/libx265.so | grep dl
                 U dlopen
                 U dlsym
                 U _ZdlPv

$ ldd /usr/lib/libx265.so
        linux-vdso.so.1
        libpthread.so.0 => /lib64/libpthread.so.0
        libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libstdc++.so.6
        libm.so.6 => /lib64/libm.so.6
        libc.so.6 => /lib64/libc.so.6
        /lib64/ld-linux-x86-64.so.2
        libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libgcc_s.so.1

But it is not linked for some reason, and this leads to error in the ffmpeg configure stage.