OpenRCT2 / openrct2-dependencies-android

3 stars 4 forks source link

speex doesn't compile on x86_64 and x86 #2

Closed marijnvdwerf closed 8 years ago

marijnvdwerf commented 8 years ago
In file included from resample.c:104:0:
resample_neon.h:142:21: error: redefinition of 'inner_product_single'
 static inline float inner_product_single(const float *a, const float *b, unsigned int len)
                     ^
In file included from resample.c:100:0:
resample_sse.h:40:21: note: previous definition of 'inner_product_single' was here
 static inline float inner_product_single(const float *a, const float *b, unsigned int len)
                     ^
make[2]: *** [resample.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
In file included from resample.c:104:0:
resample_neon.h:142:21: error: redefinition of 'inner_product_single'
 static inline float inner_product_single(const float *a, const float *b, unsigned int len)
                     ^
In file included from resample.c:100:0:
resample_sse.h:40:21: note: previous definition of 'inner_product_single' was here
 static inline float inner_product_single(const float *a, const float *b, unsigned int len)
                     ^
make[1]: *** [resample.lo] Error 1
make: *** [install-recursive] Error 1
LRFLEW commented 8 years ago

According to the error, it's complaining that a function is being defined in both resample_neon.h and resample_sse.h. This shouldn't be happening based on any sane configuration.

In the config file, it should have either _USE_SSE (and possibly _USE_SSE2) (the x86 extension) OR _USE_NEON (the ARM extension), never both.

marijnvdwerf commented 8 years ago

On both x86 and x86_64, ./configure contained outputted these lines:

checking for SSE in current arch/CFLAGS... yes
checking for SSE2 in current arch/CFLAGS... yes
checking for NEON in current arch/CFLAGS... yes

Fixed it by passing --disable-neon, just as with arm64

LRFLEW commented 8 years ago

Fixed it by passing --disable-neon, just as with arm64

Why are you passing --disable-neon to arm64? I don't know ARM well enough to know for sure if it has that extension, but if arm7a has it, I'd be surprised if arm64 doesn't. The _USE_SSE and _USE_NEON provide useful optimizations, which can be particularly useful on the low-power ARM chips here.

If the problem is that the compiler is mis-reporting it architecture's features (possibly because it can compile multiple architectures), then overriding --(en|dis)able-neon, --(en|dis)able-sse, and --(en|dis)able-sse2 for ALL architectures based on what is available would be a good idea.