[mythtv] [mythtv-commits] Ticket #10542: configure incorrectly detects VIA c3 and enables cmov etc...

Michael T. Dean mtdean at thirdcontact.com
Thu Apr 5 18:13:37 UTC 2012

<sending a copy to -dev list, too, as a final update>


Thanks for the information, and with it comes good news and bad news. 
The good news is that we now understand exactly what's going on. The bad 
news is that MythTV's configure is doing the right thing, but the 
underlying system is broken.

MythTV's configure script (which is based on ffmpeg's configure script), 
has 2 mechanisms for detecting CPU/arch. The preferred solution on a 
GCC-based system is to ask the compiler for the required information 
(using a function based on the below gcc commands). Where that fails, or 
on non-GCC-based systems, we attempt to guess based on the CPU name. The 
guesses based on CPU name should work fine for you, but, unfortunately, 
the preferred solution--asking the compiler for system information--is 

The problem is that your compiler is compiled incorrectly, such that it 
thinks it's compiling code for a Pentium 2-based system (where P2 
supports cmov). Therefore, when asking for "native" compile options, we 
get the line:

COLLECT_GCC_OPTIONS= '-v' '-c' '-o' '/tmp/garbage.o' 
/usr/libexec/gcc/i586-pc-linux-gnu/4.5.3/cc1 -quiet -v /tmp/garbage.c 
-D_FORTIFY_SOURCE=2 -march=pentium2 -mtune=generic -quiet -dumpbase 
garbage.c -auxbase-strip /tmp/garbage.o -version -o /tmp/ccRfOvwb.s

which says -march=pentium2, rather than -march=c3, so we end up doing 
exactly what the compiler tells us to and configuring for a Pentium 2 build.

Therefore, you'll either have to "work around" the issue by specifying 
the exact options required to compile for your system (basically "cross 
compiling" for the proper processor on your system); or hack the 
configure script to remove the gcc native options check (remove the case 
statement on lines 2610-2622) so that you fall back to the name-based 
detection; or--the best solution, but the most work--fix the underlying 
compiler (and, likely OS) by building it with proper configuration for 
your system.

I'm going to re-close this as an "Upstream Bug", since the problem seems 
to be a problem with how Gentoo is building the compiler/OS for your 
C3-based system.

Thanks for the report, and feel free to ask for help working around the 
issue on the -users list.


On 04/05/2012 03:16 AM, Andrew Fowler wrote:
> Mike,
> Here you go.
> Andrew
> On Wednesday 04 April 2012 18:05:55 you wrote:
>> Andrew,
>> Thanks for the info. We now need you to run another couple commands and
>> send their output:
>> touch /tmp/garbage.c&&
>> gcc -march=native -v -c -o /tmp/garbage.o /tmp/garbage.c>
>> $HOME/march.txt 2>&1
>> gcc -mcpu=native -v -c -o /tmp/garbage.o /tmp/garbage.c>  $HOME/mcpu.txt
>> 2>&1
>> and then send march.txt and mcpu.txt as attachments, please.
>> Thanks,
>> Mike
>> On 04/04/2012 02:27 PM, Andrew Fowler wrote:
>>> Mike,
>>> Sounds like you know more about the internals of the configure script
>>> than I do - wasn't looking forward to trying to make an acceptable
>>> patch myself ;-)
>>> Here you go.
>>> Andrew
>>> On Wednesday 04 April 2012 10:46:42 you wrote:
>>>> Andrew and/or Simon,
>>>> Please do a make distclean and run configure with only:
>>>> ./configure --enable-proc-opt 2>&1 | tee $HOME/configure_output.txt
>>>> and do:
>>>> cat /proc/cpuinfo>   $HOME/cpuinfo.txt
>>>> and then send me a copy of cpuinfo.txt (please attach the file--don't
>>>> copy/paste), configure_output.txt, and (in the mythtv source
>>>> directory),
>>>> config.ep.  We should be handling Via Ezra, now, so either your
>>>> cpuinfo
>>>> has some strangeness in it or there's breakage elsewhere in the script
>>>> that undoes our checks.
>>>> Thanks,
>>>> Mike
>>>> On 04/03/2012 06:41 PM, MythTV wrote:
>>>>> #10542: configure incorrectly detects VIA c3 and enables cmov etc...
>>>>> -------------------------------+------------------------------------
>>>>> --
>>>>>     Reporter:  andrew@…           |           Type:  Bug Report -
>>>>>     General
>>>>>       Status:  new                |       Priority:  minor
>>>>> Milestone:  0.24.3             |      Component:  MythTV - General
>>>>>      Version:  0.24.2             |       Severity:  medium
>>>>>     Keywords:  c3 cmov configure  |  Ticket locked:  0
>>>>> -------------------------------+------------------------------------
>>>>> --
>>>>>     On gentoo using the media-tv/mythtv-0.24.2_p20120315 ebuild
>>>>>     ./configure
>>>>>     uses --enable-proc-opt which incorrectly assumes that my Ezra
>>>>>     CPU
>>>>>     has cmov extensions etc...
>>>>>     When it has compiled the binary crashes with 'illegal
>>>>>     instruction'
>>>>>     trying to run mythtv-setup
>>>>>     Attempting to work around this by passing --tune=c3
>>>>>     --arch=i586
>>>>>     --enable- mmx --enable-amd3dnow --enable-memalign-hack
>>>>>     --disable-sse --disable-ssse3 --disable-amd3dnowext --cpu=c3
>>>>>     etc....
>>>>>     Seems this bug appeared 5 years ago and was squashed - but it
>>>>>     seems
>>>>>     to
>>>>>     have come back.

More information about the mythtv-dev mailing list