On Thursday, September 17, 2015 11:18:06 PM Mike Gelfand wrote: > Hello everyone, > > I’m using cmake 3.3.1 on Mac 10.10.4. I’m building an executable target on > Mac with the following settings: > > CMAKE_OSX_ARCHITECTURES = i386;x86_64 > CMAKE_OSX_DEPLOYMENT_TARGET = 10.5 > CMAKE_OSX_SYSROOT = .../MacOSX10.10.sdk > > Right after build, executable is runnable (from inside the binary dir) and > everything’s fine. But once I do `make install`, the executable in the > install prefix starts giving out errors: > > % otool -L /install/prefix/myexecutable > ... > Inconsistent sizeofcmds > > Adding INSTALL_RPATH target property (the executable depends on a number of > shared libraries) results in another error during `make install`, although > the command isn’t failing: > > % make install > ... > -- Installing: /tmp/prefix/usr/local/rmmagent/rmmagentd > .../install_name_tool: for architecture x86_64 object: > /install/prefix/myexecutable malformed object (inconsistent sizeofcmds > field in mach header) ... > > What helps is either a) setting BUILD_WITH_INSTALL_RPATH target property to > ON (with obvious inconvenience while debugging) or b) making the executable > non-fat (i.e. setting architecture to either i386 or x86_64, but not both; > which is not what I want in the end). > > Is this a defect in cmake? Is there anything I can do to work this around?
I'm not sure where the defect is, or how to work around it, without getting more details. I've seen problems similar to this, but not exactly the same as what you are seeing. What I have seen before was discussed here: http://public.kitware.com/pipermail/cmake/2014-October/058868.html Perhaps you can go over that and see if it applies to you. In that case, the bug was in install_name_tool, and there was a simple test case to demonstrate the bug. Apple reported that it was fixed in Xcode 6.3. Clint -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers