Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 537084 - media-plugins/gst-plugins-vaapi-0.5.9 - abi_x86_32.x86: running multilib-minimal_abi_src_compile(): Toolchain is unable to link executables
Summary: media-plugins/gst-plugins-vaapi-0.5.9 - abi_x86_32.x86: running multilib-min...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: GStreamer package maintainers
URL: https://bugzilla.gnome.org/show_bug.c...
Whiteboard:
Keywords: UPSTREAM
Depends on:
Blocks:
 
Reported: 2015-01-19 21:10 UTC by Michelangelo Scopelliti
Modified: 2015-09-05 13:28 UTC (History)
6 users (show)

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


Attachments
gst-plugins-vaapi-0.5.9:20150119-210257.log.gz (gst-plugins-vaapi-0.5.9:20150119-210257.log.gz,10.28 KB, application/gzip)
2015-01-19 21:11 UTC, Michelangelo Scopelliti
Details
Fix the configure script for the case when LD is set (multilib_configure.patch,791 bytes, patch)
2015-01-20 02:39 UTC, Siuchung Cheung (Clement)
Details | Diff
Updated ebuild that applies fix from comment #5 (gst-plugins-vaapi-0.5.9.ebuild,1.70 KB, text/plain)
2015-01-20 12:07 UTC, nvinson234
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michelangelo Scopelliti 2015-01-19 21:10:09 UTC
media-plugins/gst-plugins-vaapi-0.5.9 fails to build with ABI_X86=32 on amd64 no-emul-linux-x86. The package builds/installs without errors if

USE="-abi_x86_32" emerge gst-plugins-vaapi, fails otherwise with error "Toolchain is unable to link executables". Build log will follow.

Reproducible: Always




emerge -vp gst-plugins-list

[ebuild  N     ] media-plugins/gst-plugins-vaapi-0.5.9:1.0  USE="X opengl -wayland" ABI_X86="32 (64) (-x32)" 0 KiB


emerge --info:

Portage 2.2.15 (python 3.4.2-final-0, default/linux/amd64/13.0/no-emul-linux-x86, gcc-4.9.2, glibc-2.20-r1, 3.18.3 x86_64)
=================================================================
System uname: Linux-3.18.3-x86_64-Intel-R-_Core-TM-_i5-3337U_CPU_@_1.80GHz-with-gentoo-2.2
KiB Mem:     3939480 total,   1846528 free
KiB Swap:    6291448 total,   6291448 free
Timestamp of tree: Mon, 19 Jan 2015 07:45:01 +0000
sh bash 4.3_p33
ld ld di GNU (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.3_p33
dev-java/java-config:     2.2.0
dev-lang/perl:            5.20.1-r4
dev-lang/python:          2.7.9-r1, 3.4.2
dev-util/cmake:           3.1.0
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6-r1, 1.15
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.9.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.4
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.18 (virtual/os-headers)
sys-libs/glibc:           2.20-r1
Repositories: gentoo science tox-overlay kernelpanic
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA @EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mtune=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/lib64/tomoyo/conf /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/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -mtune=native -O2 -pipe"
DISTDIR="/var/portage/distfiles"
FCFLAGS="-march=native -mtune=native -O2 -pipe"
FEATURES="assume-digests binpkg-logs candy cgroup clean-logs compress-build-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms split-elog split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -mtune=native -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="it_IT.UTF-8"
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"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/science /var/lib/layman/tox-overlay /usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acl alisp alsa amd64 amr anacron ao apng avx bazaar berkdb bluetooth bs2b bzip2 cairo caps cblas-external chm clang cli colord compact context contrast corefonts cracklib crypt cups curl cvs cxx dbus demosaic detex dhcp djbfft djvu dri dri3 dv dvb dvd dvdnav dvi2tty ebook emf encode excel exif extra faac fdk ffmpeg fftw firmware flac fluidsynth fontconfig fontforge fortran fpx ftp gbm gcj gd gdbm gif gimp gles2 gmp gpm graphics graphite graphviz gsm gstreamer gudev hdri hwdb iconv icu id3tag inotify int64 ipython ithreads jbig jemalloc jpeg jpeg2k kdrive keymap kmod lame lapack latex lcms lensfun libass libcaca libkms libnotify libsamplerate libsoxr libv4l lqr lzma lzo mad matplotlib mercurial metapost mjpeg mmap mmx mng modplug modules mp3 mp3rtp mpeg multicall multilib natspec ncurses netlink network nlopt nls nptl numpy nuv obex offensive offlinehelp ogg opencl openexr opengl openmp opus osmesa pam pango passwdqc pcre pdf png pnm postproc postscript pstricks publishers pvr python python3 q16 q32 q64 q8 qt3support quicktime rar raw readline rle rtmp schroedinger science sctp secure-delete session smp sndfile speex sse sse2 sse3 sse4 sse4_1 sse4_2 ssl ssse3 startup-notification subversion svg system-cairo system-icu system-jpeg system-libvpx system-sqlite t1lib tftp tga theora threads tiff timezone truetype twolame type3 udev umfpack unicode usb uxa v4l vaapi vcd vf-dlopen video vim-syntax vorbis vpx wavpack webp wifi wmf wxwidgets x264 xa xattr xdg xetex xkb xml xmp xorg xpm xscreensaver xv xvfb xvid xvmc yuv4mpeg zlib" ABI_X86="32 64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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" CURL_SSL="openssl" 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" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="it en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby21 ruby22" SANE_BACKENDS="xerox_mfp" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Michelangelo Scopelliti 2015-01-19 21:11:22 UTC
Created attachment 394358 [details]
gst-plugins-vaapi-0.5.9:20150119-210257.log.gz

build log
Comment 2 Siuchung Cheung (Clement) 2015-01-19 23:23:12 UTC
Hit the same problem. Relevant section from /var/tmp/portage/media-plugins/gst-plugins-vaapi-0.5.9/work/gstreamer-vaapi-0.5.9-abi_x86_32.x86/ext/libvpx/upstream/config.log:

check_ld
check_cc
BEGIN /var/tmp/portage/media-plugins/gst-plugins-vaapi-0.5.9/temp/vpx-conf-11731-29273.c
    1   int main(void) {return 0;}
END /var/tmp/portage/media-plugins/gst-plugins-vaapi-0.5.9/temp/vpx-conf-11731-29273.c
x86_64-pc-linux-gnu-gcc -m32 -march=native -O2 -pipe -m32 -g -O3 -fPIC -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -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 -c -o /var/tmp/portage/media-plugins/gst-plugins-vaapi-0.5.9/temp/vpx-conf-11731-29273.o /var/tmp/portage/media-plugins/gst-plugins-vaapi-0.5.9/temp/vpx-conf-11731-29273.c
x86_64-pc-linux-gnu-ld -m elf_i386 -Wl,-O1 -Wl,--as-needed -m32 -g -o /var/tmp/portage/media-plugins/gst-plugins-vaapi-0.5.9/temp/vpx-conf-11731-29273.x /var/tmp/portage/media-plugins/gst-plugins-vaapi-0.5.9/temp/vpx-conf-11731-29273.o -lpthread
x86_64-pc-linux-gnu-ld: unrecognised emulation mode: 32
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om

Somehow the -m32 flag got into ld.
Comment 3 Siuchung Cheung (Clement) 2015-01-20 02:39:47 UTC
Created attachment 394370 [details, diff]
Fix the configure script for the case when LD is set

This is because the package has its own multilib support, which inteferes with Gentoo's. If they detect that you're trying to cross compile 32-bit binaries on a 64-bit machine, they do this:

            gcc*)
                add_cflags -m${bits}
                add_ldflags -m${bits}
                link_with_cc=gcc
                tune_cflags="-march="
                setup_gnu_toolchain

