Xcode 8 beta 1 cannot build WatchKit module

I've just started playing around with the Xcode 8 beta and am having trouble building an existing project. My problem target is a framework target which contains WatchKit code. The prefix header for the framework imports the WatchKit header like so:


#import <WatchKit/WatchKit.h>


When I build the target, I get several errors, the most notable to me being "Could not build module 'WatchKit'". The rest are (really, you can't upload screenshots here?):


cpuid.h:

GNU-style inline assembly is disabled

GNU-style inline assembly is disabled

GNU-style inline assembly is disabled

internal.h

Could not build module '_Builtin_intrinsics'

SceneKitTypes.h

Could not build module 'simd'

WKInterfaceSCNScene.h

Could not build module 'SceneKit'

MyPrefixHeader.h

Could not build module 'WatchKit'


Is anyone else running into the same issue?

Replies

Same problem here.

Same problem here.


While building module 'WatchKit' imported from /Users/123456/Documents/Development/MobileWorkspace-Xcode8Beta/MyApp/Mobile Extension/SetupInterfaceController.h:8:
While building module 'SceneKit' imported from /Applications/Xcode-beta.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator3.0.sdk/System/Library/Frameworks/WatchKit.framework/Headers/WKInterfaceSCNScene.h:11:
While building module 'simd' imported from /Applications/Xcode-beta.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator3.0.sdk/System/Library/Frameworks/SceneKit.framework/Headers/SceneKitTypes.h:7:
While building module '_Builtin_intrinsics' imported from /Applications/Xcode-beta.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator3.0.sdk/usr/include/simd/internal.h:52:
In file included from <module-includes>:4:
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/cpuid.h:177:5: error: GNU-style inline assembly is disabled
    __cpuid(__level, *__eax, *__ebx, *__ecx, *__edx);
    ^
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/cpuid.h:151:10: note: expanded from macro '__cpuid'
    __asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \
        ^
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/cpuid.h:187:10: error: GNU-style inline assembly is disabled
    __asm("  pushfl\n"
        ^
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/cpuid.h:205:5: error: GNU-style inline assembly is disabled
    __cpuid(__level, __eax, __ebx, __ecx, __edx);
    ^
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/cpuid.h:151:10: note: expanded from macro '__cpuid'
    __asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \
        ^
3 errors generated.


Submitted bug #26785123

Same issue here as well. Any update?

+1

+1

As a temporary workaround, it looks like you can add "-fgnu-inline-asm" to the Other C Flags setting.

This worked for me. Thanks!

This issue is seen due to a combination of both of these compiler options:

-fno-gnu-inline-asm -fmodules


You can workaround this issue by either disabling the use of clang modules or enabling the use of GNU inline asm.

I was just in the WWDC lab, and we came up with a simple solution: disable bitcode when building for the watchOS simulator.


To fix:

1. Highlight the watch extension target and search for the "ENABLE_BITCODE" user defined setting

2. Mouse over your desired build configuration and tap the "+" button.

3. Select "Any watchOS Simulator SDK" and set a "NO" value to disable bitcode when building for the simulator.

This worked perfectly for me in Xcode 10.2 when I was running into this issue. Thanks!