The current architecture detection, based on the "host_cpu" part of the tuple does not work properly for a number of reason: - The code assumes that if host_cpu starts with "arm" then ARM instructions are available, which is incorrect. Indeed, Cortex-M platforms can run Linux, they are ARM platforms (so host_cpu = arm), but they don't support ARM instructions: they support only the Thumb-2 instruction set. - The armv7 case is also not very useful, as it is not standard at all to pass armv7 as host_cpu even if the host system is actually ARMv7 based. - For the same reason, the armv8 case is not very useful: ARMv8 is AArch64, and there is already a separate case to handle this architecture. So, this commit moves away from a host_cpu based logic, and instead tests using AC_CHECK_DECLS() the built-in definitions of the compiler: - If we have __ARM_ARCH_ISA_ARM defined, then it's an ARM processor that supports the ARM instruction set (this allows to exclude Thumb-2 only processors). - If we have __ARM_ARCH_7A__, then we have an ARMv7-A processor, and we can enable the corresponding optimizations - Same for __aarch64__, __i386__ and __x86_64__. In addition, we remove the AC_MSG_ERROR() that makes the build fail for all architectures but the ones that are explicitly supported. Indeed, webrtc-audio-processing builds just fine for other architectures (tested on MIPS), it's just that none of the architecture-specific optimizations will be used. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
About
This is meant to be a more Linux packaging friendly copy of the AudioProcessing module from the WebRTC[1][2] project. The ideal case is that we make no changes to the code to make tracking upstream code easy.
This package currently only includes the AudioProcessing bits, but I am very open to collaborating with other projects that wish to distribute other bits of the code and hopefully eventually have a single point of packaging all the WebRTC code to help people reuse the code and avoid keeping private copies in several different projects.
[1] http://code.google.com/p/webrtc/ [2] https://chromium.googlesource.com/external/webrtc/trunk/webrtc.git
Feedback
Patches, suggestions welcome. You can send them to the PulseAudio mailing list[2] or to me at the address below.
-- Arun Raghavan mail@arunraghavan.net
[3] http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Notes
-
Some files need to be patch to avoid pulling in the gtest framework. This should ideally be pushed upstream in some way so we're able to just pull in what we need without changing anything.
-
It might be nice to try LTO on the library. We build a lot of code as part of the main AudioProcessing module deps, and it's possible that this could provide significant space savings.