We have a Cocoa Touch Framework which consists of an Objective-C front-end wrapping a C/C++ cross-platform code base. We've been building this framework on Yosemite using Xcode 7.2.1. We now have a build machine running macos Sierra, with Xcode 8 and Xcode 7.2.1 installed (Xcode.app and Xcode7.2.1.app). We can still build our framework using Xcode 7.2.1, but we'd like move forward.
When attempting to build using Xcode 8, we're getting the compiler error "Implicit declaration of function '_mm_malloc' is invalid in C99...". We're also getting "Module '_Builtin_intrinsics.intel.mm_malloc' requires feature 'x86' module.modulemap.
To illustrate the issue:
- Create an iOS Cocoa Touch Framework
- Create a new .c file
- Then add #include <mm_malloc.h> to the source file
- Build
In Xcode 8, you will get the error "Module '_Builtin_intrinsics.intel.mm_malloc' requires feature 'x86' module.modulemap"
In Xcode 7.2.1, your build should succeed. If you cmd+click <mm_malloc.h>, you will be taken to the source file for mm_malloc.h.
On my machine, the path is:
/Applications/Xcode7.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.2/include/mm_malloc.h
In Xcode 8, you cannot cmd+click <mm_malloc.h>, Xcode doesn't seem to know where it lives, and pops up the "?".
Again, the framework built using Xcode 7.2.1 has been incorporated into iOS enterprise apps and successfully runs on recent iPhone and iPad devices through iOS 9+, including iOS 7.1.2 running on an iPhone 4 -- technically on iOS 7.1.2 on iPhone 4, as the framework has yet to be included in an application submitted to the appstore.
By the way, we started building this Cocoa Touch Framework in Xcode 6.4. Was this a fluke that our framework compiled in both Xcode 6.4 and Xcode 7.2.1? Or is this a bug in Xcode 8? Or what added settings are needed to get this framework to compile in Xcode 8?