Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 506766 - media-libs/libvpx-1.3.0 on abi_x86_32 - .../work/libvpx-v1.3.0/vp8/encoder/encodeframe.c:1241:34: error: ‘vp8_fast_quantize_b’ undeclared (first use in this function)
Summary: media-libs/libvpx-1.3.0 on abi_x86_32 - .../work/libvpx-v1.3.0/vp8/encoder/en...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-04 20:05 UTC by Reto Gantenbein (ganto)
Modified: 2015-01-06 22:45 UTC (History)
3 users (show)

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


Attachments
build.log (build.log,170.39 KB, text/plain)
2014-04-06 18:41 UTC, Reto Gantenbein (ganto)
Details
.../work/libvpx-v1.3.0-x86/vp8_rtcd.h (vp8_rtcd.h,23.13 KB, text/plain)
2014-04-06 18:57 UTC, Reto Gantenbein (ganto)
Details
build.log (pure 32bit host) (build.log,186.85 KB, text/plain)
2014-04-12 23:29 UTC, Reto Gantenbein (ganto)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Reto Gantenbein (ganto) 2014-04-04 20:05:58 UTC
Hi there

I have troubles compiling media-libs/libvpx-1.3.0 on my amd64 system. No matter what use flag combination I try, it will fail with the following error:

[...]
x86_64-pc-linux-gnu-gcc -m32  -march=native -O2 -pipe -m32 -O3 -fPIC -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -march=native -O2 -pipe -Wall -Wdeclaration-after-statement -Wdisabled-optimization -Wpointer-arith -Wtype-limits -Wcast-qual -Wvla -Wimplicit-function-declaration -Wuninitialized -Wunused-variable -Wunused-but-set-variable -Wno-unused-function -I. -I"/var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0" -c -o vp8/encoder/encodeframe.c.o /var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0/vp8/encoder/encodeframe.c
/var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0/vp8/encoder/encodeframe.c: In function ‘vp8cx_encode_inter_macroblock’:
/var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0/vp8/encoder/encodeframe.c:1241:34: error: ‘vp8_fast_quantize_b’ undeclared (first use in this function)
/var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0/vp8/encoder/encodeframe.c:1241:34: note: each undeclared identifier is reported only once for each function it appears in
/var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0/vp8/encoder/encodeframe.c:1242:34: error: ‘vp8_fast_quantize_b_pair’ undeclared (first use in this function)
/var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0/vp8/encoder/encodeframe.c:1254:34: error: ‘vp8_regular_quantize_b’ undeclared (first use in this function)
/var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0/vp8/encoder/encodeframe.c:1255:34: error: ‘vp8_regular_quantize_b_pair’ undeclared (first use in this function)
make[1]: *** [vp8/encoder/encodeframe.c.o] Error 1
make: *** [.DEFAULT] Error 2
 * ERROR: media-libs/libvpx-1.3.0::gentoo failed (compile phase):
 *   emake failed

The only USE-flag I consequently used was 'abi_x86_32'. I already seach the bugzilla and googled around but it doesn't seem to be an obvious error. However, what seems weird to me is the various compiler flags which are used for the build:

-m32  -march=native -O2 -pipe -m32 -O3 -fPIC -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -march=native -O2 -pipe [...]

I also tried to change my CFLAGS to -O3, but it didn't help anything. I guess the missing header should be generated by the script, but I can't figure out where it fails in the maze of multilib and automake.

Does someone has a hint or thought what else I could try or what's wrong here?

