[MPlayer-dev-eng] Compile with gcc4 on x86

Bret Hughes bhughes at elevating.com
Mon Apr 18 07:51:28 CEST 2005


On Thu, 2005-04-14 at 09:01, Vladimir Kondratiev wrote:
> Hi,
> attached is patch to compile mplayer with gcc4.
> number of problems fixed.
> Most "real" ones are (1) "X" vs. "m" in inline asm in mmx.h and (2)
> several cases when expression was specified for "m" (memory) for inline
> asm. gcc4 generates incorrect asm in 1-st case and report "memory
> location not directly addressable" in 2-nd.
> Rest of fixes are trivial.
> 
> I verified on all movies I have that it works.
> 
> Patch applies to last CVS version I downloaded, MPlayer-20050413
> 
> Regards, Vladimir
> 
> ----
> 

I am trying to compile cvs 20040417 on a fedora core 4 test2 box and got
a lot further with this patch than without.  I am not a c coder and do
not know the proper way to fix following lvalue error:

cc -c -I../libvo -I../../libvo -I/usr/X11R6/include -fno-PIC -O4
-march=i586 -mtune=i586 -pipe -ffast-math -fomit-frame-pointer
-D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I. -I..
-I../osdep -I/usr/include/freetype2 -I/usr/include/SDL -D_REENTRANT
-I/usr/X11R6/include    -DMPG12PLAY  -o aclib.o aclib.c
In file included from aclib.c:84:
aclib_template.c: In function 'fast_memcpy_MMX2':
aclib_template.c:252: error: invalid lvalue in assignment
aclib_template.c:253: error: invalid lvalue in assignment
aclib_template.c:341: error: invalid lvalue in assignment
aclib_template.c:342: error: invalid lvalue in assignment
make[1]: *** [aclib.o] Error 1

I am assuming this is one of the lvalue/rvalue deals that gcc4 has
disallowed :

from aclib_template.c
    251                 :: "r" (from), "r" (to) : "memory");
    252                 ((const unsigned char *)from)+=64;
    253                 ((unsigned char *)to)+=64;


lines 341 and 342 are the same deal.

I do not understand enough about what is happening to fix it.  It looks
like the value of from is being treated as a pointer and incremented by
64 or something like that but is declared as type memory? If someone can
give me a hint I will try to fix it.

Bret





More information about the MPlayer-dev-eng mailing list