Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 598054 - =media-video/ffmpeg-3.1.5 can't link properly when USE="jpeg2k"
Summary: =media-video/ffmpeg-3.1.5 can't link properly when USE="jpeg2k"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-25 08:58 UTC by Paolo Pedroni
Modified: 2019-08-22 13:49 UTC (History)
2 users (show)

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


Attachments
ffmpeg-3.1.5:20161025-081147.log.gz (ffmpeg-3.1.5:20161025-081147.log.gz,132.93 KB, application/gzip)
2016-10-25 08:58 UTC, Paolo Pedroni
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Pedroni 2016-10-25 08:58:55 UTC
Created attachment 451398 [details]
ffmpeg-3.1.5:20161025-081147.log.gz

It used to work fine in ffmpeg-3.1.4. This is the error for ABI_X86="64 32" in the 32bit build, but it errors out also in the 64bit build.

x86_64-pc-linux-gnu-gcc -m32 -shared -Wl,-soname,libavcodec.so.57 -Wl,-Bsymbolic -Wl,--version-script,libavcodec/libavcodec.ver -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common -flto=8 -fuse-linker-plugin -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -fgraphite-identity -ftree-vectorize -fno-loop-interchange -fno-tree-loop-distribution -fno-tree-vectorize -fno-loop-strip-mine -fno-loop-block -fno-graphite-identity  -march=sandybridge -Wl,--as-needed -Wl,-z,noexecstack -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample -flto -march=sandybridge -O2 -pipe -march=sandybridge -msahf --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -flto=8 -fuse-linker-plugin -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -fgraphite-identity -ftree-vectorize -fno-loop-interchange -fno-tree-loop-distribution -fno-tree-vectorize -fno-loop-strip-mine -fno-loop-block -fno-graphite-identity -fno-math-errno -fno-signed-zeros -fno-tree-vectorize  -o libavcodec/libavcodec.so.57 libavcodec/012v.o libavcodec/4xm.o
[...several lines of libraries to link...]
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_create_decompress' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_error_handler' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_warning_handler' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_info_handler' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_setup_decoder' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_default_create' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_read_function' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_skip_function' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_seek_function' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_user_data' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_user_data_length' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_read_header' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_create_decompress' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_image_destroy' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_destroy' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_destroy_codec' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_decode' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_image_create' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_destroy' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_destroy_codec' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_image_destroy' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_create_compress' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_error_handler' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_warning_handler' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_info_handler' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_setup_encoder' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_default_create' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_write_function' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_skip_function' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_seek_function' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_user_data' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_start_compress' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_encode' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_end_compress' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_default_encoder_parameters' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_version' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_default_decoder_parameters' is not defined locally
collect2: error: ld returned 1 exit status

