After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743272 - gstreamer-vaapi-0.5.9 multilib support conflicts with amd64 multilib Gentoo
gstreamer-vaapi-0.5.9 multilib support conflicts with amd64 multilib Gentoo
Status: RESOLVED INVALID
Product: gstreamer-vaapi
Classification: Other
Component: general
0.5.9
Other Linux
: Normal normal
: ---
Assigned To: gstreamer-vaapi maintainer(s)
gstreamer-vaapi maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-01-21 01:48 UTC by nvinson
Modified: 2015-04-10 16:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Suggested fix for build incompatibility with amd64 multilib Gentoo (791 bytes, patch)
2015-01-21 01:48 UTC, nvinson
none Details | Review

Description nvinson 2015-01-21 01:48:28 UTC
Created attachment 295060 [details] [review]
Suggested fix for build incompatibility with amd64 multilib Gentoo

This is issue from issue #537084 on bugs.gentoo.org (https://bugs.gentoo.org/show_bug.cgi?id=537084).


gstreamer-vaapi-0.5.9 has its own multilib support, which inteferes with Gentoo's. If it detects that you're trying to cross-compile 32-bit binaries on a 64-bit machine, it does this in ext/libvpx/upstream/build/make/configure.sh near line 1064:

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

In this case, gstreamer-vaapi-0.5.9 want to use gcc as ld.

Moreover, the setup_gnu_toolchain() function in the same configure.sh is defined as:

    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=
    }

and because link_with_cc ist set, it would set LD to ${CROSS}${link_with_cc} *if* LD is not already set.  However, portage sets LD in the multilib.eclass file near line 441 (source at 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

This results in the following invocation of ld (line breaks added for readability):
    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

A suggested fix is given in comment #3 of the Gentoo issue.  I have attached it here as well.
Comment 1 Víctor Manuel Jáquez Leal 2015-04-10 08:21:31 UTC
Thanks for the patch!

Sadly, it is related to libvpx, which is an external submodule:

[submodule "ext/libvpx/upstream"]
        path = ext/libvpx/upstream
        url = https://chromium.googlesource.com/webm/libvpx


As a workaround you could configure and compile gstreamer-vaapi with 

  --enable-builtin-libvpx=no

And use libvpx as an external dependency, if you use VP8 decoding through VA-API.

In Gentoo libvpx is stable: https://packages.gentoo.org/package/media-libs/libvpx 

I'll close this bug as invalid, but don't hesitate to re-open it if you think we should do this differently.
Comment 2 Pacho Ramos 2015-04-10 16:50:50 UTC
Well... we solved it downstream building against system library... but maybe would be interesting to also fix it in the tarballs provided by upstream to prevent people from having issues with them. But I am not familiar with the way tarballs are generated, then, if it cannot be fixed because you don't have permissions to fix it in the bundled libvpx, no problem :)