Itseez/opencv — pull request #1725 by kiranpradeep (2013-10-30 18:04:13+00:00)
Title: Duplicate surf.o's with same size in iOS OpenCV framework fat binary ( for each architecture ).

Issue: In opencv2 library from iOS OpenCV framework, I ran

lipo opencv2 -thin armv7 -output armv7.a
ar -tv armv7.a | grep surf.o

rw-r--r--	501/20	52144 Jul 1 20:54 2013 surf.o
rw-r--r--	501/20	52144 Jul 1 20:54 2013 surf.o

Cause: This is since base name truncation by Xcode's libtool. During build, surf.o is generated from surf.cpp. In addition to that, surf.ocl.o ( from surf.ocl.cpp ) is basename truncated by Xcode's libtool to surf.o.

Since the size of both object files inside fat binary are of same size, we have missed either surf.ocl.cpp or surf.cpp in the final opencv2 library for iOS. To confirm, XCode's linker throws duplicate symbols in some projects using OpenCV. In fact, there are warning's about duplicate files during build of OpenCV using iOS by "python opencv/platforms/ios/build_framework.py ios" command.

Request for comment: There are other similar files in OpenCV with similiar naming issues. If this renaming is the way to fix this issue, the remaining files could be renamed in further commit's.

Note: In Ubuntu Linux, there is no base name truncation. I ran ar to see
ar -tv libopencv_nonfree.a
surf.cpp.o
surf.ocl.cpp.o