[MPlayer-dev-eng] [PATCH] fix compiling in non-linux system

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Oct 9 13:34:21 CEST 2012


Xidorn Quan <quanxunzhen at gmail.com> wrote:

>On Tue, Oct 9, 2012 at 4:37 PM, Reimar Döffinger
><Reimar.Doeffinger at gmx.de>wrote:
>
>> Xidorn Quan <quanxunzhen at gmail.com> wrote:
>>
>> >On Tue, Oct 9, 2012 at 1:44 PM, Bernd Ernesti <
>> >mplayer-dev-eng at lists.veego.de> wrote:
>> >
>> >> On Tue, Oct 09, 2012 at 12:51:07PM +0800, Xidorn Quan wrote:
>> >> > Hi,
>> >> >
>> >> > According to man page of gcc, value native for -march and -mtune
>is
>> >> > only supported on Linux at present. Using this value causes
>> >compiler
>> >> > generates unrecongized instructions on OS X.
>> >>
>> >> You should better check why your clang is not detected instead of
>> >adding
>> >> this broken patch.
>> >>
>> >> Bernd
>> >>
>> >> P.S. Your man page is wrong.
>> >>
>> >
>> >Clang doesn't support value "native" at all. I manually set argument
>> >--cc=gcc-4.7 for configure, then make, it reported something like:
>> >
>> >> {standard input}:172:no such instruction: `vcvtsi2sd (%rdx),
>> >%xmm1,%xmm1'
>>
>> To me this looks like it works perfectly, but your binutils are
>> broken/outdated and cannot work properly with your gcc version.
>>
>
>It is unrelated to any other programs. I just execute this command:
>> gcc-4.7 -I. -I/usr/local/Cellar/freetype/2.4.10/include/freetype2 \
>> -Ilibdvdread4 -march=native -S command.c
>
>then open command.s, I can find these strange instructions.

They aren't strange, they are ordinary AVX instructions, unless your CPU really does not support AVX they are supposed to be there, from the point of gcc at least.
The bug is in the assembler being unable to handle them.

>Man page of my gcc 4.7 tells me that native is only supported on
>Linux, and I've provided a link for source of man page of gcc which
>says that as well. Isn't it enough?

No, because as far as I can tell the behaviour indicates that gcc does exactly what it should and the same thing as on Linux (or in short: the man page seems wrong). It looks to me that only the assembler cannot handle the latest instructions.



More information about the MPlayer-dev-eng mailing list