Summary: | (toolchain) xine-lib-1_rc8-r1 compile fails with error: can't find a register in class `BREG' while reloading `asm' | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Gerhard Holzmeister <gh> |
Component: | Hardened | Assignee: | The Gentoo Linux Hardened Team <hardened> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | segoda |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Gerhard Holzmeister
2004-12-24 10:12:18 UTC
Perhaps this can help, taken from http://my.execpc.com/~geezer/osd/gotchas/ 'can't find a register in class `[AREG|BREG|CREG|DREG]' while reloading `asm' New versions of the GNU assembler are pickier about the clobber lists used in inline asm. Though it worked fine with older versions of the GNU assembler, the following code is now considered incorrect: static inline void memset(void *__dest, unsigned int __fill, unsigned int __size) { __asm__ __volatile__ ("cld rep stosb" : /* no outputs */ : "c" (__size), "a" (__fill), "D" (__dest) : "ecx","eax","edi","memory"); } because registers ECX, EAX, and EDI are present in both the clobber list and the input constraints. Remove these registers from the clobber list: ... "a" (__fill), "D" (__dest) : "memory"); } and the code should assemble without error. Hopefully someone that knows how to do the above can fix things. Several other packages are having the same problem, including callgrind. Same errors here with hardened toolchain. Switching from gcc profile i686-pc-linux-gnu-3.4.3 to i686-pc-linux-gnu-3.4.3-vanilla allows sucessful compile. # emerge info Portage 2.0.51-r3 (default-linux/x86/2004.3, gcc-3.4.3, glibc-2.3.4.20040808-r1, 2.6.9-gentoo-r1 i686) ================================================================= System uname: 2.6.9-gentoo-r1 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz 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.90.0.1.1-r3 Headers: sys-kernel/linux26-headers-2.6.8.1-r1 Libtools: sys-devel/libtool-1.5.2-r7 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O2 -march=pentium4 -fstack-protector -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/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/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=pentium4 -fstack-protector -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig buildpkg ccache distlocks prelink sandbox sfperms" GENTOO_MIRRORS="ftp://gentoo.ccccom.com http://gentoo.ccccom.com http://mymirror.asiaosc.org/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="x86 X acl alsa apm arts artswrappersuid audiofile avi berkdb bitmap-fonts cdparanoia cdr crypt cups dhcp divx4linux doc dvd dvdr emacs encode fam ffmpeg flac foomatic foomaticdb fortran gdbm gif gpm hardened i8x0 ipv6 ithreads java jpeg kde kerberos ladccakde ladspa libwww mad matroska mikmod mmx motif mpeg ncurses network nls nptl odbc oggvorbis opengl oss pam pdflib perl png python qt quicktime readline real samba sdl spell sse sse2 ssl svga tcltk tcpd theora threads tiff transcode truetype unicode usb videos xine xml2 xmms xosd xprint xv xvid zlib" in the 2 "static void DEF" functions in 'src/libffmpeg/libavcodec/i386/dsputil_mmx_rnd.h' change the input regs from: '"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)' (ebx,eax,ecx,dcx) to: '"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)' (memory effective address,eax,ecx,dcx) on hardended Gentoo this should fix it.. BTW, How can i supply patches the right way for gentoo. Thanks in advance. Some addons... File src/libffmpeg/libavcodec/msmpeg4.c: function 'static inline int msmpeg4_pred_dc' input regs from : "+b" (a), "+c" (b), "+D" (c) to : "+m" (a), "+c" (b), "+D" (c) File src/post/goom/mmx.h: remove ebx from clobber in function 'static int mm_support(void)': from : "eax", "ebx", "ecx", "edx" to : "eax", "ecx", "edx" Don't why ebx isn't used es input nor output REG but moded, gcc does not like it... so remove it. in File: src/post/goom/xmmx.c Function "zoom_filter_xmmx": from: /* * pre : mm0 : clipped position on screen * * post : mm3 & mm4 : coefs for this position * mm1 : X vector [0|X] * * modif : eax,ebx */ __asm__ __volatile__ ( "movd %%mm0,%%ebx\n" "movq %%mm0,%%mm1\n" "andl $15,%%ebx\n" "psrlq $32,%%mm1\n" "shll $6,%%ebx\n" "movd %%mm1,%%eax\n" "addl %0,%%ebx\n" "andl $15,%%eax\n" "movd (%%ebx,%%eax,4),%%mm3\n" ::"g"(precalCoef):"eax","ebx") to: /* * pre : mm0 : clipped position on screen * * post : mm3 & mm4 : coefs for this position * mm1 : X vector [0|X] * * modif : eax,ecx */ __asm__ __volatile__ ( "movd %%mm0,%%ecx\n" "movq %%mm0,%%mm1\n" "andl $15,%%ecx\n" "psrlq $32,%%mm1\n" "shll $6,%%ecx\n" "movd %%mm1,%%eax\n" "addl %0,%%ecx\n" "andl $15,%%eax\n" "movd (%%ebx,%%eax,4),%%mm3\n" ::"g"(precalCoef):"eax","ecx"); and from: /* * pre : mm0 : Y pos [*|Y] * mm1 : X pos [*|X] * * post : mm0 : expix1[position] * mm2 : expix1[position+largeur] * * modif : eax,ebx */ psrld_i2r (PERTEDEC,mm0); psrld_i2r (PERTEDEC,mm1); __asm__ __volatile__ ( "movd %%mm1,%%eax\n" /*^*/ "movq %%mm3,%%mm5\n" /*^*/ "mull %1\n" "movd %%mm0,%%ebx\n" /*^*/ "punpcklbw %%mm5, %%mm3\n" /*^*/ "addl %%ebx,%%eax\n" /*^*/ "movq %%mm3,%%mm4\n" /*^*/ /*^*/ "movq %%mm3,%%mm5\n" /*^*/ "movl %0,%%ebx\n" /*^*/ "punpcklbw %%mm5,%%mm3\n" /*^*/ "movq (%%ebx,%%eax,4),%%mm0\n" /*^*/ "punpckhbw %%mm5,%%mm4\n" /*^*/ "addl %1,%%eax\n" "movq (%%ebx,%%eax,4),%%mm2\n" : : "X"(expix1), "X"(prevX):"eax","ebx" ); to: /* * pre : mm0 : Y pos [*|Y] * mm1 : X pos [*|X] * * post : mm0 : expix1[position] * mm2 : expix1[position+largeur] * * modif : eax,ecx */ psrld_i2r (PERTEDEC,mm0); psrld_i2r (PERTEDEC,mm1); __asm__ __volatile__ ( "movd %%mm1,%%eax\n" /*^*/ "movq %%mm3,%%mm5\n" /*^*/ "mull %1\n" "movd %%mm0,%%ecx\n" /*^*/ "punpcklbw %%mm5, %%mm3\n" /*^*/ "addl %%ecx,%%eax\n" /*^*/ "movq %%mm3,%%mm4\n" /*^*/ /*^*/ "movq %%mm3,%%mm5\n" /*^*/ "movl %0,%%ecx\n" /*^*/ "punpcklbw %%mm5,%%mm3\n" /*^*/ "movq (%%ecx,%%eax,4),%%mm0\n" c /*^*/ "punpckhbw %%mm5,%%mm4\n" /*^*/ "addl %1,%%eax\n" "movq (%%ecx,%%eax,4),%%mm2\n" : : "X"(expix1), "X"(prevX):"eax","ecx" ); so.. now it compile cleanly .. hth, Eric I'm not sure hardened can really support these multi-media apps. If somebody has a patch for xine-lib then please attach it hee for testing. And then it's best to push it upstream wrappered in #ifdef __PIC__. This is all fixed in 1.0 (apart from textrels, but that doesn't stop it building). Try xine-lib-1.0; builds fine for me with "everything on" (currently marked ~x86 - add the line: =media-libs/xine-lib-1.0 ~x86 to /etc/portage/package.keywords if you're otherwise stable). *** Bug 81088 has been marked as a duplicate of this bug. *** |