Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 257477 - media-video/ffmpeg-0.4.9_p20090201 needs patches for other OS's
Summary: media-video/ffmpeg-0.4.9_p20090201 needs patches for other OS's
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All OS X
: High normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-03 10:59 UTC by Carmine Paolino
Modified: 2009-06-30 19:05 UTC (History)
1 user (show)

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


Attachments
ffmpeg-0.4.9_p20090201.ebuild (ffmpeg-0.4.9_p20090201.ebuild,6.36 KB, patch)
2009-02-12 13:39 UTC, Daniel Vergien
Details | Diff
ffmpeg-0.4.9_p20090201-apple.patch (ffmpeg-0.4.9_p20090201-apple.patch,319 bytes, patch)
2009-02-12 13:40 UTC, Daniel Vergien
Details | Diff
ffmpeg-0.4.9_p20090201-solaris.patch (ffmpeg-0.4.9_p20090201-solaris.patch,339 bytes, patch)
2009-02-12 13:40 UTC, Daniel Vergien
Details | Diff
ffmpeg-0.4.9_p20090201-solaris.patch (ffmpeg-0.4.9_p20090201-solaris.patch,339 bytes, patch)
2009-02-12 13:40 UTC, Daniel Vergien
Details | Diff
ffmpeg-0.4.9_p20090201-solaris64.patch (ffmpeg-0.4.9_p20090201-solaris64.patch,435 bytes, patch)
2009-02-12 13:41 UTC, Daniel Vergien
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carmine Paolino 2009-02-03 10:59:23 UTC
>>> Unpacking ffmpeg-0.4.9-p20090201.tar.bz2 to /opt/gentoo/var/tmp/portage/media-video/ffmpeg-0.4.9_p20090201/work
 * Applying ffmpeg-0.4.9_p20081014-solaris.patch ...

 * Failed Patch: ffmpeg-0.4.9_p20081014-solaris.patch !
 *  ( /opt/gentoo/usr/portage/media-video/ffmpeg/files/ffmpeg-0.4.9_p20081014-solaris.patch )

$ cat /opt/gentoo/var/tmp/portage/media-video/ffmpeg-0.4.9_p20090201/temp/ffmpeg-0.4.9_p20081014-solaris.patch-25777.out
***** ffmpeg-0.4.9_p20081014-solaris.patch *****

================================================

PATCH COMMAND:	 patch -p0 -g0 -E --no-backup-if-mismatch < /opt/gentoo/usr/portage/media-video/ffmpeg/files/ffmpeg-0.4.9_p20081014-solaris.patch

================================================
patching file configure
Hunk #1 FAILED at 1254.
1 out of 1 hunk FAILED -- saving rejects to file configure.rej
================================================

PATCH COMMAND:	 patch -p1 -g0 -E --no-backup-if-mismatch < /opt/gentoo/usr/portage/media-video/ffmpeg/files/ffmpeg-0.4.9_p20081014-solaris.patch

================================================
missing header for unified diff at line 5 of patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|The use of nanosleep requires librealtime (-lrt) on Solaris
|
|--- configure
|+++ configure
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
================================================

PATCH COMMAND:	 patch -p2 -g0 -E --no-backup-if-mismatch < /opt/gentoo/usr/portage/media-video/ffmpeg/files/ffmpeg-0.4.9_p20081014-solaris.patch

================================================
missing header for unified diff at line 5 of patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|The use of nanosleep requires librealtime (-lrt) on Solaris
|
|--- configure
|+++ configure
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
================================================

PATCH COMMAND:	 patch -p3 -g0 -E --no-backup-if-mismatch < /opt/gentoo/usr/portage/media-video/ffmpeg/files/ffmpeg-0.4.9_p20081014-solaris.patch

================================================
missing header for unified diff at line 5 of patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|The use of nanosleep requires librealtime (-lrt) on Solaris
|
|--- configure
|+++ configure
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
================================================

PATCH COMMAND:	 patch -p4 -g0 -E --no-backup-if-mismatch < /opt/gentoo/usr/portage/media-video/ffmpeg/files/ffmpeg-0.4.9_p20081014-solaris.patch

================================================
missing header for unified diff at line 5 of patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|The use of nanosleep requires librealtime (-lrt) on Solaris
|
|--- configure
|+++ configure
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored



Reproducible: Always