In this case, they want to use gcc as ld.

setup_gnu_toolchain() {
        CC=${CC:-${CROSS}gcc}
        CXX=${CXX:-${CROSS}g++}
        AR=${AR:-${CROSS}ar}
        LD=${LD:-${CROSS}${link_with_cc:-ld}}
        AS=${AS:-${CROSS}as}
    STRIP=${STRIP:-${CROSS}strip}
    NM=${NM:-${CROSS}nm}
        AS_SFX=.s
        EXE_SFX=
}

We have link_with_cc=gcc. So ${CROSS}${link_with_cc:-ld} gives you the right thing. Except that if LD is set, we won't touch it. And sure enough, LD is set in our multilib.eclass http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/multilib.eclass?diff_format=s&revision=1.106&view=markup:
426 	# We want to avoid the behind-the-back magic of gcc-config as it
427 	# screws up ccache and distcc. See #196243 for more info.
428 	if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then
429 	# Back that multilib-ass up so we can restore it later
430 	for v in CHOST CBUILD AS CC CXX LD PKG_CONFIG_{LIBDIR,PATH} ; do
431 	vv="_abi_saved_${v}"
432 	[[ ${!v+set} == "set" ]] && export ${vv}="${!v}" || unset ${vv}
433 	done
434 	export _DEFAULT_ABI_SAVED="true"
435 	
436 	# Set the CHOST native first so that we pick up the native
437 	# toolchain and not a cross-compiler by accident #202811.
438 	export CHOST=$(get_abi_CHOST ${DEFAULT_ABI})
439 	export CC="$(tc-getCC) $(get_abi_CFLAGS)"
440 	export CXX="$(tc-getCXX) $(get_abi_CFLAGS)"
441 	export LD="$(tc-getLD) $(get_abi_LDFLAGS)"
442 	export CHOST=$(get_abi_CHOST $1)
443 	export CBUILD=$(get_abi_CHOST $1)
444 	export PKG_CONFIG_LIBDIR=${EPREFIX}/usr/$(get_libdir)/pkgconfig
445 	export PKG_CONFIG_PATH=${EPREFIX}/usr/share/pkgconfig
446 	fi