Cheers,
ganto
Comment 1 Reto Gantenbein (ganto) 2014-04-04 20:09:45 UTC
merkur ~ # emerge --info
Portage 2.2.8-r1 (default/linux/amd64/13.0, gcc-4.7.3, glibc-2.17, 3.14.0-gentoo x86_64)
=================================================================
System uname: Linux-3.14.0-gentoo-x86_64-AMD_Phenom-tm-_II_X6_1075T_Processor-with-gentoo-2.2
KiB Mem:    16439552 total,  12187756 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of tree: Fri, 04 Apr 2014 15:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
ccache version 3.1.9 [disabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.6.8-r3, 2.7.5-r3, 3.2.5-r3, 3.3.3
dev-util/ccache:          3.1.9-r3
dev-util/cmake:           2.8.12.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.10.3, 1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.14 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo x11 sunrise virtualization steam-overlay docker
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/lib/hsqldb /var/spool/munin-async/.ssh"
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.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/mnt/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified 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 xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.switch.ch/ftp/mirror/gentoo/ http://de-mirror.org/distro/gentoo/"
LANG="en_US"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j7"
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"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/x11 /var/lib/layman/sunrise /var/lib/layman/virtualization /var/lib/layman/steam /var/lib/layman/docker"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X X509 a52 aac aalib acl acpi aio aisleriot alsa amd64 amr apng archive aspell async audio audit avahi bash-completion berkdb bluetooth bonjour bookmarks branding brasero btrfs bzip2 cairo caps ccache cdaudio cdda cddb cdio cdr cdrkit cjk cli clutter colord console corefonts cracklib crypt css cups curl cxx daap dbus dc1394 dconf deskbar device-mapper dga dhcp dia discouraged disk-partition diskio divx dmi dmraid dri drm dv dvd dvdr dvi dvipdfm eds emerald enca encode evo exchange exif expat fam fasttrack fat fbcon ffmpeg flac flickr fontconfig fortran ftp fts fts3 fuse gaim gallium gbm gcj gconf gd gdbm gdu gedit geoip gif gimp gimpprint git glib glitz glsa glut gmp gnome gnome-keyring gnome-print gnuplot gnutella gnutls gphoto2 graphics graphviz grilo gs gsf gstreamer gtk gtk3 gtkhtml gudev guile h323 hddtemp hfs hwdb ical iconv icq icu id3tag idn ieee1394 imagemagick imap inherit-graph inkjar introspection ios ipod iptc ipv6 irc ithreads jabber jpeg kate kerberos keymap keyring kpathsea kqemu kvm lame lastfm latex lcms libass libnotify libsamplerate libsexy live llvm-gcc lm_sensors logrotate lvm lzma lzo magic map matroska mdadm mdnsresponder-compat midi mjpeg mmap mmx mmxext modules mono mp2 mp3 mpeg msn mtp multilib musepack musicbrainz nautilus ncurses network networking networkmanager nfs nfsidmap nls nntp nolvm1 nolvmstatic nptl nsplugin nss ntfs ntfsprogs nvidia ocamlopt ofx ogg opengl openmp openvg osmesa pam parted pcntl pcre pdf pdfimport playlist plotutils png podcast policykit postscript ppds prediction print pstricks pulseaudio python3 qemu qt3support quicktime rar rdesktop readline resolvconf rtc rtmp rtsp sasl schroedinger science scrobbler sdl secure-delete sendto session shout sip smi smp socialweb soundtouch soup sourceview spell sse sse2 ssh ssl stream subtitles subversion svg symlink systemd taglib tagwriting tcpd telepathy tex4ht tga theora threads threadsonly tiff tk toolkit-scroll-bars totem tracker truetype udev unicode unique upnp urandom usb usbredir v4l2 vala vcd vdisk vdpau video vim-syntax virtualbox vlm vnc vorbis vpx vte wav webgl webkit wma wmf x264 xa xanim xattr xcb xcomposite xetex xfs xinerama xml xmldoclet xmp xulrunner xv xvid xvmc youtube zeitgeist zeroconf zlib" ABI_X86="64" ALSA_CARDS="hda-intel" 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" DRACUT_MODULES="caps lvm syslog systemd" 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="efi-64" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby19" SANE_BACKENDS="plustek" USERLAND="GNU" VIDEO_CARDS="nouveau vesa" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2014-04-05 00:39:31 UTC
Please attach the entire build log to this bug report.
Comment 3 Reto Gantenbein (ganto) 2014-04-06 18:41:38 UTC
Created attachment 374412 [details]
build.log

Same build error with:
- MAKEOPTS="-j1"
- USE="-* abi_x86_32"
- USE="-* mmx abi_x86_32"
- USE="-* mmx sse sse2 abi_x86_32"
- USE="-* mmx sse sse2 ssse3 abi_x86_32"
Comment 4 Reto Gantenbein (ganto) 2014-04-06 18:45:12 UTC
Ups, small correction. The uploaded build log is with MAKEOPTS="-j1". Anyway, parallel or serial build doesn't have an influence on the build error.
Comment 5 Reto Gantenbein (ganto) 2014-04-06 18:54:34 UTC
I guess the missing types should be declared in vp8_rtcd.h which is generated the by the rtcd_defs.sh script.

However, if I check the header of a failed build, no vp8_fast_* or vp8_regular_* types can be found. I'll upload it for reference.
Comment 6 Reto Gantenbein (ganto) 2014-04-06 18:57:56 UTC
Created attachment 374414 [details]
.../work/libvpx-v1.3.0-x86/vp8_rtcd.h
Comment 7 Reto Gantenbein (ganto) 2014-04-12 23:28:27 UTC
I experience the same build failure if I try to build the package on a 32bit Funtoo system with gcc-4.8.2. See the attached log for comparison.

Here the 32bit portage environment:

Portage 2.3.6-r5 (funtoo/1.0/linux-gnu/arch/x86-32bit, gcc-4.8.2, glibc-2.18-r1, 3.14.0-gentoo-pv i686)
=================================================================
System uname: Linux-3.14.0-gentoo-pv-i686-AMD_Athlon-tm-_II_X4_615e_Processor-with-gentoo-2.2.0
KiB Mem:     1029008 total,    731288 free
KiB Swap:     262140 total,    262140 free
Timestamp of tree: Unknown
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45-r1
dev-lang/python:          2.7.6-r1001, 3.3.5-r1000, 3.4.0-r1000
dev-util/cmake:           2.8.12.2
sys-apps/baselayout:      2.2.0-r4
sys-apps/openrc:          0.12.3-r1
sys-apps/sandbox:         2.6-r2
sys-devel/autoconf:       2.69
sys-devel/automake:       1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.8.2-r2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc:           2.18-r1
Repositories: gentoo
Installed sets: @system
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -mtune=generic -pipe -mno-tls-direct-seg-refs"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/spool/munin-async/.ssh"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -mtune=i686 -pipe"
DISTDIR="/mnt/distfiles"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles merge-sync mini-manifest news noclean parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox xattr"
FFLAGS=""
GENTOO_MIRRORS="http://mirror.switch.ch/ftp/mirror/gentoo/ http://de-mirror.org/distro/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="git://github.com/funtoo/ports-2012.git"
SYNC_USER="root"
USE="acl aio bash-completion bzip2 caps cjk cracklib crypt curl cxx gdbm git iconv icu inquisitio ipv6 jpeg kpathsea minimal mmx modules mudflap ncurses nfsidmap nls nonfsv4 nptl pae pam parport pcre png portage ppds profile readline resolvconf sse sse2 ssl subversion suexec symlink syslog tcpd threads tiff truetype unicode vim vim-syntax visibility x86 xattr xml zlib" ABI_X86="32" APACHE2_MODULES="alias auth_basic auth_digest authn_core authn_default authz_core authz_host authz_owner authz_user autoindex cache deflate dir env expires filter include info log_config mime mime_magic negotiation proxy proxy_http rewrite setenvif socache_shmcb status unixd vhost_alias" APACHE2_MPMS="worker" 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" 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 synaptics keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_ABIS="2.7 3.3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="i386" QEMU_USER_TARGETS="i386" RUBY_TARGETS="ruby20" USERLAND="GNU" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, SYNC_UMASK
Comment 8 Reto Gantenbein (ganto) 2014-04-12 23:29:17 UTC
Created attachment 374834 [details]
build.log (pure 32bit host)
Comment 9 Reto Gantenbein (ganto) 2014-04-15 20:30:36 UTC
I'm getting a little bit closer. Something with the build environment seems to be messed up in my setup. But still no idea yet, what exactly the reason is. All the variables which are used by the shell scripts to generate some parts of the VP8/VP9 headers are undefined.

If I add the following minimal variable definitions to the multilib_src_configure() function in the ebuild, the library will at least build successfully:

sed -i '27iCONFIG_VP9=yes' ${S}/vpx_scale/vpx_scale_rtcd.sh
sed -i '323iCONFIG_VP9_ENCODER=yes' ${S}/vp9/common/vp9_rtcd_defs.sh
sed -i '388iCONFIG_VP8_ENCODER=yes' ${S}/vp8/common/rtcd_defs.sh
sed -i '536iCONFIG_TEMPORAL_DENOISING=yes' ${S}/vp8/common/rtcd_defs.sh

I further found out, that the same issue exists also for ABI_X86_64. So it's not a problem related to the 32bit ABI, but only the build environment.

It would be very helpful if someone who can successfully build this package would post the 'emerge --info', so that it would be possible to narrow down the faulty build system components.

Cheers,
ganto
Comment 10 Reto Gantenbein (ganto) 2014-04-15 21:46:35 UTC
Ok... I finally found the problem. There is a shell variable from my interactive root user session which leaked into the build environment.

CONFIG_DIR (that I exported in my interactive root shell) is used by the Makefile to find the generated libs-x86-linux-gcc.mk file which contains the variable definitions. As the libs-x86-linux-gcc.mk couldn't be found, the required build variables weren't set.

Portage will use the 'portage' user for package building, but still it's possible to leak a random shell variable from an interactive root session to the build environment? On the first sight, this looks very unsafe to me... Any thoughts?

How to reproduce:
export CONFIG_DIR=/dev/null
emerge =libvpx-1.3.0

Expected result:
successful build of libvpx

Actual result:
the CONFIG_DIR variable used by libs.mk (for the --config argument) is leaked to the build environment:
...
/var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0/build/make/rtcd.sh --arch=x86 --sym=vpx_scale_rtcd --config=/dev/nulllibs-x86-linux-gcc.mk --disable-altivec --disable-avx --disable-avx2 --disable-mmx --disable-sse --disable-sse2 --disable-sse3 --disable-sse4_1 --disable-ssse3  /var/tmp/portage/media-libs/libvpx-1.3.0/work/libvpx-v1.3.0/vpx_scale/vpx_scale_rtcd.sh > vpx_scale_rtcd.h
Comment 11 Samuli Suominen (RETIRED) gentoo-dev 2014-06-20 16:39:59 UTC
is CONFIG_DIR some standard variable exported by some program or your own creation?
imho, this isn't a bug at all if it's specific to your system alone.
Comment 12 Mike Gilbert gentoo-dev 2014-06-20 16:57:59 UTC
Portage allows most environment vars to enter the ebuild environment. I would not call this "dangerous", but it does occasionally cause "random" build failures like this one.

There has been discussion about filtering specific variables the environment (like bug 499288), but I don't think there is an existing enhancement request for going this generically. Feel free to file a new bug for that.
Comment 13 Reto Gantenbein (ganto) 2015-01-06 22:45:07 UTC
Thanks for the hint. I'll join the discussion in the mentioned bug.