# emerge --info =media-video/ffmpeg-3.1.5 
Portage 2.3.0 (python 2.7.12-final-0, default/linux/amd64/13.0/desktop/plasma/systemd, gcc-5.4.0, glibc-2.22-r4, 4.7.10-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.7.10-gentoo-x86_64-Intel-R-_Core-TM-_i7-2600_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    15865720 total,   7471888 free
KiB Swap:    8171516 total,   8164988 free
Timestamp of repository gentoo: Tue, 25 Oct 2016 06:45:01 +0000
sh dash 0.5.8.2
ld GNU gold (Gentoo 2.25.1 p1.1 2.25.1) 1.11
distcc 3.2rc1 x86_64-pc-linux-gnu [enabled]
ccache version 3.2.4 [disabled]
app-shells/bash:          4.3_p48::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/ccache:          3.2.4::gentoo
dev-util/cmake:           3.5.2-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.21.7::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            5.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.europe.gentoo.org/gentoo-portage
    priority: -1000

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=sandybridge -msahf --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -flto=8 -fuse-linker-plugin -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -fgraphite-identity -ftree-vectorize"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=sandybridge -msahf --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -flto=8 -fuse-linker-plugin -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -fgraphite-identity -ftree-vectorize"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going y --with-bdeps y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup compress-build-logs config-protect-if-modified distcc distlocks ebuild-locks ipc-sandbox merge-sync news parallel-fetch protect-owned sandbox sfperms split-elog split-log strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://tux.rainside.sk/gentoo/ http://mirror.leaseweb.com/gentoo/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://ftp.spline.inf.fu-berlin.de/mirrors/gentoo/"
LANG="it_IT.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common -flto=8 -fuse-linker-plugin -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -fgraphite-identity -ftree-vectorize"
MAKEOPTS="-j11 -l8"
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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac aalib acl acpi adns alsa amd64 ao audiofile bash-completion bluetooth branding bzip2 cairo caps cdda cddb cdparanoia cdr cli cracklib crypt css cups curl cxx dbus declarative dga djvu dri dts dvd dvdr emboss encode exif expat fbcon ffmpeg fftw firefox flac fontconfig foomaticdb fortran ftp gd gdbm geoip gif gimp glamor gmp gnutls gphoto2 gpm graphviz gtk handbook iconv icu idn imagemagick imlib ipv6 java javascript jbig jpeg jpeg2k kde kipi lame lcms libass libcaca libnotify libsamplerate lm_sensors lua lzma lzo mad mmap mmx mmxext mng modules mp3 mp4 mpeg mplayer multilib musicbrainz ncurses nls nptl nsplugin offensive ogg openal openexr opengl openmp pam pango pcre pdf phonon plasma png policykit postscript ppds pulseaudio qml qt3support qt4 qt5 rdesktop readline recode samba sctp sdl seccomp session sndfile sockets speex spell sqlite sse sse2 ssl startup-notification subversion svg symlink syslog systemd sysvipc taglib theora threads tidy tiff truetype udev udisks unicode upower usb vaapi vcd vim-syntax vnc vorbis wayland widgets win32codecs wmf wxwidgets x264 xattr xcb xcomposite xine xinerama xml xpm xscreensaver xv xvid yahoo zlib" ABI_X86="64" ALSA_CARDS="hda-intel virmidi" 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="kodak ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="gnutls" 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" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev" KERNEL="linux" L10N="it en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="nlpsolver" LINGUAS="it it_IT" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4 pypy pypy3" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="intel i965" 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"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

# emerge -1pqv =media-video/ffmpeg-3.1.5
[ebuild     U ] media-video/ffmpeg-3.1.5 [3.1.4] USE="X alsa amr bs2b bzip2 cdio celt doc encode fdk fontconfig frei0r fribidi gmp gnutls gpl hardcoded-tables iconv jpeg2k libass libcaca lzma mp3 network openal opengl openssl opus postproc pulseaudio samba schroedinger sdl speex ssh {test} theora threads truetype vaapi vorbis vpx webp x264 x265 xcb xvid zlib (-altivec) -amrenc (-armv5te) (-armv6) (-armv6t2) (-armvfp) -bluray -chromaprint -cpudetection -debug -ebur128 -faac -flite -gcrypt -gme -gsm -iec61883 -ieee1394 -jack -kvazaar -ladspa -libilbc -librtmp -libsoxr -libv4l (-mipsdspr1) (-mipsdspr2) (-mipsfpu) (-mmal) -modplug (-neon) -nvenc -openh264 -oss -pic -rubberband -snappy -static-libs -twolame -v4l -vdpau -wavpack -zimg -zvbi" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="aes avx mmx mmxext sse sse2 sse3 sse4_1 sse4_2 ssse3 -3dnow -3dnowext -avx2 -fma3 -fma4 -xop" FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex trasher"
Comment 1 Paolo Pedroni 2016-10-25 09:01:44 UTC
On a pure 64bit build (ABI_X86="64") the error is slightly different:

x86_64-pc-linux-gnu-gcc -shared -Wl,-soname,libavcodec.so.57 -Wl,-Bsymbolic -Wl,--version-script,libavcodec/libavcodec.ver -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common -flto=8 -fuse-linker-plugin -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -fgraphite-identity -ftree-vectorize -fno-loop-interchange -fno-tree-loop-distribution -fno-tree-vectorize -fno-loop-strip-mine -fno-loop-block -fno-graphite-identity  -march=sandybridge -Wl,--as-needed -Wl,-z,noexecstack -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample -flto -march=sandybridge -O2 -pipe -march=sandybridge -msahf --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -flto=8 -fuse-linker-plugin -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -fgraphite-identity -ftree-vectorize -fno-loop-interchange -fno-tree-loop-distribution -fno-tree-vectorize -fno-loop-strip-mine -fno-loop-block -fno-graphite-identity -fno-math-errno -fno-signed-zeros -fno-tree-vectorize  -o libavcodec/libavcodec.so.57 libavcodec/012v.o libavcodec/4xm.o
[...several lines of libraries to link...]
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: /var/tmp/portage/media-video/ffmpeg-3.1.5/temp/ccgz0epr.ltrans21.ltrans.o: requires dynamic R_X86_64_PC32 reloc against 'opj_create_decompress' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: /var/tmp/portage/media-video/ffmpeg-3.1.5/temp/ccgz0epr.ltrans21.ltrans.o: requires dynamic R_X86_64_PC32 reloc against 'opj_set_default_encoder_parameters' which may overflow at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_create_decompress' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_error_handler' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_warning_handler' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_info_handler' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_setup_decoder' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_default_create' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_read_function' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_skip_function' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_seek_function' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_user_data' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_user_data_length' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_read_header' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_create_decompress' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_image_destroy' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_destroy' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_destroy_codec' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_decode' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_image_create' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_destroy' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_destroy_codec' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_image_destroy' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_create_compress' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_error_handler' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_warning_handler' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_info_handler' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_setup_encoder' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_default_create' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_write_function' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_skip_function' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_seek_function' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_stream_set_user_data' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_start_compress' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_encode' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_end_compress' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_default_encoder_parameters' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_version' is not defined locally
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_set_default_decoder_parameters' is not defined locally
collect2: error: ld returned 1 exit status
Comment 2 Steffen Hau 2016-10-25 14:10:14 UTC
I got bitten by the same issue. Upstream ffmpeg 3.1.5 got a slightly different patch what gentoo ffmpeg maintainers applied to ffmpeg version 3.1.4 or older.

https://github.com/gentoo/gentoo/blob/99589f636ee9871b669ecf10a023cff5da3f2b4a/media-video/ffmpeg/files/openjpeg2.patch vs. https://github.com/FFmpeg/FFmpeg/commit/7a65aef00d113a38e0d1a54df49eead9df6aa15c.patch

It looks like LTO causes the issue.

Non-LTO:

check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC
check_func_headers openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC
check_ld cc -lopenjp2 -DOPJ_STATIC
check_cc -DOPJ_STATIC
BEGIN /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.bYDko95Z.c
    1   #include <openjpeg-2.1/openjpeg.h>
    2   long check_opj_version(void) { return (long) opj_version; }
    3   int main(void) { return 0; }
END /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.bYDko95Z.c
x86_64-pc-linux-gnu-gcc -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 -ggdb -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -fira-loop-pressure -ftree-vectorize -ftree-loop-linear -flto=5 -fuse-linker-plugin -fno-lto -fno-loop-interchange -fno-loop-strip-mine -fno-loop-block -fno-tree-loop-distribution -fno-ira-loop-pressure -fno-tree-vectorize -fno-tree-loop-linear -march=haswell -std=c99 -fomit-frame-pointer -fPIC -pthread -I/usr/include/freetype2 -I/usr/include/freetype2 -DOPJ_STATIC -c -o /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.Sn7yWn4x.o /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.bYDko95Z.c
x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -march=native -O2 -pipe -ggdb -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -fira-loop-pressure -ftree-vectorize -ftree-loop-linear -flto=5 -fuse-linker-plugin -Wl,-znow -Wl,--sort-common -Wl,--hash-style=gnu -Wl,--enable-new-dtags -fno-lto -fno-loop-interchange -fno-loop-strip-mine -fno-loop-block -fno-tree-loop-distribution -fno-ira-loop-pressure -fno-tree-vectorize -fno-tree-loop-linear -march=haswell -Wl,--as-needed -Wl,-z,noexecstack -DOPJ_STATIC -o /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.6xbg7pL2 /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.Sn7yWn4x.o -lopenjp2 -lmp3lame -lfreetype -lfontconfig -lfreetype -lfdk-aac -lcaca -lbluray -lgmp -lm -llzma -lbz2 -lz -pthread
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: hidden symbol 'opj_version' is not defined locally
collect2: error: ld returned 1 exit status
check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2
check_func_headers openjpeg-2.1/openjpeg.h opj_version -lopenjp2
check_ld cc -lopenjp2
check_cc
BEGIN /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.bYDko95Z.c
    1   #include <openjpeg-2.1/openjpeg.h>
    2   long check_opj_version(void) { return (long) opj_version; }
    3   int main(void) { return 0; }
END /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.bYDko95Z.c
x86_64-pc-linux-gnu-gcc -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 -ggdb -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -fira-loop-pressure -ftree-vectorize -ftree-loop-linear -flto=5 -fuse-linker-plugin -fno-lto -fno-loop-interchange -fno-loop-strip-mine -fno-loop-block -fno-tree-loop-distribution -fno-ira-loop-pressure -fno-tree-vectorize -fno-tree-loop-linear -march=haswell -std=c99 -fomit-frame-pointer -fPIC -pthread -I/usr/include/freetype2 -I/usr/include/freetype2 -c -o /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.Sn7yWn4x.o /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.bYDko95Z.c
x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -march=native -O2 -pipe -ggdb -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -fira-loop-pressure -ftree-vectorize -ftree-loop-linear -flto=5 -fuse-linker-plugin -Wl,-znow -Wl,--sort-common -Wl,--hash-style=gnu -Wl,--enable-new-dtags -fno-lto -fno-loop-interchange -fno-loop-strip-mine -fno-loop-block -fno-tree-loop-distribution -fno-ira-loop-pressure -fno-tree-vectorize -fno-tree-loop-linear -march=haswell -Wl,--as-needed -Wl,-z,noexecstack -o /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.6xbg7pL2 /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.Sn7yWn4x.o -lopenjp2 -lmp3lame -lfreetype -lfontconfig -lfreetype -lfdk-aac -lcaca -lbluray -lgmp -lm -llzma -lbz2 -lz -pthread


LTO:
check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC
check_func_headers openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC
check_ld cc -lopenjp2 -DOPJ_STATIC
check_cc -DOPJ_STATIC
BEGIN /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.emlYuZc6.c
    1   #include <openjpeg-2.1/openjpeg.h>
    2   long check_opj_version(void) { return (long) opj_version; }
    3   int main(void) { return 0; }
END /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.emlYuZc6.c
x86_64-pc-linux-gnu-gcc -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 -ggdb -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -fira-loop-pressure -ftree-vectorize -ftree-loop-linear -flto=5 -fuse-linker-plugin -fno-loop-interchange -fno-loop-strip-mine -fno-loop-block -fno-tree-loop-distribution -fno-ira-loop-pressure -fno-tree-vectorize -fno-tree-loop-linear -march=haswell -std=c99 -fomit-frame-pointer -fPIC -pthread -I/usr/include/freetype2 -I/usr/include/freetype2 -DOPJ_STATIC -c -o /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.IoZKDBnT.o /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.emlYuZc6.c
x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -march=native -O2 -pipe -ggdb -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -fira-loop-pressure -ftree-vectorize -ftree-loop-linear -flto=5 -fuse-linker-plugin -Wl,-znow -Wl,--sort-common -Wl,--hash-style=gnu -Wl,--enable-new-dtags -fno-loop-interchange -fno-loop-strip-mine -fno-loop-block -fno-tree-loop-distribution -fno-ira-loop-pressure -fno-tree-vectorize -fno-tree-loop-linear -march=haswell -Wl,--as-needed -Wl,-z,noexecstack -DOPJ_STATIC -o /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.lK7iaEC0 /home/gentoo/tmp/portage/media-video/ffmpeg-3.1.5/temp/ffconf.IoZKDBnT.o -lopenjp2 -lmp3lame -lfreetype -lfontconfig -lfreetype -lfdk-aac -lcaca -lbluray -lgmp -lm -llzma -lbz2 -lz -pthread


In a non-lto build, check_lib2 recognizes that it can't use -DOPJ_STATIC in a shared build and checks a second time but without the -DOPJ_STATIC.
In a lto build, it looks like opj_version gets eliminated by lto, the check succeeds and check_lib2 adds OPJ_STATIC to the cppflags which causes the hidden symbol error.

I changed the order of the check_lib2 checks and ffmpeg-3.1.5 now compiles without any error.


-enabled libopenjpeg       && { { check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
-                               check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
+enabled libopenjpeg       && { check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
+                               { check_lib2 openjpeg-2.1/openjpeg.h opj_version -
Comment 3 Reuben Martin 2016-10-26 01:14:13 UTC
try building with "-fPIC" appended to your CFLAGS
Comment 4 Paolo Pedroni 2016-10-26 09:26:10 UTC
(In reply to Reuben Martin from comment #3)
> try building with "-fPIC" appended to your CFLAGS

It fails even earlier with:
x86_64-pc-linux-gnu-gcc -m32 -shared -Wl,-soname,libswresample.so.2 -Wl,-Bsymbolic -Wl,--version-script,libswresample/libswresample.ver -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,--hash-style=gnu -Wl,--sort-common -flto=8 -fuse-linker-plugin -fPIC  -march=sandybridge -Wl,--as-needed -Wl,-z,noexecstack -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample -flto -march=sandybridge -O2 -pipe -march=sandybridge -msahf --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -flto=8 -fuse-linker-plugin -fPIC -fno-math-errno -fno-signed-zeros -fno-tree-vectorize  -o libswresample/libswresample.so.2 libswresample/audioconvert.o libswresample/dither.o libswresample/log2_tab.o libswresample/options.o libswresample/rematrix.o libswresample/resample.o libswresample/resample_dsp.o libswresample/swresample.o libswresample/swresample_frame.o libswresample/x86/audio_convert.o libswresample/x86/audio_convert_init.o libswresample/x86/rematrix.o libswresample/x86/rematrix_init.o libswresample/x86/resample.o libswresample/x86/resample_init.o -lavutil -lavutil -lXv -lX11 -lXext -lva -lva-drm -lva -lva-x11 -lva -L/usr/lib32 -lxcb -L/usr/lib32 -lxcb-shm -L/usr/lib32 -lxcb-xfixes -L/usr/lib32 -lxcb-shape -lX11 -lcdio_paranoia -lcdio_cdda -lcdio -lasound -L/usr/lib32 -lSDL -lpthread -L/usr/lib32 -lssl -lcrypto -lGL -lopenal -lxvidcore -L/usr/lib32 -lx265 -L/usr/lib32 -lx264 -L/usr/lib32 -lwebp -L/usr/lib32 -lvpx -lm -L/usr/lib32 -lvpx -lm -L/usr/lib32 -lvpx -lm -L/usr/lib32 -lvpx -lm -lvorbisenc -lvorbis -logg -ltheoraenc -ltheoradec -logg -L/usr/lib32 -lspeex -L/usr/lib32 -lssh -L/usr/lib32 -lsmbclient -L/usr/lib32 -lschroedinger-1.0 -L/usr/lib32 -lpulse -L/usr/lib32 -lopus -lopenjp2 -DOPJ_STATIC -lopencore-amrwb -lopencore-amrnb -lmp3lame -L/usr/lib32 -lfribidi -lglib-2.0 -L/usr/lib32 -lfreetype -L/usr/lib32 -lfontconfig -lfreetype -L/usr/lib32 -lfdk-aac -L/usr/lib32 -lcaca -lcelt0 -lcelt0 -L/usr/lib32 -lbs2b -L/usr/lib32 -lass -L/usr/lib32 -lgnutls -lgmp -lm -llzma -lbz2 -lz -pthread 
src/libswscale/x86/rgb2rgb_template.c: In function ‘rgb24toyv12_mmx’:
src/libswscale/x86/rgb2rgb_template.c:1727:9: error: ‘asm’ operand has impossible constraints
         __asm__ volatile(
         ^
make[1]: *** [/var/tmp/portage/media-video/ffmpeg-3.1.5/temp/ccqzwn1r.ltrans2.ltrans.o] Error 1
make[1]: *** Waiting for unfinished jobs....
src/libswscale/x86/yuv2rgb_template.c: In function ‘yuv420_bgr24_mmxext’:
src/libswscale/x86/yuv2rgb_template.c:346:9: error: ‘asm’ operand has impossible constraints
         YUV2RGB_INITIAL_LOAD
         ^
make[1]: *** [/var/tmp/portage/media-video/ffmpeg-3.1.5/temp/ccqzwn1r.ltrans5.ltrans.o] Error 1
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: fatal error: lto-wrapper failed
collect2: error: ld returned 1 exit status
distcc[3840] ERROR: compile (null) on localhost failed
/var/tmp/portage/media-video/ffmpeg-3.1.5/work/ffmpeg-3.1.5/library.mak:99: recipe for target 'libswscale/libswscale.so.4' failed
make: *** [libswscale/libswscale.so.4] Error 1
make: *** Waiting for unfinished jobs....
echo skipping strip -wN '..@*' libavresample/x86/audio_mix.o
skipping strip -wN ..@* libavresample/x86/audio_mix.o
yasm -f elf  -DPIC -I./ -Isrc// -Pconfig.asm -I /var/tmp/portage/media-video/ffmpeg-3.1.5/work/ffmpeg-3.1.5/libavcodec/x86/ -o libavcodec/x86/vp9itxfm.o src/libavcodec/x86/vp9itxfm.asm
echo skipping strip -wN '..@*' libavcodec/x86/vp9itxfm.o
skipping strip -wN ..@* libavcodec/x86/vp9itxfm.o
Comment 5 Paolo Pedroni 2016-10-31 10:56:23 UTC
Still in media-video/ffmpeg-3.2
Comment 6 Alexis Ballier gentoo-dev 2019-08-22 13:49:21 UTC
should have been fixed long ago, please reopen if it fails with 4.2+