I don't think their logic is entirely correct. If you decided that you want to use gcc as ld, you want that whether user have their own custom ld or not. In that case, we should pick up the ${CC} instead of ${LD} as our ld:

diff -upr gstreamer-vaapi-0.5.9.orig/ext/libvpx/upstream/build/make/configure.sh gstreamer-vaapi-0.5.9/ext/libvpx/upstream/build/make/configure.sh
--- gstreamer-vaapi-0.5.9.orig/ext/libvpx/upstream/build/make/configure.sh     2015-01-19 17:36:53.150477316 -0800
+++ gstreamer-vaapi-0.5.9/ext/libvpx/upstream/build/make/configure.sh   2015-01-19 18:35:37.469918858 -0800
@@ -587,7 +587,11 @@ setup_gnu_toolchain() {
         CC=${CC:-${CROSS}gcc}
         CXX=${CXX:-${CROSS}g++}
         AR=${AR:-${CROSS}ar}
-        LD=${LD:-${CROSS}${link_with_cc:-ld}}
+        if [ -n "${link_with_cc}" ]; then
+            LD=${CC:-${CROSS}${link_with_cc}}
+        else
+            LD=${LD:-${CROSS}ld}
+        fi
         AS=${AS:-${CROSS}as}
     STRIP=${STRIP:-${CROSS}strip}
     NM=${NM:-${CROSS}nm}

You can drop this patch in the right place under /etc/portage/patches to get it to compile. Unfortunately, multilib doesn't call epatch_user. So you have to drop your bashrc to get the patch applied as described here: http://wiki.gentoo.org/wiki//etc/portage/patches
Comment 4 Michelangelo Scopelliti 2015-01-20 09:46:31 UTC
I've tested the patch, and it works.

Thank you.
Comment 5 Pacho Ramos gentoo-dev 2015-01-20 09:50:43 UTC
Maybe a better option could be to move from builtin vpx to system one. For that, we should use --enable-builtin-libvpx=no and RDEPEND on media-libs/libvpx
Comment 6 nvinson234 2015-01-20 12:06:52 UTC
(In reply to Pacho Ramos from comment #5)
> Maybe a better option could be to move from builtin vpx to system one. For
> that, we should use --enable-builtin-libvpx=no and RDEPEND on
> media-libs/libvpx

I created an updated ebuild to test this approach and it seems to work.  At the very least, gst-plugins-vaapi-0.5.9 did emerge.  Perhaps a complete solution would be to apply this approach as well as patch configure.sh?

I'll also upload my new ebuild in case anyone else wants to test it.
Comment 7 nvinson234 2015-01-20 12:07:56 UTC
Created attachment 394400 [details]
Updated ebuild that applies fix from comment #5
Comment 8 Charlie Gehlin 2015-01-20 12:46:28 UTC
Confirming bug and that updated ebuild works, thanks a lot! :) /Charlie
Comment 9 Pacho Ramos gentoo-dev 2015-01-20 12:51:05 UTC
https://gitorious.org/vaapi/gstreamer-vaapi/commits/master -> I think we should forward this to upstream to not need to carry that patch forever, but I cannot find any bug tracker or similar :S, are you familiar with gitorious?
Comment 10 nvinson234 2015-01-20 13:27:47 UTC
(In reply to Pacho Ramos from comment #9)
> https://gitorious.org/vaapi/gstreamer-vaapi/commits/master -> I think we
> should forward this to upstream to not need to carry that patch forever, but
> I cannot find any bug tracker or similar :S, are you familiar with gitorious?

I'm not familiar with gitorious, but I found a README in the source tree (https://gitorious.org/vaapi/gstreamer-vaapi/source/09bb0d4b5d5fa7b6c8821c7bcac96b5a068158ee:README) that said to file bugs at

https://bugzilla.gnome.org/enter_bug.cgi?product=gstreamer-vaapi
Comment 11 Pacho Ramos gentoo-dev 2015-01-20 13:42:18 UTC
Nice, thanks! Could you please report it then? I am a bit busy now :S
Comment 12 nvinson234 2015-01-21 01:56:06 UTC
submitted.  The report is at https://bugzilla.gnome.org/show_bug.cgi?id=743272

The bulk of the submission is based off the write-up in comment #3, so many thanks to Siuchung Cheung.
Comment 13 Pacho Ramos gentoo-dev 2015-01-21 09:06:31 UTC
+*gst-plugins-vaapi-0.5.9-r1 (21 Jan 2015)
+
+  21 Jan 2015; Pacho Ramos <pacho@gentoo.org>
+  +gst-plugins-vaapi-0.5.9-r1.ebuild:
+  Use system libvpx (#537084 by Michelangelo Scopelliti, Siuchung Cheung and
+  nvinson)
+

I won't apply the patch for now as I see most distributions are using system libvpx instead of bundled one without problems