[Ffmpeg-devel] cross compilation fails from x86_64 to mingw32
Måns Rullgård
mru
Wed Aug 16 23:59:09 CEST 2006
Aurelien Jacobs said:
> On Wed, 16 Aug 2006 22:46:05 +0100 (BST)
> M?ns Rullg?rd <mru at inprovide.com> wrote:
>
>>
>> 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.
>
> Any other solution to detect target CPU ?
Not off the top of my head.
> `uname -m` gives the host CPU which is not what we are looking for.
Yes, I'm aware of the problem. I just don't want to fix it in a non-portable
way.
> Another possible solution is to test if $cc support -dumpmachine then
> use it else use uname -m. Would this be ok ?
It sounds a bit messy...
I'll have to think about it.
--
M?ns Rullg?rd
mru at inprovide.com
More information about the ffmpeg-devel
mailing list