Given the following objective-c file (call it example.m): #import <Foundation/Foundation.h> int main( int argc, const char *argv[] ) { NSLog (@"Hello world!"); return 0; } Compiling with clang works fine: clang -arch armv7 -fmodules -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk example.m -c -o example.o Adding ccache fails: ccache clang -arch armv7 -fmodules -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk example.m -c -o example.o While building module 'Foundation' imported from example.m:1: While building module 'CoreFoundation' imported from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6: While building module 'Darwin' imported from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11: In file included from <module-includes>:1: /usr/include/sys/cdefs.h:680:2: error: Unsupported architecture #error Unsupported architecture ^ While building module 'Foundation' imported from example.m:1: While building module 'CoreFoundation' imported from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6: While building module 'Darwin' imported from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:11: In file included from <module-includes>:3: In file included from /usr/include/ctype.h:70: In file included from /usr/include/runetype.h:42: In file included from /usr/include/_types.h:27: In file included from /usr/include/sys/_types.h:33: /usr/include/machine/_types.h:34:2: error: architecture not supported #error architecture not supported ^ Removing the "-fmodules" flag and compiling with ccache works: ccache clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk example.m -c -o example.o
Fixed in 8955f497f3e91a935a100dc62a8eb92914546035 (by disabling ccache if -fmodules is used).
Included in v3.2.2.
I have managed to fix support for modules in this PR if you are still interested: https://github.com/ccache/ccache/pull/126