[pulseaudio-discuss] webrtc: build failures on i386
Rex Dieter
rdieter at math.unl.edu
Fri May 27 13:31:43 UTC 2016
Arun Raghavan wrote:
> Looking at the code, they already do runtime detection, so if you build
> on a machine with SSE2 and intrinsics, you should be okay for this to
> run on any machine with or with SSE2. Example of the code:
>
> #if defined(WEBRTC_ARCH_X86_FAMILY)
> if (WebRtc_GetCPUInfo(kSSE2)) {
> WebRtcAec_InitAec_SSE2();
> }
> #endif
I found at least one place where runtime detection was short-circuited in ./webrtc/common_audio/fir_filter.cc :
(I found FIRFilterSSE2 cannot compile at all if -msse2 isn't enabled (and __SSE2__ isn't defined), at least not with gcc6 on fedora 24)
// If we know the minimum architecture at compile time, avoid CPU detection.
#if defined(WEBRTC_ARCH_X86_FAMILY)
#if defined(__SSE2__)
filter =
new FIRFilterSSE2(coefficients, coefficients_length, max_input_length);
#else
// x86 CPU detection required.
if (WebRtc_GetCPUInfo(kSSE2)) {
filter =
new FIRFilterSSE2(coefficients, coefficients_length, max_input_length);
} else {
filter = new FIRFilterC(coefficients, coefficients_length);
}
I had to patch this to unconditionally follow the #else case on x86, see also:
http://pkgs.fedoraproject.org/cgit/rpms/webrtc-audio-processing.git/tree/webrtc-audio-processing-0.2-x86_sse2_runtime_detection.patch
and related,
http://pkgs.fedoraproject.org/cgit/rpms/webrtc-audio-processing.git/tree/webrtc-audio-processing-0.2-x86_msse2.patch
to force use of -msse2 compiler flag on x86 builds.
-- Rex
More information about the pulseaudio-discuss
mailing list