android: IPPICV static libraries workarounds for NDK 16
authorAlexander Alekhin <alexander.a.alekhin@gmail.com>
Fri, 5 Jan 2018 00:24:02 +0000 (00:24 +0000)
committerAlexander Alekhin <alexander.a.alekhin@gmail.com>
Fri, 5 Jan 2018 04:52:17 +0000 (04:52 +0000)
cmake/OpenCVFindLibsPerf.cmake
cmake/templates/OpenCV.mk.in

index 76d1d83..5fba24c 100644 (file)
@@ -18,6 +18,13 @@ if(WITH_IPP)
     endif()
     ocv_include_directories(${IPP_INCLUDE_DIRS})
     list(APPEND OPENCV_LINKER_LIBS ${IPP_LIBRARIES})
+
+    # Details: #10229
+    if(ANDROID AND NOT OPENCV_SKIP_ANDROID_IPP_FIX_1)
+      set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a ${CMAKE_SHARED_LINKER_FLAGS}")
+    elseif(ANDROID AND NOT OPENCV_SKIP_ANDROID_IPP_FIX_2)
+      set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-Bsymbolic ${CMAKE_SHARED_LINKER_FLAGS}")
+    endif()
   endif()
 endif()
 
index addde3a..207cd0f 100644 (file)
@@ -88,6 +88,16 @@ LOCAL_STATIC_LIBRARIES:=$(USER_LOCAL_STATIC_LIBRARIES)
 LOCAL_SHARED_LIBRARIES:=$(USER_LOCAL_SHARED_LIBRARIES)
 LOCAL_LDLIBS:=$(USER_LOCAL_LDLIBS)
 
+# Details: #10229
+ifeq ($(OPENCV_SKIP_ANDROID_IPP_FIX_1),)
+  LOCAL_LDFLAGS += -Wl,--exclude-libs,libippicv.a
+  LOCAL_LDFLAGS += -Wl,--exclude-libs,libippiw.a
+else
+  ifeq ($(OPENCV_SKIP_ANDROID_IPP_FIX_2),)
+    LOCAL_LDFLAGS += -Wl,-Bsymbolic
+  endif
+endif
+
 LOCAL_C_INCLUDES += $(OPENCV_LOCAL_C_INCLUDES)
 LOCAL_CFLAGS     += $(OPENCV_LOCAL_CFLAGS)