Steven M. Schultz wrote:
> Hi -
> 
>       If you're using gcc 3.3 (as SuSE 8.2 does) and the building
>       of the jpeg-mmx library fails with:
> 
> gcc -O6  -I.   -c -o jdapimin.o jdapimin.c
> /tmp/cc7IfzBn.s: Assembler messages:
> /tmp/cc7IfzBn.s:619: Error: symbol `NOT_SUPPORTED' is already defined
> gmake: *** [jdapimin.o] Error 1
> 

The reason for this it that gcc inlines the assembler function
mmxsupport() at 2 places, so the symbol NOT_SUPPORTED is defined twice.
A fix without changing the O option is to change the global symbol to a
local one. See the attached patch.

Wolfgang


>       Here is a patch to fix the problem - it seems that -O6 is too high
>       and causes the module to be miscompiled somehow.   Changing that to
>       -O2 fixes the problem:
> 
> --- Makefile.dist     2002-04-25 09:09:18.000000000 -0700
> +++ Makefile  2003-05-29 22:00:54.000000000 -0700
> @@ -25,7 +25,7 @@
>  AS= nasm
>  ASFLAGS = -f elf
>  # You may need to adjust these cc options:
> -CFLAGS= -O6  -I$(srcdir)
> +CFLAGS= -O2  -I$(srcdir)
>  # Generally, we recommend defining any configuration symbols in jconfig.h,
>  # NOT via -D switches here.
>  # However, any special defines for ansi2knr.c may be included here:
> 
>       Cheers,
>       Steven Schultz
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: eBay
> Get office equipment for less on eBay!
> http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
> _______________________________________________
> Mjpeg-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/mjpeg-users
> 

diff -ur ../jpeg-mmx-0.1.4.org/jdapimin.c ./jdapimin.c
--- ../jpeg-mmx-0.1.4.org/jdapimin.c    2000-09-19 18:04:22.000000000 +0200
+++ ./jdapimin.c        2003-05-01 14:32:10.000000000 +0200
@@ -471,16 +471,16 @@
                 "pushfl                      \n\t"      //Save Eflag to stack
                 "popl %%eax                   \n\t"      //Get Eflag from stack
                 "xorl %%ecx,%%eax              \n\t" //Compare the new Eflag with the 
original Eflag
-                "jz NOT_SUPPORTED            \n\t" //If the same, CPUID instruction 
is not supported,
+                "jz 1f            \n\t" //If the same, CPUID instruction is not 
supported,
                                                                 //skip following 
instructions and jump to
-                                                                //NOT_SUPPORTED label
+                                                                //1f label
 
                 "xorl %%eax,%%eax              \n\t" //Set eax to zero
 
                 "cpuid                       \n\t" //CPUID instruction  (two bytes 
opcode)
 
                 "cmpl $1,%%eax                \n\t"      //make sure eax return 
non-zero value
-                "jl NOT_SUPPORTED            \n\t" //If eax is zero, mmx not supported
+                "jl 1f            \n\t" //If eax is zero, mmx not supported
 
                 "xorl %%eax,%%eax              \n\t" //set eax to zero
                 "incl %%eax                   \n\t"      //Now increment eax to 1.  
This instruction is 
@@ -489,11 +489,11 @@
 
                 "andl $0x00800000,%%edx       \n\t" //mask out all bits but mmx 
bit(24)
                 "cmpl $0,%%edx                \n\t"      // 0 = mmx not supported
-                "jz      NOT_SUPPORTED       \n\t" // non-zero = Yes, mmx IS supported
+                "jz      1f       \n\t" // non-zero = Yes, mmx IS supported
 
                  "movl   $1,  mmx_supported  \n\t"
 
-                "NOT_SUPPORTED:              \n\t"
+                "1:              \n\t"
                 "movl    $mmx_supported, %%eax" //move return value to eax      
 
 
Only in .: jdapimin.c~

Reply via email to