From 746f9e31c0eec6c0da2bd4cb393e585d46195525 Mon Sep 17 00:00:00 2001 From: "kma@webrtc.org" Date: Wed, 4 Jan 2012 17:47:57 +0000 Subject: [PATCH] Changed build settings for ARMv5 in Android. I found some issues in building ARMv5 with ICM. This CL includes fixes, and a design change which now will exclude any NEON libraries unless the build is for dynamic detection or for Neon specifically. Review URL: http://webrtc-codereview.appspot.com/330021 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1335 4adac7df-926f-26a2-2b94-8c16560cd09d --- Android.mk | 11 ++--------- android-webrtc.mk | 5 +++++ .../audio_coding/codecs/iSAC/fix/source/Android.mk | 14 ++++++++++---- src/modules/audio_processing/aecm/Android.mk | 4 ++++ src/modules/audio_processing/ns/Android.mk | 5 ++++- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/Android.mk b/Android.mk index e2d1e0277..160301bcc 100644 --- a/Android.mk +++ b/Android.mk @@ -74,11 +74,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \ libwebrtc_system_wrappers # Add Neon libraries. -ifneq (,$(filter '-DWEBRTC_DETECT_ARM_NEON',$(MY_WEBRTC_COMMON_DEFS))) -LOCAL_WHOLE_STATIC_LIBRARIES += \ - libwebrtc_aecm_neon \ - libwebrtc_ns_neon -else ifeq ($(ARCH_ARM_HAVE_NEON),true) +ifeq ($(WEBRTC_BUILD_NEON_LIBS),true) LOCAL_WHOLE_STATIC_LIBRARIES += \ libwebrtc_aecm_neon \ libwebrtc_ns_neon @@ -139,10 +135,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \ libwebrtc_vpx # Add Neon libraries. -ifneq (,$(filter '-DWEBRTC_DETECT_ARM_NEON',$(MY_WEBRTC_COMMON_DEFS))) -LOCAL_WHOLE_STATIC_LIBRARIES += \ - libwebrtc_isacfix_neon -else ifeq ($(ARCH_ARM_HAVE_NEON),true) +ifeq ($(WEBRTC_BUILD_NEON_LIBS),true) LOCAL_WHOLE_STATIC_LIBRARIES += \ libwebrtc_isacfix_neon endif diff --git a/android-webrtc.mk b/android-webrtc.mk index eb620bb3b..dc92aeb8e 100644 --- a/android-webrtc.mk +++ b/android-webrtc.mk @@ -33,6 +33,11 @@ MY_ARM_CFLAGS_NEON := \ -flax-vector-conversions endif +ifneq (,$(filter '-DWEBRTC_DETECT_ARM_NEON' '-DWEBRTC_ARCH_ARM_NEON', \ + $(MY_WEBRTC_COMMON_DEFS))) +WEBRTC_BUILD_NEON_LIBS := true +endif + ifeq ($(ARCH_ARM_HAVE_ARMV7A),true) MY_WEBRTC_COMMON_DEFS += \ '-DWEBRTC_ARCH_ARM_V7A' diff --git a/src/modules/audio_coding/codecs/iSAC/fix/source/Android.mk b/src/modules/audio_coding/codecs/iSAC/fix/source/Android.mk index ceca966e7..872d38873 100644 --- a/src/modules/audio_coding/codecs/iSAC/fix/source/Android.mk +++ b/src/modules/audio_coding/codecs/iSAC/fix/source/Android.mk @@ -52,7 +52,7 @@ LOCAL_CFLAGS := \ LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/../interface \ $(LOCAL_PATH)/../../../../../.. \ - $(LOCAL_PATH)/../../../../../../common_audio/signal_processing/include + $(LOCAL_PATH)/../../../../../../common_audio/signal_processing/include LOCAL_SHARED_LIBRARIES := \ libcutils \ @@ -66,6 +66,7 @@ include $(BUILD_STATIC_LIBRARY) ######################### # Build the neon library. +ifeq ($(WEBRTC_BUILD_NEON_LIBS),true) include $(CLEAR_VARS) @@ -76,13 +77,12 @@ LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES := \ filters_neon.c \ lattice_neon.S #.S extention is for including a header file in assembly. -# TODO(kma): Check with C compiler team and on line community for any status -# in the file name (.s vs .S), for a better solution. # Flags passed to both C and C++ files. LOCAL_CFLAGS := \ $(MY_WEBRTC_COMMON_DEFS) \ -mfpu=neon \ + -mfloat-abi=softfp \ -flax-vector-conversions LOCAL_C_INCLUDES := \ @@ -96,6 +96,8 @@ include external/stlport/libstlport.mk endif include $(BUILD_STATIC_LIBRARY) +endif # ifeq ($(WEBRTC_BUILD_NEON_LIBS),true) + ########################### # isac test app @@ -114,9 +116,13 @@ LOCAL_C_INCLUDES := \ LOCAL_STATIC_LIBRARIES := \ libwebrtc_isacfix \ - libwebrtc_isacfix_neon \ libwebrtc_spl +ifeq ($(WEBRTC_BUILD_NEON_LIBS),true) +LOCAL_STATIC_LIBRARIES += \ + libwebrtc_isacfix_neon +endif + LOCAL_SHARED_LIBRARIES := \ libutils diff --git a/src/modules/audio_processing/aecm/Android.mk b/src/modules/audio_processing/aecm/Android.mk index c33a957e5..10c38ca50 100644 --- a/src/modules/audio_processing/aecm/Android.mk +++ b/src/modules/audio_processing/aecm/Android.mk @@ -47,6 +47,7 @@ include $(BUILD_STATIC_LIBRARY) ######################### # Build the neon library. +ifeq ($(WEBRTC_BUILD_NEON_LIBS),true) include $(CLEAR_VARS) @@ -61,6 +62,7 @@ LOCAL_SRC_FILES := aecm_core_neon.c LOCAL_CFLAGS := \ $(MY_WEBRTC_COMMON_DEFS) \ -mfpu=neon \ + -mfloat-abi=softfp \ -flax-vector-conversions LOCAL_C_INCLUDES := \ @@ -72,3 +74,5 @@ ifndef NDK_ROOT include external/stlport/libstlport.mk endif include $(BUILD_STATIC_LIBRARY) + +endif # ifeq ($(WEBRTC_BUILD_NEON_LIBS),true) diff --git a/src/modules/audio_processing/ns/Android.mk b/src/modules/audio_processing/ns/Android.mk index aba95e1d9..255f4709c 100644 --- a/src/modules/audio_processing/ns/Android.mk +++ b/src/modules/audio_processing/ns/Android.mk @@ -49,13 +49,14 @@ include $(BUILD_STATIC_LIBRARY) ############################# # Build the neon library. +ifeq ($(WEBRTC_BUILD_NEON_LIBS),true) include $(CLEAR_VARS) +LOCAL_ARM_MODE := arm LOCAL_MODULE_CLASS := STATIC_LIBRARIES LOCAL_MODULE := libwebrtc_ns_neon LOCAL_MODULE_TAGS := optional -LOCAL_GENERATED_SOURCES := LOCAL_SRC_FILES := nsx_core_neon.c @@ -63,6 +64,7 @@ LOCAL_SRC_FILES := nsx_core_neon.c LOCAL_CFLAGS := \ $(MY_WEBRTC_COMMON_DEFS) \ -mfpu=neon \ + -mfloat-abi=softfp \ -flax-vector-conversions LOCAL_C_INCLUDES := \ @@ -74,3 +76,4 @@ ifndef NDK_ROOT include external/stlport/libstlport.mk endif include $(BUILD_STATIC_LIBRARY) +endif # ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)