diff mbox

[FFmpeg-devel] rv34dsp: Exclude mmx for x86_64 at build time

Message ID 20170217102412.18872-1-hugo@beauzee.fr
State New
Headers show

Commit Message

Hugo Beauzée-Luyssen Feb. 17, 2017, 10:24 a.m. UTC
The function is not defined when building for x86_64
---
 libavcodec/x86/rv34dsp_init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Carl Eugen Hoyos Feb. 17, 2017, 10:50 a.m. UTC | #1
2017-02-17 11:24 GMT+01:00 Hugo Beauzée-Luyssen <hugo@beauzee.fr>:
> The function is not defined when building for x86_64

But it is declared unconditionally.

How can the issue you are trying to fix be reproduced?
Why is this the only occurrence?

Carl Eugen
Hugo Beauzée-Luyssen Feb. 17, 2017, 10:56 a.m. UTC | #2
On Fri, Feb 17, 2017, at 11:50 AM, Carl Eugen Hoyos wrote:
> 2017-02-17 11:24 GMT+01:00 Hugo Beauzée-Luyssen <hugo@beauzee.fr>:
> > The function is not defined when building for x86_64
> 
> But it is declared unconditionally.
> 
> How can the issue you are trying to fix be reproduced?
> Why is this the only occurrence?
> 
> Carl Eugen

Hi,

This problem arose while building VLC for Android-x86_64.
I'm quite convinced there is a similar issue for VP8, but we don't use
that module in our builds.
It could be a good idea to conditionally declare the function as well
indeed.

Regards,
Carl Eugen Hoyos Feb. 17, 2017, 11:02 a.m. UTC | #3
2017-02-17 11:56 GMT+01:00 Hugo Beauzée-Luyssen <hugo@beauzee.fr>:
> On Fri, Feb 17, 2017, at 11:50 AM, Carl Eugen Hoyos wrote:
>> 2017-02-17 11:24 GMT+01:00 Hugo Beauzée-Luyssen <hugo@beauzee.fr>:
>> > The function is not defined when building for x86_64
>>
>> But it is declared unconditionally.
>>
>> How can the issue you are trying to fix be reproduced?
>> Why is this the only occurrence?
>>
>> Carl Eugen
>
> Hi,
>
> This problem arose while building VLC for Android-x86_64.

How can we reproduce the issue?

> I'm quite convinced there is a similar issue for VP8, but we don't use
> that module in our builds.

You also disable huffyuv?

> It could be a good idea to conditionally declare the function as well
> indeed.

I would prefer not to add more conditionals to the files and I wonder
why this issue triggers only in this file for you - dead code elimination
is needed in many places when compiling FFmpeg.

Carl Eugen
Hendrik Leppkes Feb. 17, 2017, 1:10 p.m. UTC | #4
On Fri, Feb 17, 2017 at 11:56 AM, Hugo Beauzée-Luyssen <hugo@beauzee.fr> wrote:
> On Fri, Feb 17, 2017, at 11:50 AM, Carl Eugen Hoyos wrote:
>> 2017-02-17 11:24 GMT+01:00 Hugo Beauzée-Luyssen <hugo@beauzee.fr>:
>> > The function is not defined when building for x86_64
>>
>> But it is declared unconditionally.
>>
>> How can the issue you are trying to fix be reproduced?
>> Why is this the only occurrence?
>>
>> Carl Eugen
>
> Hi,
>
> This problem arose while building VLC for Android-x86_64.
> I'm quite convinced there is a similar issue for VP8, but we don't use
> that module in our builds.
> It could be a good idea to conditionally declare the function as well
> indeed.

There is already a condition that will exclude actually using the
function on x86_64, and all our regular builds pass just fine.

Note that FFmpeg currently relies on DCE (Dead Code Eliminiation) to
strip references to unused functions, like in this case, so if your
build system doesn't provide DCE, then FFmpeg build can and will fail.

- Hendrik
diff mbox

Patch

diff --git a/libavcodec/x86/rv34dsp_init.c b/libavcodec/x86/rv34dsp_init.c
index 7310122458..116beb31fc 100644
--- a/libavcodec/x86/rv34dsp_init.c
+++ b/libavcodec/x86/rv34dsp_init.c
@@ -35,8 +35,10 @@  av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (ARCH_X86_32 && EXTERNAL_MMX(cpu_flags))
+#if ARCH_X86_32
+    if (EXTERNAL_MMX(cpu_flags))
         c->rv34_idct_dc_add = ff_rv34_idct_dc_add_mmx;
+#endif
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         c->rv34_inv_transform_dc = ff_rv34_idct_dc_noround_mmxext;
         c->rv34_idct_add         = ff_rv34_idct_add_mmxext;