Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 78404 - mjpegtools-1.6.2-r3 causes an "motion.c:143: internal compiler error: asm clobber conflict with output operand" when compiling
Summary: mjpegtools-1.6.2-r3 causes an "motion.c:143: internal compiler error: asm clo...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 77694
  Show dependency tree
 
Reported: 2005-01-17 12:42 UTC by krolden
Modified: 2005-04-17 13:58 UTC (History)
3 users (show)

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


Attachments
output file of compilation (ccUWnj5K.out,92.13 KB, text/plain)
2005-01-17 12:45 UTC, krolden
Details
Fixes allow motion.c to build (motion.c-pic.patch,18.62 KB, patch)
2005-01-29 06:29 UTC, Kevin F. Quinn (RETIRED)
Details | Diff
Same as before, but with #ifdefs to preserve original code on non-pic (motion.c-pic.patch,19.54 KB, patch)
2005-01-29 08:18 UTC, Kevin F. Quinn (RETIRED)
Details | Diff
Full patch, enabling simd-accel stuff with PIC. (mjpegtools-1.6.2-mmx-fPIC.patch,25.31 KB, patch)
2005-02-09 11:04 UTC, Kevin F. Quinn (RETIRED)
Details | Diff
Patch to 1.6.2-r3 ebuild, to apply PIC patch and fix other related ebuild problems (mv-mj-ebuild.patch,3.30 KB, patch)
2005-02-09 11:24 UTC, Kevin F. Quinn (RETIRED)
Details | Diff
Updated patch to 1.6.2-r3 latest version (1.15), and fix gtk logic error (mjpegtools-picebuild.patch,2.62 KB, patch)
2005-02-26 09:22 UTC, Kevin F. Quinn (RETIRED)
Details | Diff
Patch against 1.6.2-r3 ebuild v1.21 (mjpegtools-1.6.2-r3.ebuild-PIC.patch,1.70 KB, patch)
2005-04-14 05:37 UTC, Kevin F. Quinn (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description krolden 2005-01-17 12:42:02 UTC
emerge -uD world suggested to upgrade to mjpegtools-1.6.2-r3

[ebuild     U ] media-video/mjpegtools-1.6.2-r3 [1.6.1.90-r2] -3dnow +X +avi -debug -dv +gtk -mmx +quicktime +sdl -sse -yv12 0 kB

results in

motion.c: In function `calc_SAD_mmx':
motion.c:143: internal compiler error: asm clobber conflict with output operand
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
Preprocessed source stored into /var/tmp/portage/mjpegtools-1.6.2-r3/temp/cc7RnmCk.out file, please attach this to your bugreport.
make[2]: *** [motion.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/mjpegtools-1.6.2-r3/work/mjpegtools-1.6.2/yuvdenoise'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/mjpegtools-1.6.2-r3/work/mjpegtools-1.6.2'
make: *** [all] Error 2

Reproducible: Always
Steps to Reproduce:
1. emerge mjpegtools
2.
3.



Expected Results:  
compiled and installed software

Portage 2.0.51-r3 (default-linux/x86/2004.0, gcc-3.3.5, glibc-2.3.4.20040808-r1,
 2.6.7 i686)
=================================================================
System uname: 2.6.7 i686 AMD Athlon(tm) XP 1800+
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.92.0.2-r1
Headers:  sys-kernel/linux-headers-2.4.21-r1
Libtools: sys-devel/libtool-1.5.2-r7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2
/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /
usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/sha
re/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/gen
eric/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qma
il/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms userpriv usersa
ndbox"
GENTOO_MIRRORS="ftp:///ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://gent
oo.tiscali.nl/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa apm arts avi berkdb bitmap-fonts cdr crypt cups dvd encode esd f77 f
am flac font-server foomaticdb fortran gdbm gif gnome gpg gpm gstreamer gtk gtk2
 hardened imagemagick imlib ipv6 java jpeg junit libg++ libwww mad mikmod motif 
mozilla mpeg nas ncurses nls oggvorbis opengl oss pam pdflib perl png python qt 
quicktime readline sdl slang spell sqlite ssl svga tcltk tcpd tetex tiff truetyp
e truetype-fonts type1-fonts x86 xml xml2 xmms xv zlib"
Comment 1 krolden 2005-01-17 12:45:50 UTC
Created attachment 48775 [details]
output file of compilation

Suggested by portae to include this file.
Comment 2 Kevin F. Quinn (RETIRED) gentoo-dev 2005-01-29 06:29:08 UTC
Created attachment 49827 [details, diff]
Fixes allow motion.c to build

This is the well-known %%ebx PIC problem.

The patch here swaps use of %%ebx with use of %%esi, for a change.  Normally
I'd push/pop ebx.
Comment 3 solar (RETIRED) gentoo-dev 2005-01-29 07:59:52 UTC
I can confirm that mjpegtools compiles with this and the patch from bug #77694 but I'm not sure how to confirm runtime. Perhaps we should wrapper the asm changes in #ifdef __PIC__\n\tNEW_CODE_HERE\n#else\nOLD_CODE_HERE\n#endif 
Comment 4 Kevin F. Quinn (RETIRED) gentoo-dev 2005-01-29 08:18:52 UTC
Created attachment 49839 [details, diff]
Same as before, but with #ifdefs to preserve original code on non-pic

Just to be safe; avoid potentially breaking it where it already works.
Comment 5 Kevin F. Quinn (RETIRED) gentoo-dev 2005-02-09 11:04:07 UTC
Created attachment 50843 [details, diff]
Full patch, enabling simd-accel stuff with PIC.

This patch corrects a few missing PIC-ability issues in the asm of this
package.

This integrates the patch I supplied for motion.c here, the patch for
deinterlace.c I supplied on bug #77694, and also patches a couple of the nasm
'.s' files which generate text relocations due to non-PIC data.

Ebuild modifications are needed to get the existing PIC patches to work, not
just to apply this patch; ebuild patch to follow.
Comment 6 Kevin F. Quinn (RETIRED) gentoo-dev 2005-02-09 11:24:06 UTC
Created attachment 50845 [details, diff]
Patch to 1.6.2-r3 ebuild, to apply PIC patch and fix other related ebuild problems

This patch to the ebuild adds the patch in attachment id #50843 above.	In
addition, it sorts out some src_unpack problems:

1) patching configure.in (-nogtk and altivec-fix- patches) and the Makefile.am
files (existing PIC patch) require autoreconf to be effective
2) the '-gcc34.patch' must be done after autoreconf as it patches configure
rather than configure.in (it could be changed to modify configure.in, but for
those that don't otherwise need autoreconf it's quicker to just patch
configure).

Lastly, the strip of fstack-protector that was added for earlier versions is
removed from src_compile() as it builds fine here, and the unusual 'has_pie'
section is removed - again, no problems here. 

I've built with "everything on" i.e. all use flags but -gtk (x86 p3 &
athlon-xp, hardened/pic/pie), without problems.
Comment 7 solar (RETIRED) gentoo-dev 2005-02-16 19:00:45 UTC
video herd. ping..
Comment 8 Kevin F. Quinn (RETIRED) gentoo-dev 2005-02-26 09:22:52 UTC
Created attachment 52188 [details, diff]
Updated patch to 1.6.2-r3 latest version (1.15), and fix gtk logic error

Slight fix; got the logic upside down on gtk check.  Updated to patch against
current ebuild (where some of the src_unpack() issues have been mitigated
recently by forcing the autoreconf stuff always - I've done things slightly
differently here).

Any comment (favourable or otherwise) from media-video would be appreciated.
Comment 9 César Fernández 2005-03-01 10:04:58 UTC
It works:

+3dnow +X +avi -debug -dv -gtk +mmx +pic +quicktime -sdl +sse -yv12

Portage 2.0.51.18 (default-linux/x86/2004.0, gcc-3.4.3, glibc-2.3.4.20050125-r0, 2.6.10-nitro4 i686)
=================================================================
System uname: 2.6.10-nitro4 i686 AMD Athlon(TM) XP 1800+
Gentoo Base System version 1.6.9

ccache version 2.3 [enabled]
CFLAGS="-march=athlon-xp -mmmx -m3dnow -msse -mfpmath=sse,387 -ffast-math -O2 -fomit-frame-pointer -frename-registers -funroll-loops -fPIC -fstack-protector -pipe"
Comment 10 Bart Lauwers (RETIRED) gentoo-dev 2005-03-08 08:29:52 UTC
patch works for me
Comment 11 Mike Nerone 2005-04-12 21:38:10 UTC
Ahem...a fix for this would be nice. Anyone from media-video have a bit of time? Or hardened? Somebody? :)

BTW...the ebuild patch no longer applies cleanly.
Comment 12 Kevin F. Quinn (RETIRED) gentoo-dev 2005-04-13 04:10:25 UTC
We've been waiting for media-video to respond for some time.  If they show any interest, I'll re-work/re-check against current CVS.
Comment 13 Jan Brinkmann (RETIRED) gentoo-dev 2005-04-13 10:27:41 UTC
Kevin, would be nice if you could update the patch once again. I'll review it then and I'm inclined to apply it.
Comment 14 Kevin F. Quinn (RETIRED) gentoo-dev 2005-04-14 05:37:54 UTC
Created attachment 56250 [details, diff]
Patch against 1.6.2-r3 ebuild v1.21

Breakdown of changes:

1) Add "pic" to IUSE, so it can be used to conditionally apply the mmx patch

2) Add 'use pic && epatch ...' to apply the patch

3) Remove 'strip-flags -fstack-protector' - this was probably supposed to be
   filter-flags rather than strip-flags (which won't remove ssp on hardened
   systems).  I haven't had any problems yet with ssp enabled.

4) Remove 'if has_pie' block.  For info, the "right" way to do this is via
   'filter-flags -fpie' but it's no longer necessary with this patch.

The result is that on hardened systems, it builds PIC & PIE without any
TEXTRELs instead of failing to build.  On non-hardened systems, it should
build exactly as before.


The only 'use' flag I haven't built with is quicktime, but I don't think
that should cause any trouble (see bug #85432).
Comment 15 Jan Brinkmann (RETIRED) gentoo-dev 2005-04-17 12:37:44 UTC
hmm, just one thing. the pic useflag shouldnt be used, only by some toolchain packages.
Comment 16 solar (RETIRED) gentoo-dev 2005-04-17 13:34:11 UTC
Your right. This patch should be applied all the time and the option for mmx misbehaviors should be corrected for everybody.
/usr/lib/libmplex2-1.6.so.0.2.2 and /usr/lib/libmpeg2encpp-1.6.so.0.2.2 both violate existing shared object q/a policy.
Comment 17 Jan Brinkmann (RETIRED) gentoo-dev 2005-04-17 13:58:46 UTC
ok, thanks a lot guys. i've uploaded the patch to my devspace as it takes some time until it's available on all mirrors. i'll change SRC_URI in the ebuild in a few days to the mirror://gentoo location. thanks again!