[Ffmpeg-devel] cross compilation fails from x86_64 to mingw32

Måns Rullgård mru
Wed Aug 16 23:46:05 CEST 2006


Diego Biurrun said:
> On Wed, Aug 16, 2006 at 11:02:50PM +0200, Aurelien Jacobs wrote:
>> On Sat, 12 Aug 2006 14:51:29 +0200
>> Gianluigi Tiesi <mplayer at netfarm.it> wrote:
>>
>> > I'm cross compiling mingw32 ffmpeg on a x86_64 host.
>> > There is a check in the configure
>> > that outputs:
>> > TARGET_ARCH_X86_64=yes
>> > #define ARCH_X86_64 1
>> >
>> > depending on the host cpu, obiviuosly it will fail in i386 asm where
>> > asm code is ifdefed between x86 and x86_64,
>> > I've looked at configure and it seams that this check is unconditional
>> > i.e. is taken from the output of uname -m and not asking the compiler
>> > I suggest to extrapolate it from gcc -dumpmachine,
>> > and yes I known there is a --cpu option, but I think the approach is
>> > wrong.
>>
>> I already faced this situation and I totally agree.
>> Here is a patch which implement this.
>> It moves the cpu "normalization" after command line parsing so as
>> to be able to use $cc to detect cpu.
>> Is it ok to commit ?
>
> Hmmmmm
>
>> --- configure	(revision 6005)
>> +++ configure	(working copy)
>> @@ -905,6 +853,59 @@
>>  ranlib="${cross_prefix}${ranlib}"
>>  strip="${cross_prefix}${strip}"
>>
>> +[ -z "$cpu" ] && cpu=`$cc -dumpmachine | sed s/-.*//`
>
> Hmmm, I'm not sure what's the best way to do this.  Mans, any better
> ideas?

I don't like relying on nonstandard compiler flags to figure out the target
CPU.  Yes, I know we require gcc to compile, but we shouldn't make it harder
to support other standards compliant C compilers in the future.

> Also, maybe you'd better put this next to the MMX stuff so we have all
> processor-related tests together.

The MMX tests are testing the ability of the compiler/assembler to produce
MMX instructions.  The actual CPU capabilities are detected at runtime.

-- 
M?ns Rullg?rd
mru at inprovide.com




More information about the ffmpeg-devel mailing list