Portage 2.2.00.12565-prefix (prefix/darwin/macos/10.5/x86, gcc-4.2.1, unavailable, 9.6.0 i386)
=================================================================
System uname: Darwin-9.6.0-i386-32bit
Timestamp of tree: Tue, 03 Feb 2009 10:31:56 +0000
distcc 2.18.5-Apple.1 i386-apple-darwin9.0 (protocols 1 and 2) (default port 3632) [disabled]
app-shells/bash:     3.2_p48
dev-lang/python:     2.5.4-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.9.6-r2, 1.10.2-r00.1
sys-devel/gcc-config: 1.4.0-r04.6
sys-devel/libtool:   1.5.26
ACCEPT_KEYWORDS="~x86-macos"
CBUILD="i686-apple-darwin9"
CFLAGS="-O2 -fomit-frame-pointer -pipe -march=nocona"
CHOST="i686-apple-darwin9"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -fomit-frame-pointer -pipe -march=nocona"
DISTDIR="/opt/gentoo/usr/portage/distfiles"
EPREFIX="/opt/gentoo"
FEATURES="collision-protect distlocks fixpackages nostrip parallel-fetch preserve-libs protect-owned sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="it_IT.UTF-8"
LDFLAGS=""
MAKEOPTS="-j3"
PKGDIR="/opt/gentoo/usr/portage/packages"
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="/opt/gentoo/var/tmp"
PORTDIR="/opt/gentoo/usr/portage"
PORTDIR_OVERLAY="/opt/gentoo/usr/local/portage"
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="acl aqua bash-completion bzip2 coreaudio cracklib epydoc iconv ipv6 latex lzma midi mmx mmxext ncurses nls objc objc++ openmp pcre prefix readline sqlite sse ssl threads unicode vim-pager vim-syntax x86-macos zlib" 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" ELIBC="Darwin" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-02-04 05:22:49 UTC
Isn't the 2009 version masked globally?
Comment 2 Carmine Paolino 2009-02-04 08:49:46 UTC
(In reply to comment #1)
> Isn't the 2009 version masked globally?
> 

No.
I have synced few seconds ago and I see:
[U] media-video/ffmpeg
     Available versions:  (~*)0.4.9_p20081014 (~*)0.4.9_p20081219 [M](~*)0.4.9_p20090121 (~*)0.4.9_p20090201
Comment 3 Daniel Vergien 2009-02-12 13:39:54 UTC
Created attachment 181775 [details, diff]
ffmpeg-0.4.9_p20090201.ebuild

Corrected patches for ffmpeg-0.4.9_p20090201 - compiles under x86-solaris
Comment 4 Daniel Vergien 2009-02-12 13:40:12 UTC
Created attachment 181777 [details, diff]
ffmpeg-0.4.9_p20090201-apple.patch
Comment 5 Daniel Vergien 2009-02-12 13:40:30 UTC
Created attachment 181779 [details, diff]
ffmpeg-0.4.9_p20090201-solaris.patch
Comment 6 Daniel Vergien 2009-02-12 13:40:50 UTC
Created attachment 181780 [details, diff]
ffmpeg-0.4.9_p20090201-solaris.patch
Comment 7 Daniel Vergien 2009-02-12 13:41:24 UTC
Created attachment 181781 [details, diff]
ffmpeg-0.4.9_p20090201-solaris64.patch
Comment 8 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-02-13 15:29:26 UTC
@media-video team: Would you be so kind as to submit these trivial patches upstream? We continually have to update our patches. Thanks.
Comment 9 Alexis Ballier gentoo-dev 2009-02-15 10:36:58 UTC
(In reply to comment #8)
> @media-video team: Would you be so kind as to submit these trivial patches
> upstream? We continually have to update our patches. Thanks.


No because there is absolutely no explanation why those patches are needed and I have no access to such boxes where I could trigger the problem with trunk. We'll never get a patch merged if there is no explanation that comes with them...

Moreover, here is some quick review:

--- libswscale/rgb2rgb.c.orig	2009-02-12 14:30:37.222852621 +0100
+++ libswscale/rgb2rgb.c	2009-02-12 14:31:38.877425291 +0100
@@ -148,7 +148,7 @@
 #define RENAME(a) a ## _C
 #include "rgb2rgb_template.c"
 
-#if ARCH_X86 && CONFIG_GPL
+#if ARCH_X86 && CONFIG_GPL && !defined(__APPLE__)
 
 //MMX versions
 #undef RENAME


This completely disables mmx,mmx2 & 3dnow versions of rgb2rgb based on random assumptions that it will break with apple stuff, this doesn't take into account the fact that the code following this tries to use the disabled functions and I'm surprised you don't get undefined symbols on apple with that patch. If I remember correctly the first 10.5 toolchain was broken and couldn't compile ffmpeg, maybe that was it; but now I'd suggest dropping that patch and trying to fix the real problem instead of hiding it.



--- configure.orig	2009-02-12 14:04:00.765543277 +0100
+++ configure	2009-02-12 14:04:54.964345082 +0100
@@ -1437,6 +1437,7 @@
         SHFLAGS='-shared -Wl,-h,$$(@F)'
         network_extralibs="-lsocket -lnsl"
         add_cflags -D__EXTENSIONS__
+	osextralibs="-lrt"
         ;;
     netbsd)
         oss_demuxer_extralibs="-lossaudio"


This one seems whitespace damaged; if you can provide the information of what functions are used in which files that are provided by librt on solaris it'd be simpler to directly send the patch to ffmpeg-devel@mplayerhq.hu

--- configure.orig	2009-02-12 14:19:38.688598969 +0100
+++ configure	2009-02-12 14:20:15.806640646 +0100
@@ -1327,12 +1327,12 @@
 check_cflags -std=c99
 
 case "$arch" in
-    i386|i486|i586|i686|i86pc|BePC)
+    i386|i486|i586|i686|BePC)
         arch="x86"
         subarch="x86_32"
         enable fast_unaligned
     ;;
