Rosetta error when trying to use a x86_64-only library via XPC

I'm trying to get my macOS app running natively on the Apple Silicon DTK and it's going fine so far. Unfortunately it makes use of a third party library which isn't (and probably won't ever be) available in form of a Universal Binary. This should be no problem, though, because I've been using that library via XPC before and the documentation clearly states that mixed architectures are supported as long as they are out-of-process.

So I went ahead and configured Xcode's build settings as follows for the x86-only XPC target:
Code Block
ARCHS: x86_64
VALID_ARCHS: x86_64


The main app and also the XPC compile fine. But when running the app it fails to launch the XPC with the following error in the console:

Code Block
oah error: /var/db/oah/e089a6709d38c1a085254c76a7cb592fcceddb3f234a4aa318bb4ec25fe40d27/a37f39d2b061393d7731233ae89d90cd87c97f4edeeb46a78ad791/
c43ac96d2b/my.xpcBundleID.aot: unable to mmap __TEXT: 1


Does anyone know what's going on here?

Did anything come of this? I'm attempting to solve the exact same problem as you (moving third party library that is only available for Intel into an XPC service) and don't have immediate access to an M1 machine to test. I've compiling and running my main target as Universal and XPC service as Intel just fine so far.

Did anything come of this?

I’m not sure what happend with fedo’s app but I’ve helped other developers in similar circumstances and this approach works just fine.

Share and Enjoy

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

Rosetta error when trying to use a x86_64-only library via XPC
 
 
Q