Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 325701 - media-libs/libvpx should support proper target arch (backport ffmpeg one?)
Summary: media-libs/libvpx should support proper target arch (backport ffmpeg one?)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-26 12:19 UTC by Alexander E. Patrakov
Modified: 2013-06-25 17:43 UTC (History)
1 user (show)

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


Attachments
libvpx multilib patch (libvpx-0.9.5.ebuild.diff,593 bytes, patch)
2010-12-15 21:21 UTC, Mario Fetka (geos_one)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander E. Patrakov 2010-06-26 12:19:16 UTC
The multilib overlay (http://wiki.github.com/sjnewbury/multilib-overlay/) adds support for building both 32-bit and 64-bit libraries on Gentoo with a single emerge command. However, with that overlay, 32-bit libvpx builds incorrectly (/usr/lib32/libvpx.so.0.9.0 ends up being a 64-bit library).

Reproducible: Always

Steps to Reproduce:
1. Install Gentoo with multilib overlay on amd64 (use the portage-multilib branch, expect spending some time fighting circular dependencies).
2. Install libvpx with the lib32 USE flag (added by that patched portage)
3. Inspect the /usr/lib32/libvpx.so.0.9.0 library with the "file" command

Maybe it is enough to do ABI=x86 emerge -av libvpx on a regular amd64 Gentoo box, without the multilib overlay. If it is so, please state this in your comment and adjust the summary to "builds incorrectly with ABI=x86" - I don't have such box and can't check.
Actual Results:  
/usr/lib32/libvpx.so.0.9.0 is a 64-bit library

Expected Results:  
/usr/lib32/libvpx.so.0.9.0 should be a 32-bit library

This patch works for me, but it is obviously wrong WRT FreeBSD and other non-linux architectures:

--- libvpx-0.9.0_p20100612.ebuild	2010-06-13 04:06:11.000000000 +0600
+++ libvpx-0.9.0_p20100612.ebuild	2010-06-26 17:58:18.097991028 +0600
@@ -32,6 +32,9 @@
 
 src_configure() {
 	tc-export CC
+	archparam=""
+	[ "$ABI" = "x86" ] && archparam="--target=x86-linux-gcc"
+	[ "$ABI" = "amd64" ] && archparam="--target=x86_64-linux-gcc"
 	./configure \
 		--prefix=/usr \
 		--libdir=/usr/$(get_libdir) \
@@ -49,6 +52,7 @@
 		$(use_enable doc install-docs) \
 		$(use_enable postproc) \
 		$(use_enable threads multithread) \
+		$archparam \
 		|| die
 }
 

aep@home ~ $ emerge --info
Portage 2.2_rc67-r8 (default/linux/amd64/10.0/desktop, gcc-4.4.4, glibc-2.11.2-r0, 2.6.34-gentoo-r1 x86_64)
=================================================================
System uname: Linux-2.6.34-gentoo-r1-x86_64-Intel-R-_Core-TM-2_CPU_6420_@_2.13GHz-with-gentoo-2.0.1
Timestamp of tree: Sat, 26 Jun 2010 08:15:02 +0000
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r2, 3.1.2-r3
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
virtual/os-headers:  2.6.34
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=core2 -fomit-frame-pointer -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /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="-O2 -march=core2 -fomit-frame-pointer -pipe"
DISTDIR="/home/distfiles"
FEATURES="assume-digests buildpkg distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.yandex.ru/gentoo-distfiles http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="ru_RU.UTF-8"
LDFLAGS="-Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/home/packages/amd64"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/home/build"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /var/lib/layman/multilib /var/lib/layman/java-overlay /var/lib/layman/lxde /usr/local/portage"
SYNC="rsync://mirror.yandex.ru/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 amr applet archive artworkextra automount bash-completion berkdb bidi bluetooth bzip2 cairo caps cdda cddb cdr cjk cli consolekit cracklib crypt css cups cxx dbus dirac djvu dri dts dvb dvd dvdr emboss encode exif faac faad fastcgi ffmpeg firefox flac fontconfig fortran fuse gcj gdbm gif gimp glibc-omitfp gnuplot gphoto2 gsm gtk iconv icq idn ieee1394 ipod ipv6 jabber jack jack-midi jbig jingle jpeg jpeg2k ladspa lame latex lcms ldap libsamplerate mad mikmod mmx mmxext mng modules mozilla mp3 mp4 mpeg mplayer mudflap multilib musepack ncurses nls nocd nptl nptlonly nsplugin ogg opengl openmp pam pango pch pcre pdf perl png policykit ppds pppd python qt3support raw rdesktop readline reflection samba scanner schroedinger sdl session shorten smp speex spell spl sse sse2 sse3 ssl ssse3 startup-notification svg symlink sysfs tcl tcpd theora threads tiff tk truetype unicode usb v4l2 videos vim-syntax vnc vorbis vpx wifi winbind wmf x264 xattr xcb xcomposite xinerama xml xmp xorg xulrunner xv xvid zlib" 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" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 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" CAMERAS="ptp2" DVB_CARDS="tda10046lifeview" ELIBC="glibc" INPUT_DEVICES="evdev synaptics keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIRC_DEVICES="devinput audio_alsa inputlirc" RUBY_TARGETS="ruby18" SANE_BACKENDS="gt68xx" USERLAND="GNU" VIDEO_CARDS="intel" 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, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 ferret 2010-06-26 12:36:42 UTC
Not surprisingly, this library is using approximately the same kind of magical arch detection as in the chromium ebuild.  See bug #296917 .

We need to override this, not just for multilib overlay, but also for people with 64-bit kernel, 32-bit userland or cross-compilers.  The bug above gives the logic required.
Comment 2 ferret 2010-06-26 12:38:22 UTC
(In reply to comment #1)
> [...] The bug above gives the logic required.

Specifically bug #296917 comment 6, not the patch on that bug
Comment 3 Alexander E. Patrakov 2010-06-26 12:41:41 UTC
Retitling the bug as advised on #gentoo-multilib-overlay
Comment 4 Luca Barbato gentoo-dev 2010-08-02 11:18:52 UTC
That's an upstream problem, we'll try to solve it with them
Comment 5 Mario Fetka (geos_one) 2010-12-15 21:21:15 UTC
Created attachment 257253 [details, diff]
libvpx multilib patch

this is a patch for the actual stable to get it compile with portage multilib
it also correct a autodetect problem related to using yasm commands with gnu-as
Comment 6 Thomas Sachau gentoo-dev 2011-03-06 20:48:58 UTC
Same for this one: If there is no response or action within the next 2 weeks, i will touch libvpx and do the needed changes.
Comment 7 Agostino Sarubbo gentoo-dev 2012-02-01 12:59:08 UTC
If you need amd64 support cc back us.
Comment 8 Thomas Sachau gentoo-dev 2012-05-06 12:44:15 UTC
(In reply to comment #6)
> Same for this one: If there is no response or action within the next 2
> weeks, i will touch libvpx and do the needed changes.

Seems like i forgot about this one, now done: 

+*libvpx-1.0.0-r1 (06 May 2012)
+
+  06 May 2012; Thomas Sachau (Tommy[D]) <tommy@gentoo.org>
+  +libvpx-1.0.0-r1.ebuild:
+  Add explicit targets for amd64 and x86 target platforms to allow
+  cross-compilation, build system seems to ignore user CFLAGS/LDFLAGS, bug
+  325701
+

leaving this bug open for the maintainer to decide about a different solution or to close this bug
Comment 9 Alexis Ballier gentoo-dev 2013-06-25 17:43:52 UTC
should be all fixed these days