-    x86_64|amd64)
+    x86_64|amd64|i86pc)
         arch="x86"
         subarch="x86_32"
         enable cmov


so uname -m gives i86pc iff this is a solaris 64 box or this patch breaks solaris 32 support? What are the CHOSTS you use on solaris? We could feed configure in the portage ebuild with --arch=something which would fix the problem without a patch instead of doing it in a half broken way when cross compiling as that's the case now.
Comment 10 Fabian Groffen gentoo-dev 2009-02-15 10:46:50 UTC
(In reply to comment #9)
> -#if ARCH_X86 && CONFIG_GPL
> +#if ARCH_X86 && CONFIG_GPL && !defined(__APPLE__)
> 
>  //MMX versions
>  #undef RENAME
> 
> 
> This completely disables mmx,mmx2 & 3dnow versions of rgb2rgb based on random
> assumptions that it will break with apple stuff, this doesn't take into account
> the fact that the code following this tries to use the disabled functions and
> I'm surprised you don't get undefined symbols on apple with that patch. If I
> remember correctly the first 10.5 toolchain was broken and couldn't compile
> ffmpeg, maybe that was it; but now I'd suggest dropping that patch and trying
> to fix the real problem instead of hiding it.

mmx and sse is just broken IMO, but we can test and see it die of course.

> +       osextralibs="-lrt"

> This one seems whitespace damaged; if you can provide the information of what
> functions are used in which files that are provided by librt on solaris it'd be
> simpler to directly send the patch to ffmpeg-devel@mplayerhq.hu

I thought it was documented.  nanosleep needs librealtime (librt) on Solaris.  Easy as that.

>  case "$arch" in
> -    i386|i486|i586|i686|i86pc|BePC)
> +    i386|i486|i586|i686|BePC)
>          arch="x86"
>          subarch="x86_32"
>          enable fast_unaligned
>      ;;
> -    x86_64|amd64)
> +    x86_64|amd64|i86pc)
>          arch="x86"
>          subarch="x86_32"
>          enable cmov
> 
> 
> so uname -m gives i86pc iff this is a solaris 64 box or this patch breaks
> solaris 32 support? What are the CHOSTS you use on solaris? We could feed
> configure in the portage ebuild with --arch=something which would fix the
> problem without a patch instead of doing it in a half broken way when cross
> compiling as that's the case now.

Ah, now I see.  The renewed patches did not copy the comment in them from the older original ones.

uname -m on Solaris/Intel returns i86pc for both x86 and x64

