[FFmpeg-devel] [PATCH] forgotten "enable ppc64" for arch == ppc64
Måns Rullgård
mans
Tue May 26 11:56:35 CEST 2009
Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
> On Tue, May 26, 2009 at 10:14:02AM +0100, M?ns Rullg?rd wrote:
>> Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
>>
>> > On Mon, May 25, 2009 at 11:11:22PM +0100, M?ns Rullg?rd wrote:
>> >> > @@ -1808,12 +1808,13 @@
>> >> > G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
>> >> > add_cflags -mcpu=970 -mpowerpc-gfxopt -mpowerpc64
>> >> > warn_altivec disabled PPC970
>> >> > - enable ppc64
>> >> > + subarch="ppc64"
>> >> > ;;
>> >> > Cell|CELL|cell)
>> >> > add_cflags -mcpu=cell
>> >> > warn_altivec disabled Cell
>> >> > - enable ppc64 ldbrx
>> >> > + subarch="ppc64"
>> >> > + enable ldbrx
>> >> > ;;
>> >>
>> >> Remove all ppc64 manipulations here.
>> >
>> > I have some doubts that's going to really work in general, but patch
>> > attached.
>>
>> Why would it not work? Remember that e.g. a 970 can be run 32-bit
>> code, so setting ppc64 based on CPU type is wrong.
>
> Well, I don't really know wtf that stuff is supposed to do, but this is
> what my theory is.
> Because if someone runs a g5 the arch returned by the OS is either
> ppc or ppc64. If the arch is ppc and someone now uses -cpu=g5 it
> adds "-mpowerpc64", so you get a 64 bit build but ARCH_PPC64 is not
> set.
The -mcpu flags automatically sets -mpowerpc64, -mpowerpc-gfxopt, and
a few other flags, so we can drop the explicit setting of those from
the configure script.
To correctly build 32-bit code for a 64-bit CPU, we need to add
-m[no-]powerpc64 depending on the value of $arch after setting the
-mcpu flag.
> Alternatively, if the arch returns ppc64, cpu is not given but the
> compiler by default builds a 32 bit binary
That should be considered a broken system configuration.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list