Having issues compiling the IOPCIFamily kext

I am trying to compile the IOPCIFamily kext, but it isn't working with me. I'm normally pretty good with troubleshooting, but I'm at a complete loss. I don't even know where to begin 😆 I saw someone say on a thread from 4 years ago that you need to compile XNU to compile IOPCIFamily. I successfully compiled XNU (after much trial and error), but now I'm not sure what to do with it. Could anyone point me in the right direction? Thanks!

Replies

[It’d help if you included the error as text rather than a screen shot. See Quinn’s Top Ten DevForums Tips for this and other tips.]

The error you’re seeing:

unable to resolve product type 'com.apple.product-type.kernel-extension.iokit.shallow' for platform 'macosx'

relates to a fundamental but generally hidden feature of Xcode:

  • Every target has a product type. For example, an app target builds differently than a framework target which builds differently than a kext target.

  • That product type must be supported by your platform. You can’t, for example, build a kext target for iOS.

  • The way that the product type builds can vary by platform. For example, Xcode builds macOS frameworks differently than iOS frameworks.

You can’t change the product type of a target. It’s set when you create the target and is fixed after that.

If you dig into the Xcode project file, you’ll see the product manifest as a property called productType. For third-party kexts, this is always com.apple.product-type.kernel-extension.

In this case the target you’re trying to build uses a product type (com.apple.product-type.kernel-extension.iokit.shallow) that’s not supported by your platform (macosx). I suspect that this is because you’re using the public macOS SDK, which supports fewer product types than the internal SDK used by engineering teams at Apple. However, I don’t have all the details here because, like you, I work exclusively with Apple’s public tools.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • I forgot to check in on this, it's a shame that it's not available to the public. Regardless, I appreciate the answer. Thank you so much!

Add a Comment