For that reason, it should "think" i86pc is 64-bits, as the configure script afterwards just tries to figure out if it should do 64-bits or 32-bits using a compiler test.
Comment 11 Alexis Ballier gentoo-dev 2009-02-15 11:13:07 UTC
(In reply to comment #10)
> > +       osextralibs="-lrt"
> 
> > This one seems whitespace damaged; if you can provide the information of what
> > functions are used in which files that are provided by librt on solaris it'd be
> > simpler to directly send the patch to ffmpeg-devel@mplayerhq.hu
> 
> I thought it was documented.  nanosleep needs librealtime (librt) on Solaris. 
> Easy as that.


Fair enough; could you please clean up the whitespace indentation of the patch and send it to ffmpeg-devel? That way you'll get due credits and that's how it works even for people who have been developping ffmpeg for years, every patch has to go through the ml and when it'll be acked someone will apply it for you.

> >  case "$arch" in
> > -    i386|i486|i586|i686|i86pc|BePC)
> > +    i386|i486|i586|i686|BePC)
> >          arch="x86"
> >          subarch="x86_32"
> >          enable fast_unaligned
> >      ;;
> > -    x86_64|amd64)
> > +    x86_64|amd64|i86pc)
> >          arch="x86"
> >          subarch="x86_32"
> >          enable cmov
> > 
> > 
> > so uname -m gives i86pc iff this is a solaris 64 box or this patch breaks
> > solaris 32 support? What are the CHOSTS you use on solaris? We could feed
> > configure in the portage ebuild with --arch=something which would fix the
> > problem without a patch instead of doing it in a half broken way when cross
> > compiling as that's the case now.
> 
> Ah, now I see.  The renewed patches did not copy the comment in them from the
> older original ones.
> 
> uname -m on Solaris/Intel returns i86pc for both x86 and x64
> 
> For that reason, it should "think" i86pc is 64-bits, as the configure script
> afterwards just tries to figure out if it should do 64-bits or 32-bits using a
> compiler test.

The problem with that way is that it also enables cmov/fast_cmov. This is not a problem if you give the --cpu arg to configure but an optionless ./configure will enable it and not disable it as cpu is "generic" by default. cmov is slow on some old x86 and not present on some even older ones, thus this breaks solaris32 support for these cpus.
Comment 12 Fabian Groffen gentoo-dev 2009-02-15 11:20:28 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > > +       osextralibs="-lrt"
> > 
> > > This one seems whitespace damaged; if you can provide the information of what
> > > functions are used in which files that are provided by librt on solaris it'd be
> > > simpler to directly send the patch to ffmpeg-devel@mplayerhq.hu
> > 
> > I thought it was documented.  nanosleep needs librealtime (librt) on Solaris. 
> > Easy as that.
> 
> 
> Fair enough; could you please clean up the whitespace indentation of the patch
> and send it to ffmpeg-devel? That way you'll get due credits and that's how it
> works even for people who have been developping ffmpeg for years, every patch
> has to go through the ml and when it'll be acked someone will apply it for you.

I already committed the cleaned up patch, and I've just subscribed to the list.

> The problem with that way is that it also enables cmov/fast_cmov. This is not a
> problem if you give the --cpu arg to configure but an optionless ./configure
> will enable it and not disable it as cpu is "generic" by default. cmov is slow
> on some old x86 and not present on some even older ones, thus this breaks
> solaris32 support for these cpus.

Ok, thanks.  What flag can we pass onto configure to just make it do a 64-bits/amd64 build on x64-solaris?
Comment 13 Alexis Ballier gentoo-dev 2009-02-15 11:30:10 UTC
(In reply to comment #12)
> > The problem with that way is that it also enables cmov/fast_cmov. This is not a
> > problem if you give the --cpu arg to configure but an optionless ./configure
> > will enable it and not disable it as cpu is "generic" by default. cmov is slow
> > on some old x86 and not present on some even older ones, thus this breaks
> > solaris32 support for these cpus.
> 
> Ok, thanks.  What flag can we pass onto configure to just make it do a
> 64-bits/amd64 build on x64-solaris?

--arch=x86_64

I was thinking about adding this to the intree ebuild: --arch=${CHOST%%-*}
but this would break powerpc64 targets from what I can see
Comment 14 Alexis Ballier gentoo-dev 2009-03-08 22:45:13 UTC
media-video@ should be done there
Comment 15 Fabian Groffen gentoo-dev 2009-03-14 16:39:43 UTC
I did this for the arch thing in 0.5:

@@ -174,6 +173,10 @@
                fi
        fi
 
+       local arch=${CHOST%%-*}
+       # Gentoo Linux ppc64 has powerpc64-* CHOST, but configure doesn't get that
+       [[ ${arch} == powerpc64 ]] && arch=ppc64
+
        cd "${S}"
        ${EPREFIX}/bin/sh ./configure \
                --prefix="${EPREFIX}"/usr \
@@ -181,6 +184,7 @@
                --shlibdir="${EPREFIX}"/usr/$(get_libdir) \
                --mandir="${EPREFIX}"/usr/share/man \
                --enable-static --enable-shared \
+               --arch=${CHOST%%-*} \
                --cc="$(tc-getCC)" \
                ${myconf} || die "configure failed"
Comment 16 Fabian Groffen gentoo-dev 2009-06-30 19:05:50 UTC
whatever, this works, sort of